Quantcast
Channel: psappdeploytoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1769

New Post: Trying to detect "Shutdown.exe /r /t 1000"

$
0
0
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:
[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/538137

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.

Viewing all articles
Browse latest Browse all 1769

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>