Closes an open object handle previously opened with CreateEvent, CreateEventEx, CreateMutex or CreateMutexEx.
Kernel.bdh
CloseHandle(in hHandle: number): boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
hHandle | Object handle to close |
dcltrans transaction TCloseHandle var hMutex: number; begin hMutex := CreateMutex("MutexObject"); write("mutex object created"); writeln; WaitForSingleObject(hMutex, INFINITE); ReleaseMutex(hMutex); write("mutex object released"); writeln; CloseHandle(hMutex); write("handle to mutex object closed"); writeln; end TCloseHandle;
mutex object created mutex object released handle to mutex object closed