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.

145 lines
3.0 KiB

  1. #ifndef _PROPPAGE_H_
  2. #define _PROPPAGE_H_
  3. /*++
  4. Copyright (C) 1997-1999 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. return TRUE;
  30. }
  31. virtual void UpdateControls(LPARAM lParam = 0)
  32. {
  33. }
  34. virtual BOOL OnApply()
  35. {
  36. ASSERT(m_hDlg);
  37. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, 0L);
  38. return FALSE;
  39. }
  40. virtual BOOL OnLastChanceApply()
  41. {
  42. ASSERT(m_hDlg);
  43. return FALSE;
  44. }
  45. virtual BOOL OnWizFinish()
  46. {
  47. ASSERT(m_hDlg);
  48. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, 0L);
  49. return FALSE;
  50. }
  51. virtual BOOL OnWizNext()
  52. {
  53. ASSERT(m_hDlg);
  54. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, -1L);
  55. return FALSE;
  56. }
  57. virtual BOOL OnWizBack()
  58. {
  59. ASSERT(m_hDlg);
  60. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, -1L);
  61. return FALSE;
  62. }
  63. virtual BOOL OnSetActive()
  64. {
  65. ASSERT(m_hDlg);
  66. m_Active = TRUE;
  67. if (m_AlwaysUpdateOnActive || m_UpdateControlsPending)
  68. {
  69. UpdateControls();
  70. m_UpdateControlsPending = FALSE;
  71. }
  72. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, 0L);
  73. return FALSE;
  74. }
  75. virtual BOOL OnKillActive()
  76. {
  77. ASSERT(m_hDlg);
  78. m_Active = FALSE;
  79. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, 0L);
  80. return FALSE;
  81. }
  82. virtual BOOL OnReset()
  83. {
  84. ASSERT(m_hDlg);
  85. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, 0L);
  86. return FALSE;
  87. }
  88. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam)
  89. {
  90. return FALSE;
  91. }
  92. virtual BOOL OnQuerySiblings(WPARAM wParam, LPARAM lParam);
  93. virtual BOOL OnNotify(LPNMHDR pnmhdr)
  94. {
  95. ASSERT(m_hDlg);
  96. SetWindowLongPtr(m_hDlg, DWLP_MSGRESULT, 0L);
  97. return FALSE;
  98. }
  99. virtual BOOL OnDestroy();
  100. virtual BOOL OnHelp(LPHELPINFO pHelpInfo)
  101. {
  102. return FALSE;
  103. }
  104. virtual BOOL OnContextMenu(HWND hWnd, WORD xPos, WORD yPos)
  105. {
  106. return FALSE;
  107. }
  108. virtual UINT CreateCallback()
  109. {
  110. return TRUE;
  111. }
  112. virtual UINT DestroyCallback();
  113. HPROPSHEETPAGE CreatePage()
  114. {
  115. return ::CreatePropertySheetPage(&m_psp);
  116. }
  117. HWND m_hDlg;
  118. PROPSHEETPAGE m_psp;
  119. BOOL m_Active;
  120. BOOL m_AlwaysUpdateOnActive;
  121. BOOL m_UpdateControlsPending;
  122. int m_IDCicon;
  123. };
  124. #endif