Jump to content

WinActivate WinWaitActive not work on terminal server console


lugi
 Share

Recommended Posts

Hi all,

I'm trying to run an autoscript in MS terminal server console, the following script run ok when the console is not minimized(you will get an OK dialog), but if you startup the script then minimize the terminal server console, you will get an "Failed-not found" dialog. Does anybody knows why? and how can I active a window in terminal server console?

;;--------------------------

Run("calc.exe")

; here you minimize the terminal server console window

Local $title = "Calculator"

Sleep(5000)

If WinActivate($title) == 0 Then

MsgBox(0, "", "Failed-not found")

Else

If WinWaitActive($title, "", 5) == 0 Then

MsgBox(0, "", "wait failed")

Else

MsgBox(0, "", "OK")

EndIf

EndIf

Link to comment
Share on other sites

Thank you, but the ControlClick document says that we should use WinActivate before using ControlClick.

I will try your suggestion first :P

"

ControlClick:

Remarks

Some controls will resist clicking unless they are the active window. Use the WinActivate() function to force the control's window to the top before using ControlClick().

"

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