From: kbulgrien on
See <a href="http://zone.ni.com/devzone/cda/epd/p/id/4394" target="_blank">http://zone.ni.com/devzone/cda/epd/p/id/4394</a>&nbsp;for <a href="ftp://ftp.ni.com/pub/devzone/epd/windows_messaging_que.zip" target="_blank">windows_messaging_que.zip</a>&nbsp;and use it to listen for WM_POWERBROADCAST, but, note&nbsp;this&nbsp;DOES NOT WORK UNLESS THE&nbsp;LabVIEW APPLICATION IS COMPILED INTO AN EXECUTABLE (.exe)!&nbsp; When running within the development environment, the message is never caught.&nbsp; We didn't successfully catch WM_QUERYENDSESSION this way either, but in our case, we did not care, and so did not pursue it further.
&nbsp;