Melque_Lima

How to kill a hotkey event?

7 posts in this topic

hi, guys!

i've create an hotket event "{enter}" that shows an msg box, i can not press enter to "OK", i have to click with mouse, i thought that if i stop the hot key event i'll be able to close the msg box with enter key!

so, how do i do it?

any ideas?

Share this post


Link to post
Share on other sites



You can use _IsPressed() instead HotKeySet(), see example below:
#include
#include

Local $test = DllOpen("user32.dll")
Local $a = 0;

While 1
If (_IsPressed("0D", $test)) Then
If ($a==0) Then
MsgBox($MB_SYSTEMMODAL, "Ok", "Ok")
$a=$a+1
Else
$a=0;
EndIf
EndIf
Sleep(50)
WEnd

Share this post


Link to post
Share on other sites

I 2nd @j0kky's suggestion.  At the beginning of the function turn off the HotKey assoc. then re-apply at the end of the function (after the msgbox).

Share this post


Link to post
Share on other sites

unset the hotkey

#include <GUIConstantsEx.au3>

HotKeySet("{ENTER}", "MyFunc")

While 1
    Sleep(50)
WEnd


Func MyFunc()
    HotKeySet("{ENTER}")
    MsgBox(64, "Test", "Success")
    Exit
EndFunc   ;==>MyFunc

 


ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
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