Jump to content

WinActivate doesn't work


Nandi
 Share

Recommended Posts

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

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.

Link to comment
Share on other sites

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...