Sign in to follow this  
Followers 0
Anaxibius

Winwaitactive Problem

5 posts in this topic

#1 ·  Posted (edited)

I am having some trouble that I can't seem to find a solution to. I have a script where I need to pass some mouse movements, but the window I need it done on never gets past the WinWaitActive portion of the script below.

Run($Source & "\VIMSpc\VIMS\setup.exe /s")
WinWait("VIMS Import")
MsgBox(0,"Debug","Window Exists")
If Not WinActive("VIMS Import") Then WinActivate("VIMS Import")
MsgBox(0,"Debug","Window Exists")
               $Wait = WinWaitActive("VIMS Import",10)
    If $Wait > 0 Then
        BlockInput(1)
        MouseMove(131,45)
        MouseDown("left")
        MouseUp("left")
        BlockInput(0)
        Sleep(1000)
    EndIf
EndIf
_FileWriteLog($Source & "\Installation Logs\VIMSpc.log", @ComputerName)
Exit

I even threw in a line as follows below the WinWait command to see if it was flipping out after the Window was created:

$test = WinExists("VIMS Import")
MsgBox(0,"Debug",$Test)

Both MsgBox lines show up, but it just hangs on the WinWaitActive line and does nothing. The timeout doesn't even appear to be working. Am I missing something obvious?

Edited by Anaxibius

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

The text parameter is missing on the WinWaitActive

Run($Source & "\VIMSpc\VIMS\setup.exe /s")
WinWait("VIMS Import")
MsgBox(0,"Debug","Window Exists")
If Not WinActive("VIMS Import") Then WinActivate("VIMS Import")
MsgBox(0,"Debug","Window Exists")
$Wait = WinWaitActive("VIMS Import", "", 10)
If $Wait > 0 Then
    BlockInput(1)
    MouseMove(131,45)
    MouseDown("left")
    MouseUp("left")
    BlockInput(0)
    Sleep(1000)
EndIf
_FileWriteLog($Source & "\Installation Logs\VIMSpc.log", @ComputerName)
Exit

Edit:

Removed an extra Endif in the code as well.

Edited by MHz

Share this post


Link to post
Share on other sites

Isn't the text component optional? According to the Help file it is, but I will give it a shot.

Share this post


Link to post
Share on other sites

You have to specify the text parameter if you use the timeout parameter that comes after it.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

That did it. Thanks a lot.

Edited by Anaxibius

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