Sokko Posted May 30, 2007 Posted May 30, 2007 I could have sworn I did this once before, but I'm blanking on the exact method, and twenty-odd forum searches turned up nothing. I need a way to tell when the input focus on my GUI changes (from one control to another), and when it does, I need to find out which control currently has the focus. Any suggestions?
PsaltyDS Posted May 30, 2007 Posted May 30, 2007 ControlGetFocus()... ? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Sokko Posted May 30, 2007 Author Posted May 30, 2007 Already tried it. ControlGetFocus gives you back a ClassNameNN (or HWND with ControlGetHandle), but I need an AutoIt control ID as returned by a GUICtrlCreate function.
evilertoaster Posted May 30, 2007 Posted May 30, 2007 GUIRegisterMsg(0x0008,"Func1") will fire whenever it loses focus.
Sokko Posted May 30, 2007 Author Posted May 30, 2007 evilertoaster said: GUIRegisterMsg(0x0008,"Func1")will fire whenever it loses focus.What is "it"? I tried clicking and tabbing all over the place but the function never executed.
Moderators SmOke_N Posted May 31, 2007 Moderators Posted May 31, 2007 http://www.autoitscript.com/forum/index.ph...st&p=345620 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
PaulIA Posted May 31, 2007 Posted May 31, 2007 SmOke_N said: http://www.autoitscript.com/forum/index.ph...st&p=345620The code in the link doesn't print anything when the focus changes from one control to the next (which I believe is what the OP is after). Auto3Lib: A library of over 1200 functions for AutoIt
Sokko Posted May 31, 2007 Author Posted May 31, 2007 Actually, that did help me out, thanks Smoke! Once I knew what I was looking for, it was easy to rewrite the example to use EN_SETFOCUS instead of EN_CHANGE. It works fine, but it really shouldn't be this hard...
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