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.

153 lines
3.5 KiB

  1. #ifndef _PROPPAGE_H_
  2. #define _PROPPAGE_H_
  3. /*++
  4. Copyright (C) Microsoft Corporation
  5. Module Name:
  6. proppage.h
  7. Abstract:
  8. header file for proppage.cpp
  9. Author:
  10. William Hsieh (williamh) created
  11. Revision History:
  12. --*/
  13. class CPropSheetPage
  14. {
  15. public:
  16. CPropSheetPage(HINSTANCE hInst, UINT idTemplate);
  17. virtual ~CPropSheetPage()
  18. {}
  19. static INT_PTR CALLBACK PageDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  20. static UINT CALLBACK PageCallback(HWND hDlg, UINT uMsg, LPPROPSHEETPAGE ppsp);
  21. protected:
  22. HWND GetControl(int ControlId)
  23. {
  24. ASSERT(m_hDlg);
  25. return GetDlgItem(m_hDlg, ControlId);
  26. }
  27. virtual BOOL OnInitDialog(LPPROPSHEETPAGE ppsp)
  28. {
  29. UNREFERENCED_PARAMETER(ppsp);
  30. return TRUE;
  31. }
  32. virtual void UpdateControls(LPARAM lParam = 0)
  33. {
  34. UNREFERENCED_PARAMETER(lParam);
  35. }
  36. virtual BOOL OnApply()
  37. {
  38. ASSERT(m_hDlg);
  39. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, 0L);
  40. return FALSE;
  41. }
  42. virtual BOOL OnLastChanceApply()
  43. {
  44. ASSERT(m_hDlg);
  45. return FALSE;
  46. }
  47. virtual BOOL OnWizFinish()
  48. {
  49. ASSERT(m_hDlg);
  50. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, 0L);
  51. return FALSE;
  52. }
  53. virtual BOOL OnWizNext()
  54. {
  55. ASSERT(m_hDlg);
  56. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, -1L);
  57. return FALSE;
  58. }
  59. virtual BOOL OnWizBack()
  60. {
  61. ASSERT(m_hDlg);
  62. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, -1L);
  63. return FALSE;
  64. }
  65. virtual BOOL OnSetActive()
  66. {
  67. ASSERT(m_hDlg);
  68. m_Active = TRUE;
  69. if (m_AlwaysUpdateOnActive || m_UpdateControlsPending)
  70. {
  71. UpdateControls();
  72. m_UpdateControlsPending = FALSE;
  73. }
  74. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, 0L);
  75. return FALSE;
  76. }
  77. virtual BOOL OnKillActive()
  78. {
  79. ASSERT(m_hDlg);
  80. m_Active = FALSE;
  81. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, 0L);
  82. return FALSE;
  83. }
  84. virtual BOOL OnReset()
  85. {
  86. ASSERT(m_hDlg);
  87. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, 0L);
  88. return FALSE;
  89. }
  90. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam)
  91. {
  92. UNREFERENCED_PARAMETER(wParam);
  93. UNREFERENCED_PARAMETER(lParam);
  94. return FALSE;
  95. }
  96. virtual BOOL OnQuerySiblings(WPARAM wParam, LPARAM lParam);
  97. virtual BOOL OnNotify(LPNMHDR pnmhdr)
  98. {
  99. UNREFERENCED_PARAMETER(pnmhdr);
  100. ASSERT(m_hDlg);
  101. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, 0L);
  102. return FALSE;
  103. }
  104. virtual BOOL OnDestroy();
  105. virtual BOOL OnHelp(LPHELPINFO pHelpInfo)
  106. {
  107. UNREFERENCED_PARAMETER(pHelpInfo);
  108. return FALSE;
  109. }
  110. virtual BOOL OnContextMenu(HWND hWnd, WORD xPos, WORD yPos)
  111. {
  112. UNREFERENCED_PARAMETER(hWnd);
  113. UNREFERENCED_PARAMETER(xPos);
  114. UNREFERENCED_PARAMETER(yPos);
  115. return FALSE;
  116. }
  117. virtual UINT CreateCallback()
  118. {
  119. return TRUE;
  120. }
  121. virtual UINT DestroyCallback();
  122. HPROPSHEETPAGE CreatePage()
  123. {
  124. return ::CreatePropertySheetPage(&m_psp);
  125. }
  126. HWND m_hDlg;
  127. PROPSHEETPAGE m_psp;
  128. BOOL m_Active;
  129. BOOL m_AlwaysUpdateOnActive;
  130. BOOL m_UpdateControlsPending;
  131. int m_IDCicon;
  132. };
  133. #endif