ReaImDown Posted June 3, 2008 Share Posted June 3, 2008 to register its DllCall("user32.dll", "short", "RegisterHotKey".... but to unregister... [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
Valuater Posted June 3, 2008 Share Posted June 3, 2008 (edited) to set itHotKeySet("{Esc}", "Function") un-setHotKeySet("{Esc}")8) Edited June 3, 2008 by Valuater Link to comment Share on other sites More sharing options...
ReaImDown Posted June 3, 2008 Author Share Posted June 3, 2008 HotKeySet("{Esc}") ; capture and pass along a keypress [/color][i][color="#000000"]HotKeySet[/color][color="#000000"]("{Esc}", "captureEsc") Func captureEsc() ; ... can do stuff here [/color][color="#000000"]HotKeySet[/color][color="#000000"]("{Esc}") Send("{Esc}") [/color][color="#000000"]HotKeySet[/color][color="#000000"]("{Esc}", "captureEsc") EndFunc 8) without the use of hotkeyset() 8-) [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
ReaImDown Posted June 3, 2008 Author Share Posted June 3, 2008 (edited) without the use of hotkeyset() 8-)example,$a = 0x30 ;"A"DllCall("user32.dll", "short", "RegisterHotKey", "hwnd", $hWnd, "int", "1337" & Dec($a) , "uint", 0x0001, "uint", $a)DllCall("user32.dll", "short", "UnRegisterHotKey", "hwnd", $hWnd, "int", "1337" & hex($a) , "uint", 0x0001, "uint", $a)Edit~chit, sorry for DPam reading http://www.dotnet2themax.com/ShowContent.a...10-c2bb7075ba78 Edited June 3, 2008 by ReaImDown [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
ReaImDown Posted June 6, 2008 Author Share Posted June 6, 2008 example,$a = 0x30 ;"A"DllCall("user32.dll", "short", "RegisterHotKey", "hwnd", $hWnd, "int", "1337" & Dec($a) , "uint", 0x0001, "uint", $a)DllCall("user32.dll", "short", "UnRegisterHotKey", "hwnd", $hWnd, "int", "1337" & hex($a) , "uint", 0x0001, "uint", $a)Edit~chit, sorry for DPam reading http://www.dotnet2themax.com/ShowContent.a...10-c2bb7075ba78bumpy [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 6, 2008 Moderators Share Posted June 6, 2008 (edited) I haven't looked on msdn to see if you are even calling it correctly... but why are you passing a string to an integer in that call (the hex).Edit:Did you even look at MSDN?http://msdn.microsoft.com/en-us/library/ms646327(VS.85).aspxIt only has 2 params. Edited June 6, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ReaImDown Posted June 8, 2008 Author Share Posted June 8, 2008 I haven't looked on msdn to see if you are even calling it correctly... but why are you passing a string to an integer in that call (the hex).Edit:Did you even look at MSDN?http://msdn.microsoft.com/en-us/library/ms646327(VS.85).aspxIt only has 2 params.I tried everything and I cannot unregister a hotkey...anyone have any idea's? [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 8, 2008 Moderators Share Posted June 8, 2008 I tried everything and I cannot unregister a hotkey...anyone have any idea's?Well that statement "tried everything" doesn't really say much considering the code you provided the first time. The call is pretty straight forward, so care to share with us what "everything" is? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Bert Posted June 8, 2008 Share Posted June 8, 2008 agreed The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
ReaImDown Posted June 9, 2008 Author Share Posted June 9, 2008 (edited) agreedtouchesorry, and to think I bitch ppl out for this $last = "0x41" ; ADllCall("user32.dll", "short", "UnRegisterHotKey", "hwnd", $hWnd, "int", "1337" & Dec($last))DllCall("user32.dll", "short", "UnRegisterHotKey", "hwnd", $hWnd, "int", "1338" & Dec($last))doing some error testing, I addedmsgbox(0,"",$Last) and it returns 0Dec($last) = 0 when it runs though...but to register a hotkey, it converts it to a decimal... no problem...edit...it returns correctly if I use $last = "41" ; A but still doesnt unregister the hotkey. Edited June 9, 2008 by ReaImDown [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 9, 2008 Moderators Share Posted June 9, 2008 touchesorry, and to think I bitch ppl out for this $last = "0x41" ; ADllCall("user32.dll", "short", "UnRegisterHotKey", "hwnd", $hWnd, "int", "1337" & Dec($last))DllCall("user32.dll", "short", "UnRegisterHotKey", "hwnd", $hWnd, "int", "1338" & Dec($last))doing some error testing, I addedmsgbox(0,"",$Last) and it returns 0Dec($last) = 0 when it runs though...but to register a hotkey, it converts it to a decimal... no problem...edit...it returns correctly if I use $last = "41" ; A but still doesnt unregister the hotkey.No offense... but this is kind of crap.Post the whole code including the hwnd you are trying to register the hotkey for and unregister the hotkey for. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ReaImDown Posted June 11, 2008 Author Share Posted June 11, 2008 No offense... but this is kind of crap. Post the whole code including the hwnd you are trying to register the hotkey for and unregister the hotkey for. basically the same thing as HotKeySet()....only theirs works... -.-' $hWnd = GUICreate("HotKey Check", 100, 100) GUIRegisterMsg(0x0312, "Hotkey_a"); Hotkey_a $LGet = "0x41" DllCall("user32.dll", "short", "RegisterHotKey", "hwnd", $hWnd, "int", "1337" & Dec($LGet) , "uint", "0x0004", "uint", $LGet) DllCall("user32.dll", "short", "RegisterHotKey", "hwnd", $hWnd, "int", "1338" & Dec($LGet) , "uint", 0, "uint", $LGet) while 1 sleep(100) WEnd Func HotKey_a($hWnd, $Msg, $wParam, $letter) $last = (StringMid($letter,5,2)) ;MsgBox(0,"",$last & " " & dec($last)) DllCall("user32.dll", "short", "UnRegisterHotKey", "hwnd", $hWnd, "int", "1337" & Dec($last)) DllCall("user32.dll", "short", "UnRegisterHotKey", "hwnd", $hWnd, "int", "1338" & Dec($last)) EndFunc [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
foggw Posted June 12, 2008 Share Posted June 12, 2008 basically the same thing as HotKeySet()....only theirs works... -.-' $hWnd = GUICreate("HotKey Check", 100, 100) GUIRegisterMsg(0x0312, "Hotkey_a"); Hotkey_a $LGet = "0x41" DllCall("user32.dll", "short", "RegisterHotKey", "hwnd", $hWnd, "int", "1337" & Dec($LGet) , "uint", "0x0004", "uint", $LGet) DllCall("user32.dll", "short", "RegisterHotKey", "hwnd", $hWnd, "int", "1338" & Dec($LGet) , "uint", 0, "uint", $LGet) while 1 sleep(100) WEnd Func HotKey_a($hWnd, $Msg, $wParam, $letter) $last = (StringMid($letter,5,2)) ;MsgBox(0,"",$last & " " & dec($last)) DllCall("user32.dll", "short", "UnRegisterHotKey", "hwnd", $hWnd, "int", "1337" & Dec($last)) DllCall("user32.dll", "short", "UnRegisterHotKey", "hwnd", $hWnd, "int", "1338" & Dec($last)) EndFuncTry this: $hWnd = GUICreate("HotKey Check", 100, 100) GUIRegisterMsg(0x0312, "Hotkey_a"); Hotkey_a $LGet = "0x41" DllCall("user32.dll", "short", "RegisterHotKey", "hwnd", $hWnd, "int", "1337" + $LGet , "uint", "0x0004", "uint", $LGet) DllCall("user32.dll", "short", "RegisterHotKey", "hwnd", $hWnd, "int", "1338" + $LGet , "uint", 0, "uint", $LGet) while 1 sleep(100) WEnd Func HotKey_a($hWnd, $Msg, $wParam, $letter) $last = (StringMid($letter,5,2)) MsgBox(0,"",$last & " " & dec($last)) DllCall("user32.dll", "short", "UnregisterHotKey", "hwnd", $hWnd, "int", "1337" + Dec($last)) DllCall("user32.dll", "short", "UnregisterHotKey", "hwnd", $hWnd, "int", "1338" + Dec($last)) EndFunc Comments: In the original code in the RegisterHotKey call Dec($LGet) has the effect of Dec(0x65) not Dec(0x41). The & operator concatenates text, the + operator is needed to do math. I am making an assumption that this is what you wanted. UnRegisterHotKey is not a valid function in user32.dll. The proper name is UnregisterHotKey. DllCall's are case sensitive. Hope this helps. Bill 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