Jump to content

Inactive window


toffer
 Share

Recommended Posts

Hi

I'm new to all this but have been experimenting.

I'm trying to control an application that runs via a citrix logon. I can start citrix within an IE window and send the logon credentials and even send the url to launch the application. However, its here that I get stuck.

I know the script works fine when I'm logged on to the server but when I schedule the script and it runs under the console session I can't activate the application window.

I've tried the following snippets all to no avail:

$var = WinList()

For $i = 1 to $var[0][0]

If $var[$i][0] = $iPharmString[$Session] Then

$WinHandle= $var[$i][1]

EndIf

Next

_WinAPI_EnableWindow($WinHandle,True)

_WinAPI_SetFocus($WinHandle)

While Not (WinExists($iPharmString[$Session],""))

MsgBox(1,"Does Not Exist","Window, " & $iPharmString[$Session] & " does not exists",600)

WEnd

WinSetState($iPharmString[$Session], "", @SW_ENABLE)

WinSetState($iPharmString[$Session], "", @SW_MAXIMIZE)

While Not (WinActive($iPharmString[$Session],""))

WinActivate($iPharmString[$Session],"")

MsgBox(1,"Not Active","$iPharmString[$Session] is not active:" & $iPharmString[$Session],60)

WEnd

All I get is ,"Not Active"!

Any suggestions?

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