CitrixWindowBringToTop Function

Action

Brings the specified window to the top-most position. Note that a normal application window may not appear in front of the task-bar while the “Always on top” setting is enabled.

Include file

CitrixAPI.bdh

Syntax

CitrixWindowBringToTop( in nWindow : number ): boolean;

Return value

  • true if the function succeeds

  • false otherwise

Parameter Description
nWindow Window handle returned by a call to CitrixWaitForWindowCreation or the SearchWindow functions.

Example:

  transaction Tmain
  var
  begin
    CitrixInit(640, 480);
    CitrixConnect("myserver", "myusername", "mypass", "mydomain", 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");
    CitrixMouseClick(212, 194, hWnd5, MOUSE_ButtonLeft);
    CitrixWaitForWindow(hWnd5, EVENT_Destroy);
    ThinkTime(3.86);
    CitrixMouseDblClick(34, 21, DESKTOP, MOUSE_ButtonLeft);
    hWnd7 := CitrixWaitForWindowCreation("My Documents", MATCH_Exact, 0x16CF0000, 285, 31, 200, 100);
    CitrixWaitForWindow(hWnd7, EVENT_Activate);
    CitrixMouseDblClick(112, 20, DESKTOP, MOUSE_ButtonLeft);
    hWnd9 := CitrixWaitForWindowCreation("Microsoft Excel – Book4", MATCH_Exact, 0x15CF0000, -4, -4, 648, 460);
    CitrixMouseClick(179, 16, hWnd4, MOUSE_ButtonLeft);
    hWnd10 := CitrixWaitForWindowCreation("UltraEdit-32 – [Edit1]", MATCH_Exact, 0x15CF8000, -4, -4, 648, 460);
    CitrixWindowBringToTop(hWnd7); // bring "My Documents" to top
    wait 2.0;
    CitrixMouseClick(633, 15, hWnd10, MOUSE_ButtonLeft);
    CitrixWaitForWindow(hWnd10, EVENT_Destroy);
    CitrixMouseClick(633, 12, hWnd9, MOUSE_ButtonLeft);
    CitrixWaitForWindow(hWnd9, EVENT_Destroy);
    CitrixMouseClick(189, 9, hWnd7, MOUSE_ButtonLeft);
    CitrixWaitForWindow(hWnd7, EVENT_Destroy);
    CitrixDisconnect();
  end TMain;