>>DECLARE INTEGER CreateEvent IN WIN32API ; >> INTEGER lpEventAttributes, ; >> SHORT bManualReset, ; >> SHORT bInitialState, ; >> STRING @ lpName >>DECLARE INTEGER GetLastError IN Win32API >>DECLARE CloseHandle IN Win32API INTEGER hObject >>nEh = CreateEvent(0,0,1, 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 >>ENDIF>