Armand Posted August 21, 2007 Posted August 21, 2007 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 ?!
Armand Posted August 21, 2007 Author Posted August 21, 2007 (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 August 22, 2007 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 ?!
Armand Posted August 22, 2007 Author Posted August 22, 2007 (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 August 22, 2007 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 ?!
Zedna Posted August 22, 2007 Posted August 22, 2007 More elegant way is to use GUIRegisterMsg() and WM_SETFOCUS or WM_KILLFOCUSLook at MSDN Resources UDF ResourcesEx UDF AutoIt Forum Search
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