Group: Synchronization - Library: kernel32
How to suspend or hibernate your system
HANDLE WINAPI OpenWaitableTimer(
DWORD dwDesiredAccess,
BOOL bInheritHandle,
LPCTSTR lpTimerName
);
DECLARE INTEGER OpenWaitableTimer IN kernel32;
LONG dwDesiredAccess,;
INTEGER bInheritHandle,;
STRING lpTimerName
dwDesiredAccess [in] Access to the timer object. The function fails if the security descriptor of the specified object does not permit the requested access for the calling process.
bInheritHandle [in] If this value is TRUE, processes created by this process will inherit the handle.
lpTimerName [in] Pointer to a null-terminated string specifying the name of the timer object.
If the function succeeds, the return value is a handle to the timer object.
The OpenWaitableTimer function enables multiple processes to open handles to the same timer object. The function succeeds only if some process has already created the timer using the CreateWaitableTimer function.
The returned handle can be duplicated by using the DuplicateHandle function. Use the CloseHandle function to close the handle. The system closes the handle automatically when the process terminates. The timer object is destroyed when its last handle has been closed.