CitrixInit Function

Action

Initializes a Citrix client. Must be called once to enable Citrix replay (should be called from the TInit transaction). When a Try Script is run with the “Visual Citrix Client” option enabled, this function also launches the CitrixPlayer.

Include file

CitrixAPI.bdh

Syntax

CitrixInit( in nHRes : number,
            in nVRes : number,
            in nMode : number optional ) : boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
nHRes Horizontal screen resolution of the Citrix client.
nVRes Vertical resolution of the Citrix client.
nMode

Specify one of the following values (optional):

  • Mode_Normal (Default)

  • Mode_Fast Use this mode to disable the Citrix client’s rendering functionality. This mode requires fewer resources, but disables screenshot functionality—meaning that there won’t be any images in the TrueLog and screen synchronization (WaitForScreen) will not be possible.

  • Mode_Gui Use this mode to make each Citrix client show its user interface.

Example:

dcltrans
  transaction TMain
  var
  begin
    CitrixInit(640, 480);
    CitrixConnect("server1", "username", "password", "companydomain", COLOR_16bit);
    CitrixWaitForLogon();
    hWnd4 := CitrixWaitForWindowCreation("", MATCH_Exact, 0x96840000, -2, 452, 644, 30);
    hWnd5 := CitrixWaitForWindowCreation("ICA Seamless Host Agent", MATCH_Exact, 0x94C800C4, 0, 0, 390, 223);
    CitrixWaitForWindow(hWnd5,EVENT_Activate);
    CitrixWaitForWindowCreation("Program Manager");
    ThinkTime(31.50);
    CitrixMouseClick(217, 192, hWnd5, MOUSE_ButtonLeft);
    CitrixWaitForWindow(hWnd5,EVENT_Destroy);
    CitrixDisconnect();
end TMain;