Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.7 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // TopWin.h : Declaration of CTopWin, hidden top level window for handling system broadcast messages
  3. // Copyright (c) Microsoft Corporation 1999-2000.
  4. #pragma once
  5. #ifndef __TopWin_H_
  6. #define __TopWin_H_
  7. typedef CWinTraits<WS_OVERLAPPEDWINDOW, WS_EX_NOACTIVATE> HiddenTopTraits;
  8. class CVidCtl;
  9. /////////////////////////////////////////////////////////////////////////////
  10. // CTopWin
  11. class CTopWin : public CWindowImpl<CTopWin, CWindow, HiddenTopTraits> {
  12. public:
  13. enum {
  14. WMUSER_INPLACE_ACTIVATE,
  15. WMUSER_SITE_RECT_WRONG
  16. };
  17. CTopWin(CVidCtl *pVidCtli) : m_pVidCtl(pVidCtli) {}
  18. void Init() {
  19. ASSERT(m_pVidCtl); // its pointless to create one of these without associating with a main control
  20. Create(NULL, CRect(), _T("MSVidCtl System Broadcast Message Receiver"));
  21. }
  22. virtual ~CTopWin() {
  23. m_pVidCtl = NULL;
  24. }
  25. // NOTE: since this window is created by the main vidctl its message queue is associated with the appropriate
  26. // apartment thread for the main vidctl. thus whoever pumps the main apartment thread will pump this window too.
  27. // and, thus we're automatically synchronzied with the main vidctl and can simply reflect the significant
  28. // messages over to the vidctl itself and be guaranteed that we're getting the same
  29. // behavior for windowless and windowed since its the same code for both cases.
  30. virtual BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT& lResult, DWORD dwMsgMapID = 0);
  31. void PostInPlaceActivate() {
  32. PostMessage(WM_USER + WMUSER_INPLACE_ACTIVATE, 0, 0);
  33. }
  34. private:
  35. CVidCtl *m_pVidCtl;
  36. };
  37. #endif //__TopWin_H_