Nandi Posted October 11, 2014 Share Posted October 11, 2014 Hey guys, I can't get WinActivate to work. Here's my test code: Run("notepad.exe") winwait("[CLASS:Notepad]") Sleep(500) Run("calc.exe") WinWait("[CLASS:Calculator]") Sleep(500) WinActivate("[CLASS:Notepad]") I use Hungarian Windows 7 64-bit, I've already tried it on Windows XP 32-bit, but it doesn't seem to work. I really need to get a window in focus, since I would like to copy text from a webpage. Thank you in advance, Nandi Link to comment Share on other sites More sharing options...
JohnOne Posted October 11, 2014 Share Posted October 11, 2014 ("[CLASS:CalcFrame]") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
232showtime Posted October 11, 2014 Share Posted October 11, 2014 (edited) Hey guys, I can't get WinActivate to work. Here's my test code: Run("notepad.exe") winwait("[CLASS:Notepad]") Sleep(500) Run("calc.exe") WinWait("[CLASS:Calculator]");<<<<<<< change this to WinWait("[CLASS:CalcFrame]") like johone example Sleep(500) WinActivate("[CLASS:Notepad]") I use Hungarian Windows 7 64-bit, I've already tried it on Windows XP 32-bit, but it doesn't seem to work. I really need to get a window in focus, since I would like to copy text from a webpage. Thank you in advance, Nandi your script pauses because its waiting for the program with the Classname Calculator to run thats why winactivate is not working... Edited October 11, 2014 by 232showtime ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
Nandi Posted October 11, 2014 Author Share Posted October 11, 2014 Thank you, it works now. I am maximizing the window first with @SW_MAXIMIZE. Altough, it won't work with Google Chrome using classes or with partial title, only with the full exact title. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 11, 2014 Moderators Share Posted October 11, 2014 For Chrome manipulation you should be using the appropriate UDF: "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
JohnOne Posted October 11, 2014 Share Posted October 11, 2014 I am maximizing the window first with @SW_MAXIMIZE. Altough, it won't work with Google Chrome using classes or with partial title, only with the full exact title. Yes, it will, and it does. Show code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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