Jump to content

How to kill a hotkey event?


Recommended Posts

To close a message box with Enter the window has to be active and the default (usually OK) button has to be active.

Make sure your script is following these rules ;) 

Edited by l3ill
Link to comment
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

Link to comment
Share on other sites

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...