The opposite of the CitrixWaitForWindowCreation function, this function does not wait until a specified window appears; this function searches all tracked windows for a suitable window. A window may be specified by its caption, whereas five different search options may be provided with the nMatch parameter. If the function succeeds it returns a window handle that can be used as the nWindow parameter in Citrix functions.
CitrixAPI.bdh
CitrixSearchWindow( in sCaption : string, in nMatch : number optional ): number;
>0 if the function succeeds
0 otherwise
Parameter | Description |
---|---|
sCaption | Caption of the window to search for. |
nMatch |
Specify one of the following values (optional):
|
transaction TMain var nWindowSearchHandle : number; sWindowName : string; begin CitrixInit(640, 480); CitrixConnect("myserver", "myusername", "mypass", "mydomain", COLOR_16bit); CitrixWaitForLogon(); hWnd6 := CitrixWaitForWindowCreation("ICA Seamless Host Agent", MATCH_Exact, 0x94C800C4, 0, 0, 390, 223); CitrixWaitForWindow(hWnd6, EVENT_Activate); CitrixWaitForWindowCreation("Program Manager"); CitrixMouseClick(182, 195, hWnd6, MOUSE_ButtonLeft); CitrixWaitForWindow(hWnd6, EVENT_Destroy); ThinkTime(2.78); CitrixMouseDblClick(38, 22, DESKTOP, MOUSE_ButtonLeft); hWnd8 := CitrixWaitForWindowCreation("My Documents", MATCH_Exact, 0x16CF0000, 285, 31, 268, 205); CitrixWaitForWindow(hWnd8, EVENT_Activate); nWindowSearchHandle := CitrixSearchWindow("My D*", MATCH_Wildcard); CitrixGetWindowCaption(nWindowSearchHandle, sWindowName); print("window " + string(nWindowSearchHandle) + "; name: " + sWindowName); CitrixMouseClick(258, 13, hWnd8, MOUSE_ButtonLeft); CitrixWaitForWindow(hWnd8, EVENT_Destroy); CitrixDisconnect(); end TMain;