DECLARE INTEGER CreateEvent IN WIN32API ; INTEGER lpEventAttributes, ; SHORT bManualReset, ; SHORT bInitialState, ; STRING @ lpName DECLARE INTEGER GetLastError IN Win32API DECLARE CloseHandle IN Win32API INTEGER hObject * Prepend with either 'Session/' or 'Local/' to limit the event scope * to the present Terminal Server session context. See CreateEvent() in * the MSDN to get full details on the exact meaning of the Local and * Session scope. The scope is ignored except under Terminal Server. nEh = CreateEvent(0,0,1, 'Session/' + PROGRAM(0) + '.EVENT') IF GetLastError() = 183 OR nEh = 0 * There's an instance running already (183) or the Event can't be defined * So don't do it; do release the handle, since it's harmless and should * be done rather than relying on Windows to clean up after itself =CloseHandle(nEh) QUIT ENDIFThis has not been tested under Citrix under WinNT 3.51; it is applicable to NT 4.0 and Win2K Terminal Server with MetaFrame. The Event is supported under NT 3.51, but I don't know about Citrix's support for scoping the event.