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.

214 lines
3.8 KiB

  1. /*++
  2. Copyright (c) 1994-2001 Microsoft Corporation
  3. Module Name :
  4. shutdown.h
  5. Abstract:
  6. IIS Shutdown/restart dialog definitions
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Sergei Antonov (sergeia)
  10. Project:
  11. Internet Services Manager
  12. Revision History:
  13. --*/
  14. #ifndef __SHUTDOWN_H__
  15. #define __SHUTDOWN_H__
  16. //
  17. // IIS Service Command
  18. //
  19. typedef struct tagIISCOMMAND
  20. {
  21. //TCHAR szServer[MAX_PATH + 1];
  22. BOOL fFinished;
  23. HRESULT hReturn;
  24. DWORD dwMilliseconds;
  25. CWnd * pParent;
  26. CIISMachine * pMachine;
  27. CRITICAL_SECTION cs;
  28. }
  29. IISCOMMAND;
  30. //
  31. // Shutdown progress dialog
  32. //
  33. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  34. class CShutProgressDlg : public CDialog
  35. /*++
  36. Class Description:
  37. Shutdown progress indicator dialog. Displays a progress bar, and gives
  38. the opportunity to kill immediately.
  39. Public Interface:
  40. CShutProgressDlg Constructor
  41. Notes:
  42. This dialog displays a progress bar with the number of seconds for shutdown.
  43. The return value is IDOK if Kill() should be executed, or if no further action
  44. is required.
  45. --*/
  46. {
  47. //
  48. // Construction
  49. //
  50. public:
  51. CShutProgressDlg(IISCOMMAND * pCommand, BOOL bShowCancel = TRUE);
  52. //
  53. // Dialog Data
  54. //
  55. protected:
  56. //{{AFX_DATA(CShutProgressDlg)
  57. enum { IDD = IDD_SD_PROGRESS };
  58. CStatic m_static_ProgressMsg;
  59. CProgressCtrl m_prgShutdown;
  60. //}}AFX_DATA
  61. //
  62. // Overrides
  63. //
  64. protected:
  65. //{{AFX_VIRTUAL(CShutProgressDlg)
  66. protected:
  67. virtual void DoDataExchange(CDataExchange * pDX);
  68. //}}AFX_VIRTUAL
  69. //
  70. // Implementation
  71. //
  72. protected:
  73. //{{AFX_MSG(CShutProgressDlg)
  74. afx_msg void OnTimer(UINT nIDEvent);
  75. afx_msg void OnDestroy();
  76. virtual void OnOK();
  77. virtual void OnCancel();
  78. virtual BOOL OnInitDialog();
  79. //}}AFX_MSG
  80. DECLARE_MESSAGE_MAP()
  81. private:
  82. int m_nProgress;
  83. UINT m_uTimeoutSec;
  84. IISCOMMAND * m_pCommand;
  85. CString m_strProgress;
  86. BOOL m_bShowCancel;
  87. };
  88. //
  89. // Shutdown dialog
  90. //
  91. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  92. enum
  93. {
  94. //
  95. // Note: make sure that associated resource IDs remain
  96. // sequential.
  97. //
  98. ISC_START,
  99. ISC_STOP,
  100. ISC_SHUTDOWN,
  101. ISC_RESTART,
  102. /**/
  103. NUM_ISC_ITEMS
  104. };
  105. class CIISShutdownDlg : public CDialog
  106. /*++
  107. Class Description:
  108. IIS Shutdown/Restart dialog
  109. Public Interface:
  110. CIISShutdownDlg - Constructor
  111. ServicesWereRestarted Returns true if the services were restarted
  112. --*/
  113. {
  114. //
  115. // Construction
  116. //
  117. public:
  118. CIISShutdownDlg(
  119. IN CIISMachine * pMachine,
  120. IN CWnd * pParent = NULL
  121. );
  122. //
  123. // Access
  124. //
  125. public:
  126. BOOL ServicesWereRestarted() const { return m_fServicesRestarted; }
  127. HRESULT PerformCommand(int iCmd, BOOL bShowCancel = TRUE);
  128. //
  129. // Dialog Data
  130. //
  131. protected:
  132. //{{AFX_DATA(CIISShutdownDlg)
  133. enum { IDD = IDD_SHUTDOWN };
  134. CStatic m_static_Details;
  135. CComboBox m_combo_Restart;
  136. //}}AFX_DATA
  137. CString m_strDetails[NUM_ISC_ITEMS];
  138. //
  139. // Overrides
  140. //
  141. protected:
  142. //{{AFX_VIRTUAL(CIISShutdownDlg)
  143. protected:
  144. virtual void DoDataExchange(CDataExchange * pDX);
  145. //}}AFX_VIRTUAL
  146. //
  147. // Implementation
  148. //
  149. protected:
  150. //{{AFX_MSG(CIISShutdownDlg)
  151. afx_msg void OnSelchangeComboRestart();
  152. afx_msg void OnDblclkComboRestart();
  153. virtual void OnOK();
  154. virtual BOOL OnInitDialog();
  155. //}}AFX_MSG
  156. DECLARE_MESSAGE_MAP()
  157. void SetDetailsText();
  158. private:
  159. CIISMachine * m_pMachine;
  160. BOOL m_fServicesRestarted;
  161. };
  162. #endif // __SHUTDOWN_H__