CitrixRunPublishedApplication Function

Action

Launches a published application within a connected session. Use this function to test session sharing by driving multiple published applications inside one session.

Include file

CitrixAPI.bdh

Syntax

CitrixRunPublishedApplication(
    in sApp    : string,
    in sParams : string optional ) : boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sApp Name of the published application to launch
sParams Arguments of the published application (optional)

Example

dcltrans
  transaction TMain
  var
    hWnd4 : number;
    hWnd6 : number;
    hWnd7 : number;
  begin
    CitrixInit(800,600); // do not change the resolution
    CitrixSetApplication("notepad");
    CitrixConnect("citrix", "admin", Decrypt("8VX"), "MyDom", COLOR_32bit);
    CitrixWaitForLogon();
    hWnd4 := CitrixWaitForWindowCreation("Untitled - Notepad", MATCH_Exact, 0x15CF0000, -4, -4, 808, 608);
    CitrixWaitForWindow(hWnd4, EVENT_Activate);
    CitrixKeyString("Hello");
    CitrixRunPublishedApplication("excel");
  
    hWnd6 := CitrixWaitForWindowCreation("Microsoft Excel - Book*", MATCH_Wildcard, 0x14CF0000, -4, -4, 808, 580);
    CitrixMouseClick(791, 14, hWnd6, MOUSE_ButtonLeft);
    CitrixWaitForWindow(hWnd6, EVENT_Destroy);
    CitrixWaitForWindow(hWnd4, EVENT_Activate);
    CitrixMouseClick(795, 16, hWnd4, MOUSE_ButtonLeft);
    hWnd7 := CitrixWaitForWindowCreation("Notepad", MATCH_Exact, 0x94C801C5, 267, 258, 272, 126);
    CitrixWaitForWindow(hWnd7, EVENT_Activate);
    CitrixMouseClick(141, 99, hWnd7, MOUSE_ButtonLeft);
    CitrixWaitForDisconnect();
end TMain;