Jump to content
Sign in to follow this  
JulianMummery

Vista & WinActivate

Recommended Posts

JulianMummery

Hi,

I have a script that works on XP SP2 but not on Vista.

The WinActivate does not seem to work on Vista, is there any known issues with this and if so, is there a work around?

Thanks in advance

Julian

Edited by JulianMummery

Share this post


Link to post
Share on other sites
ZyntaxError

$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

Share this post


Link to post
Share on other sites
TK_Incorperate

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

Share this post


Link to post
Share on other sites
sandman

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]

Share this post


Link to post
Share on other sites
TK_Incorperate

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

Share this post


Link to post
Share on other sites
sandman

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]

Share this post


Link to post
Share on other sites
ZyntaxError

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

Share this post


Link to post
Share on other sites
Cusem

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?

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.