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.

166 lines
3.1 KiB

  1. // File: HiddenWnd.cpp
  2. #include "precomp.h"
  3. #include "ConfWnd.h"
  4. #include "TaskBar.h"
  5. #include "ConfRoom.h"
  6. #include "Conf.h"
  7. #include "FloatBar.h"
  8. #include "Splash.h"
  9. #include "Cmd.h"
  10. #include "TopWindow.h"
  11. const TCHAR g_cszHiddenWndClassName[] = _TEXT("ConfHiddenWindow");
  12. BOOL CHiddenWindow::Create()
  13. {
  14. return(CGenWindow::Create(NULL,
  15. g_szEmpty,
  16. WS_POPUP, // not visible!
  17. 0,
  18. 0, 0, 0, 0,
  19. _Module.GetModuleInstance(),
  20. NULL,
  21. g_cszHiddenWndClassName
  22. ));
  23. }
  24. VOID CHiddenWindow::OnCallStarted()
  25. {
  26. ::SetTimer(GetWindow(),
  27. WINSOCK_ACTIVITY_TIMER,
  28. WINSOCK_ACTIVITY_TIMER_PERIOD,
  29. NULL);
  30. }
  31. VOID CHiddenWindow::OnCallEnded()
  32. {
  33. ::KillTimer(GetWindow(), WINSOCK_ACTIVITY_TIMER);
  34. }
  35. LRESULT CHiddenWindow::ProcessMessage( HWND hwnd, UINT uMsg,
  36. WPARAM wParam, LPARAM lParam)
  37. {
  38. // This window is used for DCL/databeam callbacks and to route
  39. // WM_COMMAND messages generated by TranslateAccelerator()
  40. switch(uMsg)
  41. {
  42. case WM_CONF_MSG_BOX:
  43. {
  44. HWND hwndParent = NULL;
  45. if (_Module.IsUIVisible())
  46. {
  47. CTopWindow *pTop = GetTopWindow();
  48. if (NULL != pTop)
  49. {
  50. hwndParent = pTop->GetWindow();
  51. if (NULL != hwndParent)
  52. {
  53. hwndParent = GetLastActivePopup(hwndParent);
  54. }
  55. }
  56. }
  57. ::ConfMsgBox( hwndParent,
  58. (LPCTSTR) wParam,
  59. MB_OK | MB_ICONINFORMATION |
  60. MB_SETFOREGROUND);
  61. break;
  62. }
  63. case WM_NM_DISPLAY_MSG:
  64. {
  65. return ::DisplayMsg((LPTSTR)lParam, (UINT) wParam);
  66. }
  67. case WM_TASKBAR_NOTIFY:
  68. {
  69. switch (lParam)
  70. {
  71. case WM_RBUTTONUP:
  72. ::OnRightClickTaskbar();
  73. break;
  74. case WM_LBUTTONDBLCLK:
  75. // Kill the timer, so we don't pop up the toolbar
  76. m_fGotDblClick = TRUE;
  77. ::CreateConfRoomWindow();
  78. break;
  79. case WM_LBUTTONUP:
  80. if (FALSE == GetCursorPos(&m_ptTaskbarClickPos))
  81. {
  82. // If GetCursorPos failed, put it at 0,0
  83. m_ptTaskbarClickPos.x = m_ptTaskbarClickPos.y = 0;
  84. }
  85. // Create a timer that will go off one dbl-click's time from now
  86. ::SetTimer(hwnd, TASKBAR_DBLCLICK_TIMER, GetDoubleClickTime(), NULL);
  87. break;
  88. }
  89. return(TRUE);
  90. }
  91. case WM_TIMER:
  92. {
  93. switch (wParam)
  94. {
  95. case WINSOCK_ACTIVITY_TIMER:
  96. {
  97. ::SendDialmonMessage(WM_WINSOCK_ACTIVITY);
  98. break;
  99. }
  100. case TASKBAR_DBLCLICK_TIMER:
  101. {
  102. ::KillTimer(hwnd, TASKBAR_DBLCLICK_TIMER);
  103. if (!m_fGotDblClick)
  104. {
  105. CFloatToolbar* pft = new CFloatToolbar(::GetConfRoom());
  106. if (NULL != pft)
  107. {
  108. pft->Create(m_ptTaskbarClickPos);
  109. }
  110. }
  111. m_fGotDblClick = FALSE;
  112. break;
  113. }
  114. default:
  115. break;
  116. }
  117. break;
  118. }
  119. case MM_MIXM_LINE_CHANGE:
  120. case MM_MIXM_CONTROL_CHANGE:
  121. {
  122. if(GetConfRoom())
  123. {
  124. CAudioControl *pAudioControl = GetConfRoom()->GetAudioControl();
  125. if (NULL != pAudioControl)
  126. {
  127. pAudioControl->RefreshMixer();
  128. }
  129. }
  130. break;
  131. }
  132. case WM_DESTROY:
  133. {
  134. TRACE_OUT(("Conf hidden window received WM_DESTROY"));
  135. return 0;
  136. }
  137. default:
  138. return CGenWindow::ProcessMessage(hwnd, uMsg, wParam, lParam);
  139. }
  140. return FALSE;
  141. }