Leaked source code of windows server 2003
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.

103 lines
2.9 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // File: statusdlg.h
  4. //
  5. // Module: CMMON32.EXE
  6. //
  7. // Synopsis: Header for the CStatusDlg Class.
  8. //
  9. // Copyright (c) 1998-1999 Microsoft Corporation
  10. //
  11. // Author: quintinb Created Header 08/16/99
  12. //
  13. //+----------------------------------------------------------------------------
  14. #ifndef STATUSDLG_H
  15. #define STATUSDLG_H
  16. #include <windows.h>
  17. #include "ModelessDlg.h"
  18. class CCmConnection;
  19. //+---------------------------------------------------------------------------
  20. //
  21. // class CStatusDlg
  22. //
  23. // Description: The class for both Status dialog and count down dialog
  24. //
  25. // History: fengsun Created 2/17/98
  26. //
  27. //----------------------------------------------------------------------------
  28. class CStatusDlg : public CModelessDlg
  29. {
  30. public:
  31. CStatusDlg(CCmConnection* pConnection);
  32. HWND Create(HINSTANCE hInstance, HWND hWndParent,
  33. LPCTSTR lpszTitle, HICON hIcon);
  34. // Call RasMonitorDlg
  35. // Shall CM display the new NT5 status dialog
  36. void ChangeToCountDown(); // change to count down dialog box
  37. void ChangeToStatus(); // Change to Status dialog box
  38. void UpdateStatistics(); // Update statistics for Win95
  39. void UpdateCountDown(DWORD dwDuration, DWORD dwSeconds);
  40. void UpdateStats(DWORD dwBaudRate, DWORD dwBytesRead, DWORD dwBytesWrite,
  41. DWORD dwByteReadPerSec, DWORD dwByteWritePerSec);
  42. void UpdateDuration(DWORD dwSeconds);
  43. void KillRasMonitorWindow();
  44. void BringToTop();
  45. void DismissStatusDlg();
  46. virtual BOOL OnInitDialog(); // WM_INITDIALOG
  47. protected:
  48. // Status or count down dialog box. TRUE means currently it is displaying status
  49. BOOL m_fDisplayStatus;
  50. // Pointer to the connection to notify event
  51. CCmConnection* m_pConnection;
  52. // Whether window is visible when it is changed into count down
  53. // Need to restore the previous visible state when "StayOnLine"
  54. BOOL m_fStatusWindowVisible;
  55. //
  56. // registered hwnd msg for IE4 explorer. This msg is broadcasted
  57. // when the taskbar comes up.
  58. //
  59. UINT m_uiHwndMsgTaskBar;
  60. void OnDisconnect();
  61. virtual void OnOK();
  62. virtual void OnCancel();
  63. virtual DWORD OnOtherCommand(WPARAM wParam, LPARAM lParam );
  64. virtual DWORD OnOtherMessage(UINT uMsg, WPARAM wParam, LPARAM lParam );
  65. HWND GetRasMonitorWindow();
  66. static BOOL CALLBACK KillRasMonitorWndProc(HWND hwnd, LPARAM lParam);
  67. static const DWORD m_dwHelp[]; // help id pairs
  68. public:
  69. #ifdef DEBUG
  70. void AssertValid() const;
  71. #endif
  72. };
  73. inline void CStatusDlg::BringToTop()
  74. {
  75. //
  76. // On NT, we should bring the RAS monitor window to top, if exist
  77. //
  78. ShowWindow(m_hWnd, SW_SHOW);
  79. EnableWindow(m_hWnd, TRUE);
  80. HWND hwndTop = GetLastActivePopup(m_hWnd);
  81. MYDBGASSERT(hwndTop);
  82. SetForegroundWindow(hwndTop);
  83. }
  84. #endif