Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop Windows Shut Down 1

Status
Not open for further replies.

CasperTFG

Programmer
Nov 15, 2001
1,210
0
0
US
I think this has been answered before but I can't seem to find it.

I Want to stop windows from being shut down if something hasn't happened.

When windows shuts down it tries to close the program I made the program with the code running in the unload event so when it tries to unload it the code is fired fine. Now all I need is the command to tell windows to cancel the shutdown. Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
Here is a part of the MSDN library:

The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls the ExitWindows function. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.

After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.

<end MSDN library>

So if I understand this well, you only need an application returning zero on the WM_QUERYENDSESSION to cancel the shutdown.

Marcel


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top