-
System Shutdown....
I am making an application. I want to prohibit the computer from shutting down until the application is complete. How can this be done? I think I have heard of a system control of some sort that can monitor sleep mode and such, and I figure it could handle this as well. If there is a more direct route that does not require a control, such as some kind of global hook procedure, that would very helpful. Thank you very much. Happy Holidays.
Joe
-
Also...
It would also be okay if there were only a method to inform the user of the program execution and then prompt them if they really wish to shut down. Although I'd prefer to completely prevent a user from shutting down the app, if the other way is the only way possible, that would be fine as well.
Joe
-
anyone..
Sorry, but this question is bugging me a lot.
-
Public Declare Function AbortSystemShutdown Lib "advapi32.dll" Alias "AbortSystemShutdownA" (ByVal lpMachineName As String) As Long
-
Thank you...
One last question. How do I know when the system is about to shutdown. I just found out about a wm constant for querying system shutdown. It had a bad side effect on NT, so if I query with subclassing then actually abort by using the API command, shoudl it work on any OS? Thank you very much.
Joe
-
if the system is about to shut down then it'll try and shut down your program in the query unload procedure of the form
-
NT has a problem...
This is a documented issue to which I do not know the answer. In NT, if you attempt to abort the system shutdown, the system attempts to shutdown. It receives the abort message, but does not respond appopriately; the "blackmesh" remains over the screen. If you hit ctrl alt del, when you come out of it, the system is back to normal condition. Is there any way around this??? Thank you.
Joe
P.S. I tried both wm_queryendsession canceling and AbortSystemShutdown API