Danp2 Posted January 10, 2008 Posted January 10, 2008 I need to perform some actions before my script exits, and I am having a difficult time handling a system shutdown or logoff request. Using the latest version of Autoit, I have tried:OnAutoItExit GUIRegisterMsg for either WM_QUERYENDSESSION or WM_ENDSESSIONto no avail.I've searched the forums and found instances where others were having the same difficulties. Does anyone have a working example?Dan Latest Webdriver UDF Release Webdriver Wiki FAQs
/dev/null Posted January 10, 2008 Posted January 10, 2008 I need to perform some actions before my script exits, and I am having a difficult time handling a system shutdown or logoff request. Using the latest version of Autoit, I have tried:OnAutoItExit GUIRegisterMsg for either WM_QUERYENDSESSION or WM_ENDSESSIONto no avail.I've searched the forums and found instances where others were having the same difficulties. Does anyone have a working example?Dantry this: http://www.autoitscript.com/forum/index.ph...mp;#entry399602CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
Danp2 Posted January 10, 2008 Author Posted January 10, 2008 Hi Kurt, I've already tried the following, which was based on the post you referenced: $WM_QUERYENDSESSION = 0x0011 GUICreate("ShutDownNotificationGui") GUIRegisterMsg($WM_QUERYENDSESSION, "_ShutdownInitiated") GUISetSTate(@SW_HIDE) Global $ShutdownInitiated = False While Not $ShutdownInitiated sleep(10) WEnd If $ShutdownInitiated Then MsgBox(0, "Shutdown", "Shutdown Initiated!", 5) EndIf Func _ShutdownInitiated($hWndGUI, $MsgID, $WParam, $LParam) $ShutdownInitiated = True Return True EndFunc Any other ideas or suggestions? Thanks, Dan Latest Webdriver UDF Release Webdriver Wiki FAQs
Draygoes Posted February 1, 2008 Posted February 1, 2008 I hope that bumping this topic wont get me into trouble but I am really interested in this, as I have the same problem. Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.
DirtDBaK Posted February 2, 2008 Posted February 2, 2008 ... Why did you post this in example scripts?...Did you not notice the top of the page where it says:This is not a general support forum! [center][/center]
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