Sokko Posted May 30, 2007 Share 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? Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 30, 2007 Share 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 Link to comment Share on other sites More sharing options...
Sokko Posted May 30, 2007 Author Share 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. Link to comment Share on other sites More sharing options...
evilertoaster Posted May 30, 2007 Share Posted May 30, 2007 GUIRegisterMsg(0x0008,"Func1") will fire whenever it loses focus. Link to comment Share on other sites More sharing options...
Sokko Posted May 30, 2007 Author Share Posted May 30, 2007 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. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 31, 2007 Moderators Share 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. Link to comment Share on other sites More sharing options...
PaulIA Posted May 31, 2007 Share Posted May 31, 2007 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 Link to comment Share on other sites More sharing options...
Sokko Posted May 31, 2007 Author Share 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... Link to comment Share on other sites More sharing options...
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