Jump to content
Sign in to follow this  
Nandi

WinActivate doesn't work

Recommended Posts

Nandi

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
232showtime

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
Nandi

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
JLogan3o13

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
JohnOne

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.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.