Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

Ok, Windows is shutting down.... how?

Once you press shutdown and select "Shutdown" or "Reboot" how can my application tell which was chosen?  If the system is rebooting I want to ask a quistion and if it is shutting down or logging off I want to bypass the question.

I've asked this on a few board with a "No Idea!" responce from most......   PLEASE Help!!!!
1 Solution
Put the following in your form unload event.

If UnloadMode =2  Then
' WinTel is Shutting Down
Msgbox "This is your Question"
Cancel = True
' ???
' What ever it is
End if

DaneJonesAuthor Commented:
This gets triggered when the app is getting closed by either by Shutdown, reboot, log off, or restart in Dos mode.  I want to know how to trigger it ONLY when the system is being rebooted. Not Any of the other options in the shut down menu.
You can't know it, becuase when you ask for it, the system send "normal" close request message, your program can never know where it asked before rebooting or restarting, in both cases it send the standard message of close request.
The same request messages are send by the tak list application as well

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

DaneJonesAuthor Commented:
When the system shutsdown it saves the value from the shutdown menu in the registry at.....

"Shutdown Setting"=dword:00000001

DaneJonesAuthor Commented:
Sorry Peps I'm going to with draw my question unless anyone can come up with a better solution than the one I've found...
I'm the one that Email you....
DaneJonesAuthor Commented:
Adjusted points to 355
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now