03.11.2014 Views

SilkPerformer Citrix Tutorial - Borland Technical Publications

SilkPerformer Citrix Tutorial - Borland Technical Publications

SilkPerformer Citrix Tutorial - Borland Technical Publications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6 BEST PRACTICES<br />

Issues Specific to <strong>Citrix</strong><br />

<strong>Citrix</strong>MouseClick(62, 247, hWnd11, MOUSE_ButtonLeft);<br />

<strong>Citrix</strong>WaitForWindow(hWnd11, EVENT_Destroy);<br />

hWnd12 := <strong>Citrix</strong>WaitForWindowCreation("Shut Down Windows", MATCH_Exact,<br />

0x94C808CC, 191, 136, 417, 192);<br />

<strong>Citrix</strong>WaitForWindow(hWnd12, EVENT_Activate);<br />

<strong>Citrix</strong>MouseClick(203, 170, hWnd12, MOUSE_ButtonLeft);<br />

<strong>Citrix</strong>WaitForDisconnect();<br />

end TMain;<br />

dclevent<br />

handler Handler1 <br />

var<br />

nInterrupt, nWindow : number;<br />

nStyle<br />

: number;<br />

begin<br />

<strong>Citrix</strong>GetActInterrupt(nInterrupt, nWindow);<br />

ErrorAdd(FACILITY_CITRIXENGINE, 47, SEVERITY_INFORMATIONAL);<br />

print(string(nWindow));<br />

if <strong>Citrix</strong>GetWindowStyle(nWindow, nStyle) and (nStyle 0xB4000000) then<br />

<strong>Citrix</strong>WaitForWindow(nWindow, EVENT_Activate);<br />

<strong>Citrix</strong>MouseClick(201, 202, nWindow, MOUSE_ButtonLeft);<br />

<strong>Citrix</strong>WaitForWindow(nWindow, EVENT_Destroy);<br />

end;<br />

ErrorRemove(FACILITY_CITRIXENGINE, 47);<br />

end Handler1;<br />

Handling <strong>Citrix</strong> dialog This sample code loops for 30 seconds, waiting for the <strong>Citrix</strong> dialog boxes to<br />

boxes (solution #2) appear. If the dialog boxes appear, this code closes them.<br />

function My<strong>Citrix</strong>Startup(nMaxWait: number optional): boolean<br />

var<br />

hwndICAHandle<br />

: number;<br />

hwndFoundLicenseWarning : number;<br />

nCount<br />

: number;<br />

begin<br />

hwndICAHandle:=-1;<br />

hwndFoundLicenseWarning:=-1;<br />

nCount:=0;<br />

//<br />

if (nMaxWait = 0) then<br />

nMaxWait:=10;<br />

// if no wait time was passed,<br />

// use 10 tries (seconds) as a default<br />

end;<br />

MeasureStart("My<strong>Citrix</strong>Startup");<br />

<strong>SilkPerformer</strong> <strong>Citrix</strong> <strong>Tutorial</strong> 73

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!