Sign in to follow this  
Followers 0
Armand

register event - focus changed.

4 posts in this topic

how can i register an event to launch every time the control focus is changed in my gui ?!

(whenever you exit/click on a control...)

as i've searched throughout all the help file and i've couldn't find it i'm posting the Q here !

please help me...


[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

i think i've found a way:

GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "ByMousePRIMARYDOWN")
Global $LastClickHandle = 0

Func ByMousePRIMARYDOWN()
    If @GUI_CtrlHandle <> $LastClickHandle Then
        $LastClickHandle = @GUI_CtrlHandle
        Switch $LastClickHandle
            Case $UPL_CTRLOFYOURS;one of the controls....
                $UPL_CTRLOFYOURS()
            Case $lala ;some other control....
        EndSwitch
    EndIf
EndFunc

HF ALL !

Edited by Armand

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

another better way to do that:

Global $LastFocusHandle = 0
while 1
    If ControlGetHandle("","",ControlGetFocus("")) <> $LastFocusHandle Then
        Switch $LastFocusHandle
            Case ControlGetHandle("","",$CTRLOFYOURS)
            UPL_CTRLOFYOURS()
        EndSwitch
    $LastFocusHandle = ControlGetHandle("","",ControlGetFocus(""))
    EndIf
wend

works for me (:

Edited by Armand

[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

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
Sign in to follow this  
Followers 0