Jump to content

Custom events?


Recommended Posts

Greetings all,

I'm working on a project and trying to find a better way to enable/disable hotkeys. Here's what I have so far:

While 1
    If (WinActive($szTitle)) Then
        HotKeySet("{ENTER}", "_SendData")
    Else
        HotKeySet("{ENTER}")
    EndIf
    
    Switch (GUIGetMsg())
        Case ($GUI_EVENT_CLOSE)
            _Exit()
    EndSwitch
    ;Snipped irrelevant code
WEnd
oÝ÷ ÙhbëaÌ(®Kw¶§+b±¬²×¨|#Ô¦­ë)yȬw&©¦+-g¬z{"¶+Þ#f¶¼¢h²¯zßjÉ)¢X¬yÊ'vƬ¦,¹^¥êå¢R¢l­ ܲÚ,yè!Ê.×+y«^ÚæÊ'z÷§¶Á ED51qhrëÑ ED52è±áhrëÛazwh¶¢ÙÊËn}ùbë(jëh×6
While 1
    Switch (GUIGetMsg())
        Case ($GUI_EVENT_CLOSE)
            _Exit()
        Case ($GUI_EVENT_GAINFOCUS)
            HotkeySet("{ENTER}","_SomeFunc")
        Case ($GUI_EVENT_LOSEFOCUS)
            HotKeySet("{ENTER}")
    EndSwitch
WEnd

The closest thing I could find on MSDN that would suit my needs is EVENT_OBJECT_FOCUS (which is triggered when hwndObject is given keyboard focus). I just dunno how to implement it in Au3. I've got some other things I'd like to set event on (i.e. GUI control's limit being reached), and shave off some more time if I can. I'm trying to stay away from DLL calls cuz they can be slow. Any suggestions?

Thanx

-CMR

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...