prsht.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. /*
  2. * Copyright (C) the Wine project
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef __WINE_PRSHT_H
  19. #define __WINE_PRSHT_H
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /*
  24. * Property sheet support (callback procs)
  25. */
  26. #define WC_PROPSHEETA "SysPropertySheet"
  27. #if defined(__GNUC__)
  28. # define WC_PROPSHEETW (const WCHAR []){ 'S','y','s', \
  29. 'P','r','o','p','e','r','t','y','S','h','e','e','t',0 }
  30. #elif defined(_MSC_VER)
  31. # define WC_PROPSHEETW L"SysPropertySheet"
  32. #else
  33. static const WCHAR WC_PROPSHEETW[] = { 'S','y','s',
  34. 'P','r','o','p','e','r','t','y','S','h','e','e','t',0 };
  35. #endif
  36. #define WC_PROPSHEET WINELIB_NAME_AW(WC_PROPSHEET)
  37. struct _PROPSHEETPAGEA; /** need to forward declare those structs **/
  38. struct _PROPSHEETPAGEW;
  39. struct _PSP;
  40. typedef struct _PSP *HPROPSHEETPAGE;
  41. typedef UINT (CALLBACK *LPFNPSPCALLBACKA)(HWND, UINT, struct _PROPSHEETPAGEA*);
  42. typedef UINT (CALLBACK *LPFNPSPCALLBACKW)(HWND, UINT, struct _PROPSHEETPAGEW*);
  43. typedef INT (CALLBACK *PFNPROPSHEETCALLBACK)(HWND, UINT, LPARAM);
  44. typedef BOOL (CALLBACK *LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM);
  45. typedef BOOL (CALLBACK *LPFNADDPROPSHEETPAGES)(LPVOID, LPFNADDPROPSHEETPAGE, LPARAM);
  46. /*
  47. * Property sheet support (structures)
  48. */
  49. typedef struct _PROPSHEETPAGEA
  50. {
  51. DWORD dwSize;
  52. DWORD dwFlags;
  53. HINSTANCE hInstance;
  54. union
  55. {
  56. LPCSTR pszTemplate;
  57. LPCDLGTEMPLATEA pResource;
  58. }DUMMYUNIONNAME;
  59. union
  60. {
  61. HICON hIcon;
  62. LPCSTR pszIcon;
  63. }DUMMYUNIONNAME2;
  64. LPCSTR pszTitle;
  65. DLGPROC pfnDlgProc;
  66. LPARAM lParam;
  67. LPFNPSPCALLBACKA pfnCallback;
  68. UINT* pcRefParent;
  69. LPCSTR pszHeaderTitle;
  70. LPCSTR pszHeaderSubTitle;
  71. } PROPSHEETPAGEA, *LPPROPSHEETPAGEA;
  72. typedef const PROPSHEETPAGEA *LPCPROPSHEETPAGEA;
  73. typedef struct _PROPSHEETPAGEW
  74. {
  75. DWORD dwSize;
  76. DWORD dwFlags;
  77. HINSTANCE hInstance;
  78. union
  79. {
  80. LPCWSTR pszTemplate;
  81. LPCDLGTEMPLATEW pResource;
  82. }DUMMYUNIONNAME;
  83. union
  84. {
  85. HICON hIcon;
  86. LPCWSTR pszIcon;
  87. }DUMMYUNIONNAME2;
  88. LPCWSTR pszTitle;
  89. DLGPROC pfnDlgProc;
  90. LPARAM lParam;
  91. LPFNPSPCALLBACKW pfnCallback;
  92. UINT* pcRefParent;
  93. LPCWSTR pszHeaderTitle;
  94. LPCWSTR pszHeaderSubTitle;
  95. } PROPSHEETPAGEW, *LPPROPSHEETPAGEW;
  96. typedef const PROPSHEETPAGEW *LPCPROPSHEETPAGEW;
  97. typedef struct _PROPSHEETHEADERA
  98. {
  99. DWORD dwSize;
  100. DWORD dwFlags;
  101. HWND hwndParent;
  102. HINSTANCE hInstance;
  103. union
  104. {
  105. HICON hIcon;
  106. LPCSTR pszIcon;
  107. }DUMMYUNIONNAME;
  108. LPCSTR pszCaption;
  109. UINT nPages;
  110. union
  111. {
  112. UINT nStartPage;
  113. LPCSTR pStartPage;
  114. }DUMMYUNIONNAME2;
  115. union
  116. {
  117. LPCPROPSHEETPAGEA ppsp;
  118. HPROPSHEETPAGE* phpage;
  119. }DUMMYUNIONNAME3;
  120. PFNPROPSHEETCALLBACK pfnCallback;
  121. union
  122. {
  123. HBITMAP hbmWatermark;
  124. LPCSTR pszbmWatermark;
  125. }DUMMYUNIONNAME4;
  126. HPALETTE hplWatermark;
  127. union
  128. {
  129. HBITMAP hbmHeader;
  130. LPCSTR pszbmHeader;
  131. }DUMMYUNIONNAME5;
  132. } PROPSHEETHEADERA, *LPPROPSHEETHEADERA;
  133. typedef const PROPSHEETHEADERA *LPCPROPSHEETHEADERA;
  134. typedef struct _PROPSHEETHEADERW
  135. {
  136. DWORD dwSize;
  137. DWORD dwFlags;
  138. HWND hwndParent;
  139. HINSTANCE hInstance;
  140. union
  141. {
  142. HICON hIcon;
  143. LPCWSTR pszIcon;
  144. }DUMMYUNIONNAME;
  145. LPCWSTR pszCaption;
  146. UINT nPages;
  147. union
  148. {
  149. UINT nStartPage;
  150. LPCWSTR pStartPage;
  151. }DUMMYUNIONNAME2;
  152. union
  153. {
  154. LPCPROPSHEETPAGEW ppsp;
  155. HPROPSHEETPAGE* phpage;
  156. }DUMMYUNIONNAME3;
  157. PFNPROPSHEETCALLBACK pfnCallback;
  158. union
  159. {
  160. HBITMAP hbmWatermark;
  161. LPCWSTR pszbmWatermark;
  162. }DUMMYUNIONNAME4;
  163. HPALETTE hplWatermark;
  164. union
  165. {
  166. HBITMAP hbmHeader;
  167. LPCWSTR pszbmHeader;
  168. }DUMMYUNIONNAME5;
  169. } PROPSHEETHEADERW, *LPPROPSHEETHEADERW;
  170. typedef const PROPSHEETHEADERW *LPCPROPSHEETHEADERW;
  171. /*
  172. * Property sheet support (methods)
  173. */
  174. INT WINAPI PropertySheetA(LPCPROPSHEETHEADERA);
  175. INT WINAPI PropertySheetW(LPCPROPSHEETHEADERW);
  176. #define PropertySheet WINELIB_NAME_AW(PropertySheet)
  177. HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA);
  178. HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW);
  179. #define CreatePropertySheetPage WINELIB_NAME_AW(CreatePropertySheetPage)
  180. BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage);
  181. /*
  182. * Property sheet support (UNICODE-Winelib)
  183. */
  184. DECL_WINELIB_TYPE_AW(PROPSHEETPAGE)
  185. DECL_WINELIB_TYPE_AW(LPPROPSHEETPAGE)
  186. DECL_WINELIB_TYPE_AW(LPCPROPSHEETPAGE)
  187. DECL_WINELIB_TYPE_AW(PROPSHEETHEADER)
  188. DECL_WINELIB_TYPE_AW(LPPROPSHEETHEADER)
  189. DECL_WINELIB_TYPE_AW(LPCPROPSHEETHEADER)
  190. DECL_WINELIB_TYPE_AW(LPFNPSPCALLBACK)
  191. /*
  192. * Property sheet support (defines)
  193. */
  194. #define PSP_DEFAULT 0x0000
  195. #define PSP_DLGINDIRECT 0x0001
  196. #define PSP_USEHICON 0x0002
  197. #define PSP_USEICONID 0x0004
  198. #define PSP_USETITLE 0x0008
  199. #define PSP_RTLREADING 0x0010
  200. #define PSP_HASHELP 0x0020
  201. #define PSP_USEREFPARENT 0x0040
  202. #define PSP_USECALLBACK 0x0080
  203. #define PSP_PREMATURE 0x0400
  204. #define PSP_HIDEHEADER 0x00000800
  205. #define PSP_USEHEADERTITLE 0x00001000
  206. #define PSP_USEHEADERSUBTITLE 0x00002000
  207. #define PSPCB_RELEASE 1
  208. #define PSPCB_CREATE 2
  209. #define PSH_DEFAULT 0x0000
  210. #define PSH_PROPTITLE 0x0001
  211. #define PSH_USEHICON 0x0002
  212. #define PSH_USEICONID 0x0004
  213. #define PSH_PROPSHEETPAGE 0x0008
  214. #define PSH_WIZARDHASFINISH 0x0010
  215. #define PSH_WIZARD 0x0020
  216. #define PSH_USEPSTARTPAGE 0x0040
  217. #define PSH_NOAPPLYNOW 0x0080
  218. #define PSH_USECALLBACK 0x0100
  219. #define PSH_HASHELP 0x0200
  220. #define PSH_MODELESS 0x0400
  221. #define PSH_RTLREADING 0x0800
  222. #define PSH_WIZARDCONTEXTHELP 0x00001000
  223. #define PSH_WIZARD97_OLD 0x00002000 /* for IE < 5 */
  224. #define PSH_WATERMARK 0x00008000
  225. #define PSH_USEHBMWATERMARK 0x00010000
  226. #define PSH_USEHPLWATERMARK 0x00020000
  227. #define PSH_STRETCHWATERMARK 0x00040000
  228. #define PSH_HEADER 0x00080000
  229. #define PSH_USEHBMHEADER 0x00100000
  230. #define PSH_USEPAGELANG 0x00200000
  231. #define PSH_WIZARD_LITE 0x00400000
  232. #define PSH_WIZARD97_NEW 0x01000000 /* for IE >= 5 */
  233. #define PSH_NOCONTEXTHELP 0x02000000
  234. #ifndef __WINESRC__
  235. # if _WIN32_IE < 0x0500
  236. # define PSH_WIZARD97 PSH_WIZARD97_OLD
  237. # else
  238. # define PSH_WIZARD97 PSH_WIZARD97_NEW
  239. # endif
  240. #endif
  241. #define PSCB_INITIALIZED 1
  242. #define PSCB_PRECREATE 2
  243. typedef struct _PSHNOTIFY
  244. {
  245. NMHDR hdr;
  246. LPARAM lParam;
  247. } PSHNOTIFY, *LPPSHNOTIFY;
  248. #define PSN_FIRST (0U-200U)
  249. #define PSN_LAST (0U-299U)
  250. #define PSN_SETACTIVE (PSN_FIRST-0)
  251. #define PSN_KILLACTIVE (PSN_FIRST-1)
  252. /* #define PSN_VALIDATE (PSN_FIRST-1) */
  253. #define PSN_APPLY (PSN_FIRST-2)
  254. #define PSN_RESET (PSN_FIRST-3)
  255. /* #define PSN_CANCEL (PSN_FIRST-3) */
  256. #define PSN_HELP (PSN_FIRST-5)
  257. #define PSN_WIZBACK (PSN_FIRST-6)
  258. #define PSN_WIZNEXT (PSN_FIRST-7)
  259. #define PSN_WIZFINISH (PSN_FIRST-8)
  260. #define PSN_QUERYCANCEL (PSN_FIRST-9)
  261. #define PSN_GETOBJECT (PSN_FIRST-10)
  262. #define PSN_TRANSLATEACCELERATOR (PSN_FIRST-12)
  263. #define PSN_QUERYINITIALFOCUS (PSN_FIRST-13)
  264. #define PSNRET_NOERROR 0
  265. #define PSNRET_INVALID 1
  266. #define PSNRET_INVALID_NOCHANGEPAGE 2
  267. #define PSM_SETCURSEL (WM_USER + 101)
  268. #define PSM_REMOVEPAGE (WM_USER + 102)
  269. #define PSM_ADDPAGE (WM_USER + 103)
  270. #define PSM_CHANGED (WM_USER + 104)
  271. #define PSM_RESTARTWINDOWS (WM_USER + 105)
  272. #define PSM_REBOOTSYSTEM (WM_USER + 106)
  273. #define PSM_CANCELTOCLOSE (WM_USER + 107)
  274. #define PSM_QUERYSIBLINGS (WM_USER + 108)
  275. #define PSM_UNCHANGED (WM_USER + 109)
  276. #define PSM_APPLY (WM_USER + 110)
  277. #define PSM_SETTITLEA (WM_USER + 111)
  278. #define PSM_SETTITLEW (WM_USER + 120)
  279. #define PSM_SETTITLE WINELIB_NAME_AW(PSM_SETTITLE)
  280. #define PSM_SETWIZBUTTONS (WM_USER + 112)
  281. #define PSM_PRESSBUTTON (WM_USER + 113)
  282. #define PSM_SETCURSELID (WM_USER + 114)
  283. #define PSM_SETFINISHTEXTA (WM_USER + 115)
  284. #define PSM_SETFINISHTEXTW (WM_USER + 121)
  285. #define PSM_SETFINISHTEXT WINELIB_NAME_AW(PSM_SETFINISHTEXT)
  286. #define PSM_GETTABCONTROL (WM_USER + 116)
  287. #define PSM_ISDIALOGMESSAGE (WM_USER + 117)
  288. #define PSM_GETCURRENTPAGEHWND (WM_USER + 118)
  289. #define PSM_INSERTPAGE (WM_USER + 119)
  290. #define PSM_SETHEADERTITLEA (WM_USER + 125)
  291. #define PSM_SETHEADERTITLEW (WM_USER + 126)
  292. #define PSM_SETHEADERTITLE WINELIB_NAME_AW(PSM_SETHEADERTITLE)
  293. #define PSM_SETHEADERSUBTITLEA (WM_USER + 127)
  294. #define PSM_SETHEADERSUBTITLEW (WM_USER + 128)
  295. #define PSM_SETHEADERSUBTITLE WINELIB_NAME_AW(PSM_SETHEADERSUBTITLE)
  296. #define PSM_HWNDTOINDEX (WM_USER + 129)
  297. #define PSM_INDEXTOHWND (WM_USER + 130)
  298. #define PSM_PAGETOINDEX (WM_USER + 131)
  299. #define PSM_INDEXTOPAGE (WM_USER + 132)
  300. #define PSM_IDTOINDEX (WM_USER + 133)
  301. #define PSM_INDEXTOID (WM_USER + 134)
  302. #define PSM_GETRESULT (WM_USER + 135)
  303. #define PSM_RECALCPAGESIZES (WM_USER + 136)
  304. #define PSWIZB_BACK 0x00000001
  305. #define PSWIZB_NEXT 0x00000002
  306. #define PSWIZB_FINISH 0x00000004
  307. #define PSWIZB_DISABLEDFINISH 0x00000008
  308. #define PSBTN_BACK 0
  309. #define PSBTN_NEXT 1
  310. #define PSBTN_FINISH 2
  311. #define PSBTN_OK 3
  312. #define PSBTN_APPLYNOW 4
  313. #define PSBTN_CANCEL 5
  314. #define PSBTN_HELP 6
  315. #define PSBTN_MAX 6
  316. #define ID_PSRESTARTWINDOWS 0x2
  317. #define ID_PSREBOOTSYSTEM (ID_PSRESTARTWINDOWS | 0x1)
  318. #define WIZ_CXDLG 276
  319. #define WIZ_CYDLG 140
  320. #define WIZ_CXBMP 80
  321. #define WIZ_BODYX 92
  322. #define WIZ_BODYCX 184
  323. #define PROP_SM_CXDLG 212
  324. #define PROP_SM_CYDLG 188
  325. #define PROP_MED_CXDLG 227
  326. #define PROP_MED_CYDLG 215
  327. #define PROP_LG_CXDLG 252
  328. #define PROP_LG_CYDLG 218
  329. /*
  330. * Property sheet support (macros)
  331. */
  332. #define PropSheet_SetCurSel(hDlg, hpage, index) \
  333. SendMessageA(hDlg, PSM_SETCURSEL, (WPARAM)index, (LPARAM)hpage)
  334. #define PropSheet_RemovePage(hDlg, index, hpage) \
  335. SNDMSG(hDlg, PSM_REMOVEPAGE, index, (LPARAM)hpage)
  336. #define PropSheet_AddPage(hDlg, hpage) \
  337. SNDMSG(hDlg, PSM_ADDPAGE, 0, (LPARAM)hpage)
  338. #define PropSheet_Changed(hDlg, hwnd) \
  339. SNDMSG(hDlg, PSM_CHANGED, (WPARAM)hwnd, 0L)
  340. #define PropSheet_RestartWindows(hDlg) \
  341. SNDMSG(hDlg, PSM_RESTARTWINDOWS, 0, 0L)
  342. #define PropSheet_RebootSystem(hDlg) \
  343. SNDMSG(hDlg, PSM_REBOOTSYSTEM, 0, 0L)
  344. #define PropSheet_CancelToClose(hDlg) \
  345. PostMessage(hDlg, PSM_CANCELTOCLOSE, 0, 0L)
  346. #define PropSheet_QuerySiblings(hDlg, wParam, lParam) \
  347. SNDMSG(hDlg, PSM_QUERYSIBLINGS, wParam, lParam)
  348. #define PropSheet_UnChanged(hDlg, hwnd) \
  349. SNDMSG(hDlg, PSM_UNCHANGED, (WPARAM)hwnd, 0L)
  350. #define PropSheet_Apply(hDlg) \
  351. SNDMSG(hDlg, PSM_APPLY, 0, 0L)
  352. #define PropSheet_SetTitle(hDlg, wStyle, lpszText)\
  353. SNDMSG(hDlg, PSM_SETTITLE, wStyle, (LPARAM)(LPCTSTR)lpszText)
  354. #define PropSheet_SetWizButtons(hDlg, dwFlags) \
  355. PostMessage(hDlg, PSM_SETWIZBUTTONS, 0, (LPARAM)dwFlags)
  356. #define PropSheet_PressButton(hDlg, iButton) \
  357. PostMessage(hDlg, PSM_PRESSBUTTON, (WPARAM)iButton, 0)
  358. #define PropSheet_SetCurSelByID(hDlg, id) \
  359. SNDMSG(hDlg, PSM_SETCURSELID, 0, (LPARAM)id)
  360. #define PropSheet_SetFinishText(hDlg, lpszText) \
  361. SNDMSG(hDlg, PSM_SETFINISHTEXT, 0, (LPARAM)lpszText)
  362. #define PropSheet_GetTabControl(hDlg) \
  363. (HWND)SNDMSG(hDlg, PSM_GETTABCONTROL, 0, 0)
  364. #define PropSheet_IsDialogMessage(hDlg, pMsg) \
  365. (BOOL)SNDMSG(hDlg, PSM_ISDIALOGMESSAGE, 0, (LPARAM)pMsg)
  366. #define PropSheet_GetCurrentPageHwnd(hDlg) \
  367. (HWND)SNDMSG(hDlg, PSM_GETCURRENTPAGEHWND, 0, 0L)
  368. #define PropSheet_InsertPage(hDlg, index, hpage) \
  369. SNDMSG(hDlg, PSM_INSERTPAGE, (WPARAM)(index), (LPARAM)(hpage))
  370. #define PropSheet_SetHeaderTitle(hDlg, index, lpszText) \
  371. SNDMSG(hDlg, PSM_SETHEADERTITLE, (WPARAM)(index), (LPARAM)(lpszText))
  372. #define PropSheet_SetHeaderSubTitle(hDlg, index, lpszText) \
  373. SNDMSG(hDlg, PSM_SETHEADERSUBTITLE, (WPARAM)(index), (LPARAM)(lpszText))
  374. #define PropSheet_HwndToIndex(hDlg, hwnd) \
  375. (int)SNDMSG(hDlg, PSM_HWNDTOINDEX, (WPARAM)(hwnd), 0)
  376. #define PropSheet_IndexToHwnd(hDlg, i) \
  377. (HWND)SNDMSG(hDlg, PSM_INDEXTOHWND, (WPARAM)(i), 0)
  378. #define PropSheet_PageToIndex(hDlg, hpage) \
  379. (int)SNDMSG(hDlg, PSM_PAGETOINDEX, 0, (LPARAM)(hpage))
  380. #define PropSheet_IndexToPage(hDlg, i) \
  381. (HPROPSHEETPAGE)SNDMSG(hDlg, PSM_INDEXTOPAGE, (WPARAM)(i), 0)
  382. #define PropSheet_IdToIndex(hDlg, id) \
  383. (int)SNDMSG(hDlg, PSM_IDTOINDEX, 0, (LPARAM)(id))
  384. #define PropSheet_IndexToId(hDlg, i) \
  385. SNDMSG(hDlg, PSM_INDEXTOID, (WPARAM)(i), 0)
  386. #define PropSheet_GetResult(hDlg) \
  387. SNDMSG(hDlg, PSM_GETRESULT, 0, 0)
  388. #define PropSheet_RecalcPageSizes(hDlg) \
  389. SNDMSG(hDlg, PSM_RECALCPAGESIZES, 0, 0)
  390. #ifdef __cplusplus
  391. }
  392. #endif
  393. #endif /* __WINE_PRSHT_H */