Re: Notification of WIndows Shutdown.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



You might want to take a look at this then:

http://msdn2.microsoft.com/en-us/library/ms683242(VS.85).aspx

Basically you call SetConsoleCtrlHandler to set a callback routine, and events like logoff and shutdown invoke that routine with an event type parameter.

Your program might need to be linked for Subsystem:Console but I don't think that's a requirement.

"PeterD" <peter2@xxxxxxxxxx> wrote in message news:nokvn3prv6osgm1ttv081l10b2oh5f2g62@xxxxxxxxxx
On Fri, 4 Jan 2008 21:09:43 -0000, "Mike Williams"
<mike@xxxxxxxxxxxxxxxxx> wrote:

...

Yes, I tried these but I forgot to say this application doesn't use a
form...

I stuck a 'dummy' form in and the only message I got was that #1
(unlocad from code) was invoked.

.