Jump to content

Vista & WinActivate


Recommended Posts

$title = WinGetTitle("")
WinSetState($title, "", @SW_MINIMIZE)
Sleep(1000)
WinActivate($title)

$title = WinGetTitle("")
WinSetState($title, "", @SW_MINIMIZE)
Sleep(1000)
WinSetSTate($title, "", @SW_RESTORE)

both tested and working for me...

using vista home premium and zipped version of autoit 3.2.4.9

Edited by ZyntaxError
Link to comment
Share on other sites

i use the most recent beta and my script is like this.....

If WinActive("example") = 0 Then
WinActivate("example")

and it worked fine for about 10 minutes, then it randomly stopped working, and started to minimize the window instead of activate it. i dont know any fix for it as of yet

Link to comment
Share on other sites

Try using WinSetState() instead of WinActivate(), like ZyntaxError did.

Just guessing here :) I think being more specific helps sometimes with bugs.

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

he is using winsetstate to minimize, that's not what either of us is trying to do...

So change it so it makes it active. @SW_SHOW.

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

fount that...

if you have script activating "test gui" whenever its not active and at same time you spam mouse at other window then...

the other window is above our "test gui" but "test gui" has still input focused there, so maybe you need WinSetOnTop()?

GUICreate("test gui", 200, 100)
GUICtrlCreateInput("", 0, 0, 200, 100)
GUISetState()
WinSetOnTop("test gui", "", 1)
While 1
    If WinActive("test gui") = 0 Then
        WinActivate("test gui")
    EndIf
    Sleep(1000)
WEnd
Link to comment
Share on other sites

  • 2 weeks later...

I'm experiencing the same problems with "WinActivate" with Vista (x64 Ultimate).

Everything works fine for 4 days. No problems at all. While using the script, all of a sudden the Winactivate feature did not work anymore.

I'ved tried using the window handle instead of the title, @SW_SHOW, @SW_SHOWMAXIMIZED, altering the SetOnTop flag (WinSetOnTop), but nothing works.

Anybody got a solution yet?

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...