sl@0: //------------------------------------------------------------------------------ sl@0: #ifndef EVENT_H_INCLUDED sl@0: #define EVENT_H_INCLUDED sl@0: //------------------------------------------------------------------------------ sl@0: #include sl@0: //------------------------------------------------------------------------------ sl@0: class Event sl@0: { sl@0: public: sl@0: Event(); sl@0: virtual ~Event(); sl@0: sl@0: private: sl@0: Event(const Event& other) {} sl@0: Event& operator=(const Event& other) { return *this; } sl@0: sl@0: public: sl@0: void Signal() const; sl@0: void Reset() const; sl@0: void Await() const; sl@0: sl@0: private: sl@0: HANDLE m_hEvent; sl@0: }; sl@1: sl@1: sl@1: /** sl@1: */ sl@1: class WindowEvent: public Event sl@1: { sl@1: public: sl@1: WindowEvent(HWND aWnd, UINT aMsg):Event(),iWnd(aWnd),iMsg(aMsg){} sl@1: sl@1: BOOL Post(){return PostMessage(iWnd, iMsg, (WPARAM)this, (LPARAM)NULL);} sl@1: virtual LRESULT Execute(UINT aMsg); sl@1: virtual LRESULT DoExecute() = 0; sl@1: sl@1: protected: sl@1: HWND iWnd; sl@1: UINT iMsg; sl@1: }; sl@1: sl@0: //------------------------------------------------------------------------------ sl@0: #endif sl@0: //------------------------------------------------------------------------------