daldous Posted August 2, 2006 Share Posted August 2, 2006 Keep in mind that I'm a total noob at this stuff I want to focus on a window, click a button, and then right away focus back on the last window. Now, I know the firs two bits: WinActivate(... ControlClick(... Now all I want to figure out is the title of the window that is currently focused (before all of this). Ie. Firefox is open, and Calculator is open. Firefox has focus. Focus on Calculator, calculate 5x5, Focus back on Firefox The Middle part I know how to do, and the last. The first part - figuring out what is the currently focused window, is my question. Now, remember - you were a noob yourself once Link to comment Share on other sites More sharing options...
zfisherdrums Posted August 2, 2006 Share Posted August 2, 2006 ;This will obtain the title of the ;window currently in focus $LastWindow = WinGetTitle("") ;Your Code Here... WinActivate(... ControlClick(... Let me know if this helps. Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
MHz Posted August 2, 2006 Share Posted August 2, 2006 Now, I know the firs two bits: WinActivate(... ControlClick(...ControlClick does not need an active window as it directly works with the Control. This example ControlClicks Calculator, but Calculator is not active. Run('Calc') WinWait('Calc') Run('Notepad') WinWait('Untitled') Sleep(1000); just to see active notepad ControlClick('Calc', '', '5') ControlClick('Calc', '', '*') ControlClick('Calc', '', '5') ControlClick('Calc', '', '=') WinActivate('Untitled') WinWaitActive('Untitled') Send('Some text') Mouse* actions and Send require active windows so use WinActivate and WinWaitActive before using them. Link to comment Share on other sites More sharing options...
daldous Posted August 2, 2006 Author Share Posted August 2, 2006 Haha, you guys are bloody awesome. Thanks so much WinGetTitle("") works like a charm and ControlClick indeed doesn't need window focus to work. 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