Hawkwing Posted August 7, 2009 Posted August 7, 2009 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.
somdcomputerguy Posted August 7, 2009 Posted August 7, 2009 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.
Hawkwing Posted August 7, 2009 Author Posted August 7, 2009 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.
Juvigy Posted August 7, 2009 Posted August 7, 2009 Do you see this part? While 1 Sleep(10) WEnd Put in the loop what you want to do. It will be executed before the actual shutdown of the system.
Hawkwing Posted August 7, 2009 Author Posted August 7, 2009 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now