00001 // WaitCallback.h: interface for the WaitCallback class. 00004 00005 00006 #if !defined(AFX_WAITCALLBACK_H__C554D63C_1250_49FC_9409_E6758E44402E__INCLUDED_) 00007 #define AFX_WAITCALLBACK_H__C554D63C_1250_49FC_9409_E6758E44402E__INCLUDED_ 00008 00009 #if _MSC_VER > 1000 00010 #pragma once 00011 #endif // _MSC_VER > 1000 00012 00018 typedef void (__stdcall *WAITCALLBACK) (void *, bool); 00019 00027 class WaitCallback 00028 { 00029 public: 00030 bool hasWaitRegistered() const; 00031 void unregisterWait(); 00032 bool registerWaitForSingleObject(HANDLE, const WAITCALLBACK, const PVOID, const DWORD, const bool = true); 00033 00034 WaitCallback(); 00035 virtual ~WaitCallback(); 00036 private: 00037 static DWORD WINAPI waitThread(LPVOID); 00038 00039 HANDLE hWaitThread; 00040 bool justOnce; 00041 DWORD timeOut; 00042 HANDLE waitEvents[2]; 00043 WAITCALLBACK cBack; 00044 PVOID cBackParam; 00045 00046 }; 00047 00048 #endif // !defined(AFX_WAITCALLBACK_H__C554D63C_1250_49FC_9409_E6758E44402E__INCLUDED_)