UQOII Posted April 19, 2007 Share Posted April 19, 2007 Hi, my second post (the first post was on the rong place ) i want a script that shuts down the pc if you pressed any key so, if i press the ''a'' key (and all other keys) must shutdown the pc i hope someone can help my greetsz UQOII [center]uqoii.nl[/center] Link to comment Share on other sites More sharing options...
Cyber Posted April 19, 2007 Share Posted April 19, 2007 (edited) Use my Press CTRL+ALT+SHIFT+QHotKeySet("^+!q","_bye") while 1 Sleep(1000) WEnd Func _bye() $i=5 $msgRet = 0 for $i=5 to 0 step -1 $msgRet = MsgBox(49,$title,"Shutdown in " & $i & " seconds",1) if $msgRet = 2 then $i = 0 EndIf Next If $msgRet <> 2 Then ;spegnimento MsgBox(0,$title,"Ciao ciao!",1) Shutdown(13) Else MsgBox(0,$title,"Shutdown cancel",2) EndIf EndFunc Edited April 19, 2007 by Cyber Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
UQOII Posted April 19, 2007 Author Share Posted April 19, 2007 Use my HotKeySet("^+!q","_bye") while 1 Sleep(1000) WEnd Func _bye() $i=5 $msgRet = 0 for $i=5 to 0 step -1 $msgRet = MsgBox(49,$title,"Shutdown in " & $i & " seconds",1) if $msgRet = 2 then $i = 0 EndIf Next If $msgRet <> 2 Then ;spegnimento MsgBox(0,$title,"Ciao ciao!",1) Shutdown(13) Else MsgBox(0,$title,"Shutdown cancel",2) EndIf Exit EndFunc i'll test it [center]uqoii.nl[/center] Link to comment Share on other sites More sharing options...
Paulie Posted April 19, 2007 Share Posted April 19, 2007 Hi, my second post (the first post was on the rong place ) i want a script that shuts down the pc if you pressed any key so, if i press the ''a'' key (and all other keys) must shutdown the pc i hope someone can help my greetsz UQOII#Include <Misc.au3> For $Chars = 32 to 127 $HChars = Hex($Chars) If _IsPressed($HChars) then MsgBox(0,"test", "Your computer would have shut down.") ;Replace this line with: Shutdown(1) EndIf Next Thats not every button, but its most of them... Link to comment Share on other sites More sharing options...
Cyber Posted April 19, 2007 Share Posted April 19, 2007 sorry, I forget the $title variable and remove exit before EndFunc HotKeySet("^+!c","_bye") $title = "ShutDown" while 1 Sleep(1000) WEnd Func _bye() $i=5 $msgRet = 0 for $i=5 to 0 step -1 $msgRet = MsgBox(49,$title,"Shutdown in " & $i & " seconds",1) if $msgRet = 2 then $i = 0 EndIf Next If $msgRet <> 2 Then ;spegnimento MsgBox(0,$title,"Ciao ciao!",1) Shutdown(13) Else MsgBox(0,$title,"Shutdown cancel",2) EndIf EndFunc Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
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