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.

171 lines
4.7 KiB

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. //
  3. // Property Page base class
  4. //
  5. // 9-9-97 sburns
  6. #ifndef PROPPAGE_HPP_INCLUDED
  7. #define PROPPAGE_HPP_INCLUDED
  8. // PropertyPage extends the Dialog class to provide message cracking for
  9. // property page notifications.
  10. class PropertyPage : public Dialog
  11. {
  12. public:
  13. // Calls CreatePropertySheetPage and returns the resulting HPROPSHEETPAGE.
  14. // Normally, the HPROPSHEETPAGE is deleted by a later call to the Win32
  15. // API ::PropertySheet. If the HPROPSHEETPAGE is not passed to
  16. // PropertySheet, or PropertySheet fails, it should be deleted with
  17. // ::DestroyPropertySheetPage.
  18. virtual
  19. HPROPSHEETPAGE
  20. Create();
  21. protected:
  22. // Invoked upon receipt of the PSN_APPLY notification message. Return true
  23. // if you handle the messages, false if you do not. The default
  24. // implementation returns false.
  25. //
  26. // isClosing - true if the sheet is closing (OK was pressed), false if
  27. // not (Apply was pressed).
  28. virtual
  29. bool
  30. OnApply(bool isClosing);
  31. // Invoked upon receipt of the PSN_HELP notification message. Return true
  32. // if you handle the message, false if you do not. The default
  33. // implementation returns false.
  34. virtual
  35. bool
  36. OnHelp();
  37. // Invoked upon receipt of the PSN_KILLACTIVE notification message. Return
  38. // true if you handle the messages, false if you do not. The default
  39. // implementation returns false.
  40. virtual
  41. bool
  42. OnKillActive();
  43. // Invoked upon receipt of the PSN_SETACTIVE notification message. Return
  44. // true if you handle the messages, false if you do not. The default
  45. // implementation returns false.
  46. virtual
  47. bool
  48. OnSetActive();
  49. // Invoked upon receipt of the PSN_QUERYCANCEL notification message.
  50. // Return true if you handle the messages, false if you do not. The
  51. // default implementation returns false.
  52. virtual
  53. bool
  54. OnQueryCancel();
  55. // Invoked upon receipt of the PSN_RESET notification message. Return
  56. // true if you handle the messages, false if you do not. The default
  57. // implementation returns false.
  58. virtual
  59. bool
  60. OnReset();
  61. // Invoked upon receipt of the PSN_WIZBACK notification message. Return
  62. // true if you handle the messages, false if you do not. The default
  63. // implementation returns false.
  64. virtual
  65. bool
  66. OnWizBack();
  67. // Invoked upon receipt of the PSN_WIZNEXT notification message. Return
  68. // true if you handle the messages, false if you do not. The default
  69. // implementation returns false.
  70. virtual
  71. bool
  72. OnWizNext();
  73. // Invoked upon receipt of the PSN_WIZFINISH notification message. Return
  74. // true if you handle the messages, false if you do not. The default
  75. // implementation returns false.
  76. // The handler must set the DWLP_MSGRESULT by calling Win::SetWindowLongPtr
  77. // to tell the sheet whether or not to shutdown the wizard.
  78. virtual
  79. bool
  80. OnWizFinish();
  81. // Constructs a new instance. Declared protected so that this class
  82. // only functions as base class
  83. //
  84. // dialogResID - resource identifier of the dialog template resource.
  85. //
  86. // helpMap - array mapping dialog control IDs to context help IDs. The
  87. // array must be in the following form:
  88. // {
  89. // controlID1, helpID1,
  90. // controlID2, helpID2,
  91. // controlIDn, helpIDn,
  92. // 0, 0
  93. // }
  94. //
  95. // To indicate that a control does not have help, the value of its
  96. // corresponding help ID should be -1. This array is copied by the
  97. // constuctor.
  98. //
  99. // deleteOnRelease - true to delete the instance when the Win32
  100. // ::PropertySheet function is about to destroy the sheet, and sends the
  101. // PSPCB_RELEASE message to each page's callback. false if the page
  102. // instance will be deleted at a later point.
  103. PropertyPage(
  104. unsigned dialogResID,
  105. const DWORD helpMap[],
  106. bool deleteOnRelease = true);
  107. // protected dtor so that the dtors of derived classes can call this,
  108. // the base class' dtor, and to suggest that prop pages are self-deleting.
  109. virtual ~PropertyPage();
  110. static
  111. INT_PTR APIENTRY
  112. propPageDialogProc(
  113. HWND dialog,
  114. UINT message,
  115. WPARAM wparam,
  116. LPARAM lparam);
  117. static
  118. UINT CALLBACK
  119. PropSheetPageCallback(HWND hwnd, UINT uMsg, PROPSHEETPAGE* page);
  120. private:
  121. static
  122. PropertyPage*
  123. getPage(HWND pageDialog);
  124. // not implemented: no copying allowed
  125. PropertyPage(const PropertyPage&);
  126. const PropertyPage& operator=(const PropertyPage&);
  127. bool deleteOnRelease;
  128. };
  129. #endif // PROPPAGE_HPP_INCLUDED