Results 1 to 7 of 7

Thread: System Shutdown....

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    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

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    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

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    anyone..

    Sorry, but this question is bugging me a lot.

  4. #4
    Hyperactive Member Azz00's Avatar
    Join Date
    Sep 2001
    Location
    Scotland
    Posts
    457
    Public Declare Function AbortSystemShutdown Lib "advapi32.dll" Alias "AbortSystemShutdownA" (ByVal lpMachineName As String) As Long
    www.azzmedia.co.uk

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    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

  6. #6
    Frenzied Member numtel's Avatar
    Join Date
    Apr 2000
    Location
    CA
    Posts
    1,163
    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

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    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
  •  



Click Here to Expand Forum to Full Width