diff options
Diffstat (limited to 'plugins/SendScreenshotPlus/src/Utils.h')
-rw-r--r-- | plugins/SendScreenshotPlus/src/Utils.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/SendScreenshotPlus/src/Utils.h b/plugins/SendScreenshotPlus/src/Utils.h index 0beeaabd18..94e5a73ea4 100644 --- a/plugins/SendScreenshotPlus/src/Utils.h +++ b/plugins/SendScreenshotPlus/src/Utils.h @@ -75,4 +75,17 @@ void SaveTIF(HBITMAP hBmp, TCHAR* szFilename); //void ShowPopup(char *title, char *text); */ + +class EventHandle
+{
+ HANDLE _hEvent;
+public:
+ inline EventHandle() { _hEvent = CreateEvent(NULL, 0, 0, NULL); }
+ inline ~EventHandle() { CloseHandle(_hEvent); }
+ inline void Set() { SetEvent(_hEvent); }
+ inline void Wait() { WaitForSingleObject(_hEvent, INFINITE); }
+ inline void Wait(DWORD dwMilliseconds) { WaitForSingleObject(_hEvent, dwMilliseconds); }
+ inline operator HANDLE() { return _hEvent; }
+}; + #endif |