Sign in to follow this  
Followers 0
JailDoctor

CITRIX transparent window

7 posts in this topic

I made a password manager script to automatically log on to an Attachmate EXTRA! application. It worked like a charm from a desktop. The user double clicked the icon, the application was launched, a txt file with the 1) daily password, 2) User id number and 3) Base password residing in the users personal drive was read into an array.

Once the application was active, all the information was entered and the user was logged on and ready to work.

Then we moved to CITRIX. The Attachmate EXTRA! application was housed in a different server than all other applications (according to the IT guys). The new terminals do not have a C:\ drive.

I modified the script to use the new window name (I used both the \Remote and the name shown with Shift F2) and still can't get to the window. I enclose the two scripts, first the old script followed by the new script.

Old script.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Version=beta
#AutoIt3Wrapper_icon=My Pictures\CompanyLogo.ico
#AutoIt3Wrapper_outfile=Auto PatientDB.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
    
    AutoIt Version: 3.2.10.0
    Author:         JailDoctor
    
    Script Function: Gets the paswords and user id to open and runs EXTRA! Attachmate.
    
    
#ce ----------------------------------------------------------------------------

#include <File.au3>
#include <Array.au3>
#include <Sound.au3>
$sSnd_id ="H:\My Sound\\HALERR.wav"
Global $PatientDBinfo

_FileReadToArray ("H:\PswrdContainer.txt", $PatientDBinfo)
If  UBound ($PatientDBinfo)= 0 Then
    Sleep(300)
    SoundSetWaveVolume(10)  ;Turn sound on.
    _SoundPlay ($sSnd_id)
    MsgBox (48,"Input error", "Please make a txt file in your H: drive with Notepad." & @CRLF &  @CRLF & "Enter your Daily Password, " _ 
    & @CRLF &  "your User Number and" & @CRLF &   "your Base Password."& @CRLF & @CRLF &   "Save the file as H:\PswrdContainer.txt",15)
    Exit
EndIf
If  UBound ($PatientDBinfo)<3 Then
    Sleep(300)
    SoundSetWaveVolume(10)  ;Turn sound on.
    _SoundPlay ($sSnd_id)
    MsgBox (32,"File error", "Missing information." & @CRLF &  @CRLF & "Make sure you entered:"  & @CRLF & @CRLF & "1) your Daily Password," _ 
    & @CRLF &  "2) your User Number and" & @CRLF &   "3) your Base Password."& @CRLF & @CRLF &   "Save the file as H:\PswrdContainer.txt   ",15)
    Exit
EndIf


ShellExecuteWait("C:\Program Files\E!OC\runExtraOC.pts")' No longer works because Citrix has this file in a different server.
WinWait("PatientDB - EXTRA! Office Client")
WinWaitActive("PatientDB - EXTRA! Office Client")
ToolTip ("Waiting for PatientDB to be ready.","PatientDB")
Sleep (4000)
ToolTip ("")
Send ($PatientDBinfo[1])
Send ($PatientDBinfo[2])
Send ($PatientDBinfo[3])
Send ("{TAB}jm{ENTER}")
Sleep (300)
Send ($PatientDBinfo[1]& "{ENTER}"& $PatientDBinfo[2]& "{ENTER}")
Sleep (300)
Send ($PatientDBinfo[1]&"{TAB 6}{ENTER}")

New Script.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Version=beta
#AutoIt3Wrapper_icon=My Pictures\CompanyLogo.ico
#AutoIt3Wrapper_outfile=Auto PatientDB.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------

    AutoIt Version: 3.2.10.0
    Author:         JailDoctor

    Script Function: Gets the paswords and user ID to open and run EXTRA! Attachmate On a Citrix machine


#ce ----------------------------------------------------------------------------

#include <File.au3>
#include <Array.au3>
#include <Sound.au3>
$sSnd_id ="S:\DHCS\PA\files2u\HALERR.wav"
Global $PatientDBinfo
_FileReadToArray ("H:\My Documents\PswrdContainer.txt", $PatientDBinfo)
If  UBound ($PatientDBinfo)= 0 Then
    Sleep(300)
    SoundSetWaveVolume(10)  ;Turn sound on.
    _SoundPlay ($sSnd_id)
    MsgBox (48,"Input error", "Please make a txt file in your H: drive with Notepad." & @CRLF &  @CRLF & "Enter your Daily Password, " _
    & @CRLF &  "your User Number and" & @CRLF &   "your Base Password."& @CRLF & @CRLF &   "Save the file as H:\PswrdContainer.txt",15)
    Exit
EndIf
If  UBound ($PatientDBinfo)<3 Then
    Sleep(300)
    SoundSetWaveVolume(10)  ;Turn sound on.
    _SoundPlay ($sSnd_id)
    MsgBox (32,"File error", "Missing information." & @CRLF &  @CRLF & "Make sure you entered:"  & @CRLF & @CRLF & "1) your Daily Password," _
    & @CRLF &  "2) your User Number and" & @CRLF &   "3) your Base Password."& @CRLF & @CRLF &   "Save the file as H:\PswrdContainer.txt   ",15)
    Exit
EndIf


;~ ShellExecuteWait("C:\Program Files\E!OC\runExtraOC.pts")
WinActivate("PatientDB - EXTRA! Office Client - \\Remote")
WinWaitActive("PatientDB - EXTRA! Office Client - \\Remote")
ToolTip ("Waiting for PatientDB to be ready.","PatientDB")
Sleep (4000)
ToolTip ("")
Send ($PatientDBinfo[1])
Send ($PatientDBinfo[2])
Send ($PatientDBinfo[3])
Send ("{TAB}jm{ENTER}")
Sleep (300)
Send ($PatientDBinfo[1]& "{ENTER}"& $PatientDBinfo[2]& "{ENTER}")
Sleep (300)
;WinWaitActive("PatientDB - EXTRA! Office Client")
Send ($PatientDBinfo[1]&"{TAB 6}{ENTER}")

Any help will be appreciated.

Thanks.

Share this post


Link to post
Share on other sites

JailDoctor,

There was a recent topic where the OP could only use the width and height of a Citrix window to activate it.

Does your window have a constant size on opening? If so that might be the key you need to identify it. :)

For more details on how to use those parameters, look in the Help file under <Using AutoIt - Window Titles and Text (Advanced)>.

Come back if you run into problems. :idea:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Does your window have a constant size on opening? If so that might be the key you need to identify it. :idea:

Thank you Melba23 for your quick response.

No, the window height and width as well as the window location stay the same as the user last left it. Some people use it full screen (easier on the eyes?) and others choose various sizes.

I've spent the whole afternoon playing with different parameters. I tried using your suggestion while keeping my interface of a constant size but all I found in Window Titles and Text (Advanced) is: "X \ Y \ W \ H - The position and size of a window."

Window info tool gives me the following info. This title appears pressing Shift F2

>>>> Window <<<<

Title: Extra! - PatientDB Mainframe - Citrix XenApp Plugins for Hosted Apps

Class: wMFService0006013E001

Position: 57, 92

Size: 722, 620

Style: 0x14FF0000

ExStyle: 0x00000100

Handle: 0x000D01FC

This title appears pressing Shift F2 again to hide the Citrix window. Note how the class changes to "transparent window client"

>>>> Window <<<<

Title: PatientDB - EXTRA! Office Client - \\Remote

Class: Transparent Windows Client

Position: 19, 20

Size: 652, 514

Style: 0x960D0000

ExStyle: 0x00000104

Handle: 0x0014039E

Perhaps you may find something I don't see in the Window info tool.

Thanks

JD

Edited by JailDoctor

Share this post


Link to post
Share on other sites

JailDoctor,

all I found in Window Titles and Text (Advanced) is: "X \ Y \ W \ H - The position and size of a window."

Which you use thus: :idea:

WinActivate("[X:200;Y:200]")

Have you tried using CLASS to identify the Window?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

http://www.autoitscript.com/forum/index.php?showtopic=96123&st=0&p=691861&hl=Citrix%20Reinhard&fromsearch=1&#entry691861

Speak with your IT-Guys to get the application as "Published Application",

so you can "see" the window as \\remote window.

Best regards, Reinhard

Share this post


Link to post
Share on other sites

Speak with your IT-Guys to get the application as "Published Application",

so you can "see" the window as \\remote window.

Thanks for the suggestion Reinhard, but I had already tried this with no result.

WinActivate("PatientDB - EXTRA! Office Client - \\Remote")
WinWaitActive("PatientDB - EXTRA! Office Client - \\Remote")

Then I pressed Shift + F2 and tried:

WinActivate("Extra! - PatientDB Mainframe - Citrix XenApp Plugins for Hosted Apps")
WinWaitActive("Extra! - PatientDB Mainframe - Citrix XenApp Plugins for Hosted Apps")

and still no cigar...

We are using terminals called WYSE, there is no C:\drive.

Something strange happens. If I run Window info tool from a shared drive, it does not see the window in question. I even ran a winlist routine and the window is not listed.

$var = WinList()

For $i = 1 to $var[0][0]
  ; Only display visble windows that have a title
  If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
    MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])
  EndIf
Next

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf
EndFunc

I then removed the "IsVisible" part to see the "invisible" windows and it listed a lot of windows, but nothing like the window in question.

If I plug a flash drive to the terminal USB, when I run Window info tool from the flash drive, it sees the window in question and a desktop, but not the other windows from the shared drive.

I have a meeting with the IT guys this coming Friday. They seem to think that the script shoud reside in the same server as the application.

Share this post


Link to post
Share on other sites

JailDoctor,

Which you use thus: :idea:

WinActivate("[X:200;Y:200]")

Have you tried using CLASS to identify the Window?

M23

Thank you Melba23 I found your quote about Titles and Text (Advanced) after I posted the same question the other person posted. I couldn't get it to work. I tried CLASS and still no luck.

I found some material on citrix to read and be prepared when I meet the IT guys on Friday.

I will keep trying different approaches.

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