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.

238 lines
9.3 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // prsht.h - PropSheet definitions
  4. //
  5. // Copyright (c) 1993-1994, Microsoft Corp. All rights reserved
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifndef _PRSHT_H_
  9. #define _PRSHT_H_
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #define MAXPROPPAGES 24
  14. struct _PSP;
  15. typedef struct _PSP FAR* HPROPSHEETPAGE;
  16. typedef struct _PROPSHEETPAGE FAR *LPPROPSHEETPAGE; // forward declaration
  17. //
  18. // Property sheet page helper function
  19. //
  20. typedef void (CALLBACK FAR * LPFNRELEASEPROPSHEETPAGE)(LPPROPSHEETPAGE ppsp);
  21. #define PSP_DEFAULT 0x0000
  22. #define PSP_DLGINDIRECT 0x0001 // use pResource instead of pszTemplate
  23. #define PSP_USEHICON 0x0002
  24. #define PSP_USEICONID 0x0004
  25. #define PSP_USETITLE 0x0008
  26. #define PSP_USERELEASEFUNC 0x0020
  27. #define PSP_USEREFPARENT 0x0040
  28. // this structure is passed to CreatePropertySheetPage() and is in the LPARAM on
  29. // of the WM_INITDIALOG message when a property sheet page is created
  30. typedef struct _PROPSHEETPAGE {
  31. DWORD dwSize; // size of this structure (including extra data)
  32. DWORD dwFlags; // PSP_ bits define the use and meaning of fields
  33. HINSTANCE hInstance; // instance to load the template from
  34. union {
  35. LPCSTR pszTemplate; // template to use
  36. #ifdef WIN32
  37. LPCDLGTEMPLATE pResource; // PSP_DLGINDIRECT: pointer to resource in memory
  38. #else
  39. const VOID FAR *pResource; // PSP_DLGINDIRECT: pointer to resource in memory
  40. #endif
  41. };
  42. union {
  43. HICON hIcon; // PSP_USEICON: hIcon to use
  44. LPCSTR pszIcon; // PSP_USEICONID: or icon name string or icon id
  45. };
  46. LPCSTR pszTitle; // name to override the template title or string id
  47. DLGPROC pfnDlgProc; // dlg proc
  48. LPARAM lParam; // user data
  49. LPFNRELEASEPROPSHEETPAGE pfnRelease;// PSP_USERELEASEFUNC: function will be called before HPROPSHEETPAGE is destroyed
  50. UINT FAR * pcRefParent; // PSP_USERREFPARENT: pointer to ref count variable
  51. } PROPSHEETPAGE, FAR *LPPROPSHEETPAGE;
  52. typedef const PROPSHEETPAGE FAR *LPCPROPSHEETPAGE;
  53. #define PSH_DEFAULT 0x0000
  54. #define PSH_PROPTITLE 0x0001 // use "Properties for <lpszCaption>" as the title
  55. #define PSH_USEHICON 0x0002 // use specified hIcon for the caption
  56. #define PSH_USEICONID 0x0004 // use lpszIcon to load the icon
  57. #define PSH_PROPSHEETPAGE 0x0008 // use ppsp instead of phpage (points to array of PROPSHEETPAGE structures)
  58. #define PSH_MULTILINETABS 0x0010 // do multiline tabs
  59. typedef struct _PROPSHEETHEADER {
  60. DWORD dwSize; // size of this structure
  61. DWORD dwFlags; // PSH_
  62. HWND hwndParent;
  63. HINSTANCE hInstance; // to load icon or caption string
  64. union {
  65. HICON hIcon; // PSH_USEHICON: hIcon to use
  66. LPCSTR pszIcon; // PSH_USEICONID: or icon name string or icon id
  67. };
  68. LPCSTR pszCaption; // PSH_PROPTITLE: dlg caption or "Properties for <lpszCaption>"
  69. // may be MAKEINTRESOURCE()
  70. UINT nPages; // # of HPROPSHEETPAGE (or PROPSHEETPAGE) elements in phpage
  71. UINT nStartPage; // initial page to be shown (zero based)
  72. union {
  73. LPCPROPSHEETPAGE ppsp;
  74. HPROPSHEETPAGE FAR *phpage;
  75. };
  76. } PROPSHEETHEADER, FAR *LPPROPSHEETHEADER;
  77. typedef const PROPSHEETHEADER FAR *LPCPROPSHEETHEADER;
  78. //
  79. // property sheet APIs
  80. //
  81. HPROPSHEETPAGE WINAPI CreatePropertySheetPage(LPCPROPSHEETPAGE);
  82. BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE);
  83. int WINAPI PropertySheet(LPCPROPSHEETHEADER);
  84. #ifdef WIN32
  85. #endif
  86. //
  87. // callback for property sheet extensions to call to add pages
  88. //
  89. typedef BOOL (CALLBACK FAR * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM);
  90. //
  91. // generic routine for prop sheet extensions to export. this is called
  92. // to have the extension add pages. specific versions of this will be
  93. // implemented when necessary.
  94. //
  95. typedef BOOL (CALLBACK FAR * LPFNADDPROPSHEETPAGES)(LPVOID, LPFNADDPROPSHEETPAGE, LPARAM);
  96. #define PSN_FIRST (0U-200U)
  97. #define PSN_LAST (0U-299U)
  98. // PropertySheet notification codes sent to the page. NOTE: RESULTS
  99. // MUST BE RETURNED BY USING SetWindowLong(hdlg, DWL_MSGRESULT, result)
  100. // page is being activated. initialize the data on the page here if other pages can
  101. // effect this page, otherwise init the page at WM_INITDIALOG time. return value is
  102. // ignored.
  103. #define PSN_SETACTIVE (PSN_FIRST-0)
  104. // indicates the current page is being switched away from. validate input
  105. // at this time and return TRUE to keep the page switch from happening.
  106. // to commit changes on page switches commit data after validating on this message.
  107. #define PSN_KILLACTIVE (PSN_FIRST-1)
  108. // #define PSN_VALIDATE (PSN_FIRST-1)
  109. // indicates that the OK or Apply Now buttons have been pressed (OK will
  110. // destroy the dialog when done)
  111. // return FALSE to force the page to be destroyed and recreated.
  112. #define PSN_APPLY (PSN_FIRST-2)
  113. // indicates that the cancel button has been pressed, the page may want use this
  114. // as an oportunity to confirm canceling the dialog.
  115. #define PSN_RESET (PSN_FIRST-3)
  116. // #define PSN_CANCEL (PSN_FIRST-3)
  117. // sent to page to see if the help button should be enabled, the page
  118. // should return TRUE or FALSE
  119. #define PSN_HASHELP (PSN_FIRST-4)
  120. // sent to page indicating that the help button has been pressed
  121. #define PSN_HELP (PSN_FIRST-5)
  122. //// MESSAGES sent to the main property sheet dialog
  123. // used to set the current selection
  124. // supply either the hpage or the index to the tab
  125. #define PSM_SETCURSEL (WM_USER + 101)
  126. #define PropSheet_SetCurSel(hDlg, hpage, index) \
  127. SendMessage(hDlg, PSM_SETCURSEL, (WPARAM)index, (LPARAM)hpage)
  128. // NOT IMPLEMENTED
  129. // remove a page
  130. // wParam = index of page to remove
  131. // lParam = hwnd of page to remove
  132. // NOT IMPLEMENTED
  133. #define PSM_REMOVEPAGE (WM_USER + 102)
  134. #define PropSheet_RemovePage(hDlg, index, hpage) \
  135. SendMessage(hDlg, PSM_REMOVEPAGE, index, (LPARAM)hpage)
  136. // NOT IMPLEMENTED
  137. // add a page
  138. // lParam = hPage of page to remove
  139. // NOT IMPLEMENTED
  140. #define PSM_ADDPAGE (WM_USER + 103)
  141. #define PropSheet_AddPage(hDlg, hpage) \
  142. SendMessage(hDlg, PSM_ADDPAGE, 0, (LPARAM)hpage)
  143. // tell the PS manager that that the page has changed and "Apply Now" should be enabled
  144. // (we may mark the visually tab so the user knows that a change has been made)
  145. #define PSM_CHANGED (WM_USER + 104)
  146. #define PropSheet_Changed(hDlg, hwnd) \
  147. SendMessage(hDlg, PSM_CHANGED, (WPARAM)hwnd, 0L)
  148. // tell the PS manager that we need to restart windows due to a change made so
  149. // the restart windows dialog will be presented when dismissing the dialog
  150. #define PSM_RESTARTWINDOWS (WM_USER + 105)
  151. #define PropSheet_RestartWindows(hDlg) \
  152. SendMessage(hDlg, PSM_RESTARTWINDOWS, 0, 0L)
  153. // tell the PS manager that we need to reboot due to a change made so
  154. // the reboot windows dialog will be presented when dismissing the dialog
  155. #define PSM_REBOOTSYSTEM (WM_USER + 106)
  156. #define PropSheet_RebootSystem(hDlg) \
  157. SendMessage(hDlg, PSM_REBOOTSYSTEM, 0, 0L)
  158. // change the OK button to Close and disable cancel. this indicates a non cancelable
  159. // change has been made
  160. #define PSM_CANCELTOCLOSE (WM_USER + 107)
  161. #define PropSheet_CancelToClose(hDlg) \
  162. SendMessage(hDlg, PSM_CANCELTOCLOSE, 0, 0L)
  163. // have the PS manager forward this query to each initialized tab's hwnd
  164. // until a non-zero value is returned. This value is returned to the caller.
  165. #define PSM_QUERYSIBLINGS (WM_USER + 108)
  166. #define PropSheet_QuerySiblings(hDlg, wParam, lParam) \
  167. SendMessage(hDlg, PSM_QUERYSIBLINGS, wParam, lParam)
  168. // tell the PS manager the opposite of PSM_CHANGED -- that the page has reverted
  169. // to its previously saved state. If no pages remain changed, "Apply Now"
  170. // will be disabled. (we may remove the visually marked tab so that the user
  171. // knows no change has been made)
  172. #define PSM_UNCHANGED (WM_USER + 109)
  173. #define PropSheet_UnChanged(hDlg, hwnd) \
  174. SendMessage(hDlg, PSM_UNCHANGED, (WPARAM)hwnd, 0L)
  175. // tell the PS manager to do an "Apply Now"
  176. #define PSM_APPLY (WM_USER + 110)
  177. #define PropSheet_Apply(hDlg) \
  178. SendMessage(hDlg, PSM_APPLY, 0, 0L)
  179. // iStyle can be PSH_PROPTITLE or PSH_DEFAULT
  180. // lpszText can be a string or an rcid
  181. #define PSM_SETTITLE (WM_USER + 111)
  182. #define PropSheet_SetTitle(hDlg, wStyle, lpszText)\
  183. SendMessage(hDlg, PSM_SETTITLE, wStyle, (LPARAM)(LPCSTR)lpszText)
  184. #define ID_PSRESTARTWINDOWS 0x2
  185. #define ID_PSREBOOTSYSTEM (ID_PSRESTARTWINDOWS | 0x1)
  186. #ifdef __cplusplus
  187. } /* end of 'extern "C" {' */
  188. #endif
  189. #endif // _PRSHT_H_