This function waits until a specified window event (specified with the nEvent parameter) occurs. Such events may be an activation, destruction or caption change of a specified window. If a selected event is a caption change, any caption change of the specified window will satisfy the function. Additionally a caption can be specified explicitly using the sCaption and nMatch parameters. See CitrixWaitForWindowCreation for a detailed description of these two parameters.
In the case of a timeout, error reporting can be prohibited with the bNoError parameter.
CitrixAPI.bdh
CitrixWaitForWindow( in nWindow : number, in nEvent : number optional, in sCaption : number optional, in nMatch : number optional, in nTimeout : number optional, in bNoError : boolean optional ) : boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
nWindow | Window handle returned by a call to CitrixWaitForWindowCreation. Use DESKTOP to specify a region relative to the desktop. |
nEvent |
Specify one of the following values (optional):
|
sCaption | Window caption to wait for. When the nEvent parameter is not EVENT_CaptionChange, this parameter is ignored. When this parameter is omitted (or “” is used), this function waits for the next caption change of the window. |
nMatch |
When the nEvent parameter is not EVENT_CaptionChange, this parameter is ignored (optional).Specify one of the following values:
|
nTimeout | Specifies the time in milliseconds to wait for the specified event (optional). When this parameter is omitted or set to 0, the default timeout is used. The default value can be adjusted by profile settings ( ) or an appropriate call to the CitrixSetOption function. |
bNoError | Set this parameter to true to prevent a timeout from raising an error. This is especially useful for controlling variable user reactions. |
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"); ThinkTime(3.33); CitrixMouseClick(208, 193, hWnd5, MOUSE_ButtonLeft); CitrixWaitForWindow(hWnd5, EVENT_Destroy); ThinkTime(2.45); CitrixMouseClick(41, 7, hWnd4, MOUSE_ButtonLeft); hWnd7 := CitrixWaitForWindowCreation("", MATCH_Exact, 0x96400000, 2, 193, 163, 263); CitrixMouseClick(48, 250, hWnd7, MOUSE_ButtonLeft); CitrixWaitForWindow(hWnd7, EVENT_Destroy); hWnd9 := CitrixWaitForWindowCreation("Shut Down Windows", MATCH_Exact, 0x94C808CC, 111, 96, 417, 192); CitrixWaitForWindow(hWnd9, EVENT_Activate); CitrixMouseClick(184, 165, hWnd9, MOUSE_ButtonLeft); CitrixWaitForDisconnect(); end TMain;