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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with using QueryUnload on windows shutdown

Status
Not open for further replies.

john95

Programmer
Jul 12, 2002
3
GB
Hi
I've written a little app that is loaded on start up and then does nothing until its QueryUnload function is triggered by the system shutting down.

Part of my code displays a message box. The problem I have is that after a few seconds, windows displays a message saying "this program is not responding.....". This message is displayed over my msgbox for a bit and then the system shuts down anyway.

The only solutions to this problem (that I can think of) are:
1) Pause the shutdown process until my code has finished
2) Cancel the shutdown, run my code, and then shutdown the system myself
3) Change the shutdown timeout and then change it back when I've finished

I'm not even sure if 1 or 3 are possible, and 2 has a major problem as there is no way of knowing whether the system is being turned off or restarted.

Any ideas? Anyone done something similar?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top