Trying to detect "Shutdown.exe /r /t 1000"
I came close with ideas from this http://blog.stevex.net/making-a-windows-forms-app-respond-to-system-shutdown/
which translated to PS I get:
Do I really need to go through [System.Windows.Forms] just to get the MSG property to read/detect WM_QUERYENDSESSION?
PS: I'm no C# wiz, I just get by in PowerShell.
I came close with ideas from this http://blog.stevex.net/making-a-windows-forms-app-respond-to-system-shutdown/
which translated to PS I get:
[int]$WM_QUERYENDSESSION = 0x11
$m = [System.Windows.Forms.Message]
$msg=$m.GetProperty("msg") #returns $null
Even found something here but it wasn't usable (http://psappdeploytoolkit.codeplex.com)/discussions/538137Do I really need to go through [System.Windows.Forms] just to get the MSG property to read/detect WM_QUERYENDSESSION?
PS: I'm no C# wiz, I just get by in PowerShell.