以下是引用csyx在2023-10-10 21:06:28的发言:
是的,QUIT 前应加一条 CloseHandle
是的,QUIT 前应加一条 CloseHandle
继续请教下,具体怎么加CloseHandle?
是注册API,然后CloseHandle(0)?
Declare Long CreateMutex in win32api String, Long, String Declare Long GetLastError in win32api Declare Long CloseHandle in win32api Long Local hMutex m.hMutex = CreateMutex(Null, 1, 'mytest') If (m.hMutex != 0) and (GetLastError() == 183) CloseHandle(m.hMutex) MessageBox('重复运行') Quit Else MessageBox('首次运行' + 0h0d0a0d0a + '别关闭我,再次运行试试') EndIf