Adds an interrupt specification. On certain window events (creations, activations, destructions, and caption changes) all stored interrupt specifications are checked; when an interrupt specification matches an occurred event, then an interrupt is thrown. Interrupts may be handled by a Citrix event handler. For further information see the event-handler section.
CitrixAPI.bdh
CitrixAddInterrupt( in nReason : number, in sCaption : string allownull, in nMatch : number, in nWindow : number optional): boolean;
true if the function succeeds
false otherwise
Parameter | Description |
---|---|
nReason |
|
sCaption | The caption that triggers an interrupt if it matches the window caption (which is specified in the nMatch parameter). If this parameter is provided (and not null or “”) then the nWindow parameter will be ignored. |
nMatch |
Specifies one of the following values:
|
nWindow | If the sCaption parameter is not provided, then windows will be examined by comparing their ID’s against the nWindow parameter (optional). |
transaction TMain var begin CitrixInit(800, 600); CitrixAddInterrupt(INTERRUPT_WindowCreate, "ICA Seamless Host Agent", MATCH_Exact); CitrixConnect("lab74", "labadmin", "labpass", "testlab1", COLOR_16bit); CitrixWaitForLogon(); hWnd4 := CitrixWaitForWindowCreation("", MATCH_Exact, 0x96840000, -2, 572, 804, 30); CitrixWaitForWindowCreation("Program Manager"); CitrixMouseClick(36, 17, hWnd4, MOUSE_ButtonLeft, MOD_None, -1, 0); hWnd11 := CitrixWaitForWindowCreation("", MATCH_Exact, 0x96400000, 2, 313, 163, 263); CitrixMouseClick(62, 247, hWnd11, MOUSE_ButtonLeft); CitrixWaitForWindow(hWnd11, EVENT_Destroy); hWnd12 := CitrixWaitForWindowCreation("Shut Down Windows", MATCH_Exact, 0x94C808CC, 191, 136, 417, 192); CitrixWaitForWindow(hWnd12, EVENT_Activate); CitrixMouseClick(203, 170, hWnd12, MOUSE_ButtonLeft); CitrixWaitForDisconnect(); end TMain; dclevent handler Handler1 <EVENT_CITRIXINTERRUPT> var nInterrupt, nWindow : number; nStyle : number; begin CitrixGetActInterrupt(nInterrupt, nWindow); ErrorAdd(FACILITY_CITRIXENGINE, 47, SEVERITY_INFORMATIONAL); print(string(nWindow)); if CitrixGetWindowStyle(nWindow, nStyle) and (nStyle <> 0xB4000000) then CitrixWaitForWindow(nWindow, EVENT_Activate); CitrixMouseClick(201, 202, nWindow, MOUSE_ButtonLeft); CitrixWaitForWindow(nWindow, EVENT_Destroy); end; ErrorRemove(FACILITY_CITRIXENGINE, 47); end Handler1;