Jump to content

Start script when you click shutdown button?


Recommended Posts

Is there a way to start a script when I click Start\Shutdown?

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Link to comment
Share on other sites

Maybe this is what you need?

; terminate a script right [i]before[/i] a user shuts
; VicTT
; DllCall("Kernel32", "ubyte", "SetProcessShutdownParameters", "dword", 0x400, "dword", 0x000)

Global $WM_QUERYENDSESSION = 0x0011
Func InterceptShutdown($hWnd, $msg, $w, $l)
    MsgBox(0, "", "Shutting down")
EndFunc  ;==>InterceptShutdown
GUIRegisterMsg($WM_QUERYENDSESSION, "InterceptShutdown")
While 1
    Sleep(10)
WEnd

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

Nope, that just makes a msgbox AFTER I have shutdown, which means it is too late to have the script really do anything. I was wandering if there was a way to have a script run when you click the button that brings up the gui asking you to shutdown (I guess the first post was kind of deceiving since I asked to start a script after you clicked shutdown).

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Link to comment
Share on other sites

But if it takes too long won't the computer shutdown before its finished?

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...