Sign in to follow this  
Followers 0
Nandi

WinActivate doesn't work

6 posts in this topic

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

Share this post


Link to post
Share on other sites



#3 ·  Posted (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 by 232showtime

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

For Chrome manipulation you should be using the appropriate UDF:


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0