MessagePumpThread.h 536 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. class CMessagePumpThread
  3. {
  4. public:
  5. CMessagePumpThread(void);
  6. ~CMessagePumpThread(void);
  7. static unsigned int __stdcall MessagePumpThread(void* thisptr);
  8. protected:
  9. virtual void TakeMsg(UINT msg, WPARAM wParam, LPARAM lParam) { return; }
  10. void RunMessagePump();
  11. UINT m_threadID;
  12. uintptr_t m_thread;
  13. HANDLE m_hEvt;
  14. public:
  15. void Start();
  16. void Stop();
  17. void PostMsg(UINT msg, WPARAM wParam, LPARAM lParam);
  18. UINT getThreadID() const { return m_threadID; }
  19. uintptr_t getThread() const { return m_thread; }
  20. };