|
-
Dec 24th, 2001, 12:06 PM
#1
Thread Starter
Hyperactive Member
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
-
Dec 27th, 2001, 09:53 AM
#2
Thread Starter
Hyperactive Member
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
-
Dec 28th, 2001, 01:17 PM
#3
Thread Starter
Hyperactive Member
anyone..
Sorry, but this question is bugging me a lot.
-
Dec 30th, 2001, 01:28 AM
#4
Hyperactive Member
Public Declare Function AbortSystemShutdown Lib "advapi32.dll" Alias "AbortSystemShutdownA" (ByVal lpMachineName As String) As Long
-
Dec 30th, 2001, 11:37 AM
#5
Thread Starter
Hyperactive Member
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
-
Jan 3rd, 2002, 08:37 AM
#6
Frenzied Member
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
-
Jan 4th, 2002, 10:11 AM
#7
Thread Starter
Hyperactive Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|