xref: /reactos/sdk/include/psdk/prsht.h (revision cd3c1e94)
1 #ifndef _PRSHT_H
2 #define _PRSHT_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #ifdef _MSC_VER
9 #pragma warning(push)
10 #pragma warning(disable:4201)
11 #endif
12 
13 #ifndef SNDMSG
14 #ifdef __cplusplus
15 #define SNDMSG ::SendMessage
16 #else
17 #define SNDMSG SendMessage
18 #endif
19 #endif /* ifndef SNDMSG */
20 
21 #define MAXPROPPAGES	100
22 #define PSP_DEFAULT	0
23 #define PSP_DLGINDIRECT	1
24 #define PSP_USEHICON	2
25 #define PSP_USEICONID	4
26 #define PSP_USETITLE	8
27 #define PSP_RTLREADING	16
28 #define PSP_HASHELP	32
29 #define PSP_USEREFPARENT	64
30 #define PSP_USECALLBACK	128
31 #define PSP_PREMATURE	1024
32 #if (_WIN32_IE >= 0x0400)
33 #define PSP_HIDEHEADER	2048
34 #define PSP_USEHEADERTITLE	4096
35 #define PSP_USEHEADERSUBTITLE	8192
36 #endif
37 #define PSPCB_RELEASE	1
38 #define PSPCB_CREATE	2
39 #define PSH_DEFAULT	0
40 #define PSH_PROPTITLE	1
41 #define PSH_USEHICON	2
42 #define PSH_USEICONID	4
43 #define PSH_PROPSHEETPAGE	8
44 #define PSH_WIZARDHASFINISH	16
45 #define PSH_WIZARD	32
46 #define PSH_USEPSTARTPAGE	64
47 #define PSH_NOAPPLYNOW	128
48 #define PSH_USECALLBACK	256
49 #define PSH_HASHELP	512
50 #define PSH_MODELESS	1024
51 #define PSH_RTLREADING	2048
52 #define PSH_WIZARDCONTEXTHELP	4096
53 #if (_WIN32_IE >= 0x0400)
54 #define PSH_WATERMARK	32768
55 #define PSH_USEHBMWATERMARK	65536
56 #define PSH_USEHPLWATERMARK	131072
57 #define PSH_STRETCHWATERMARK	262144
58 #define PSH_HEADER	524288
59 #define PSH_USEHBMHEADER	1048576
60 #define PSH_USEPAGELANG	2097152
61 #if (_WIN32_IE < 0x0500)
62 #define PSH_WIZARD97	0x00002000
63 #else
64 #define PSH_WIZARD97	0x01000000
65 #endif
66 #ifdef _WINE
67 #define PSH_WIZARD97_OLD 0x00002000
68 #define PSH_WIZARD97_NEW 0x01000000
69 #endif
70 #endif /* _WIN32_IE >= 0x0400 */
71 #if (_WIN32_IE >= 0x0500)
72 #define PSH_WIZARD_LITE	0x400000
73 #define PSH_NOCONTEXTHELP	0x2000000
74 #endif
75 #define PSCB_INITIALIZED	1
76 #define PSCB_PRECREATE	2
77 #if (_WIN32_IE >= 0x560)
78 #define PSCB_BUTTONPRESSED	3
79 #endif /* _WIN32_IE >= 0x560 */
80 #define PSM_GETTABCONTROL	1140
81 #define PSM_GETCURRENTPAGEHWND	1142
82 #if (_WIN32_IE >= 0x0500)
83 #define PSM_GETRESULT	1159
84 #define PropSheet_GetResult(hDlg)	SNDMSG(hDlg, PSM_GETRESULT, 0, 0)
85 
86 #define PSM_HWNDTOINDEX	1153
87 #define PropSheet_HwndToIndex(hDlg, hwnd) \
88         (int)SNDMSG(hDlg, PSM_HWNDTOINDEX, (WPARAM)(hwnd), 0)
89 
90 #define PSM_IDTOINDEX	1157
91 #define PSM_INDEXTOHWND	1154
92 #define PSM_INDEXTOID	1158
93 #define PSM_INDEXTOPAGE	1156
94 #define PSM_INSERTPAGE	1143
95 #endif /* _WIN32_IE >= 0x0500 */
96 #define PSM_ISDIALOGMESSAGE	1141
97 #if (_WIN32_IE >= 0x0500)
98 #define PSM_PAGETOINDEX	1155
99 #endif /* _WIN32_IE >= 0x0500 */
100 #define PSM_PRESSBUTTON	1137
101 #if (_WIN32_IE >= 0x0500)
102 #define PSM_RECALCPAGESIZES	1160
103 #endif /* _WIN32_IE >= 0x0500 */
104 #define PSM_SETCURSELID	1138
105 #define PSM_SETFINISHTEXTW	1145
106 #define PSM_SETFINISHTEXTA	1139
107 #if (_WIN32_IE >= 0x0500)
108 #define PSM_SETHEADERTITLEA	1149
109 #define PSM_SETHEADERTITLEW	1150
110 #define PSM_SETHEADERSUBTITLEA	1151
111 #define PSM_SETHEADERSUBTITLEW	1152
112 #endif
113 
114 #define PSN_FIRST                (0U - 200U)
115 #define PSN_SETACTIVE            (PSN_FIRST - 0)
116 #define PSN_KILLACTIVE           (PSN_FIRST - 1)
117 #define PSN_APPLY                (PSN_FIRST - 2)
118 #define PSN_RESET                (PSN_FIRST - 3)
119 #define PSN_HELP                 (PSN_FIRST - 5)
120 #define PSN_WIZBACK              (PSN_FIRST - 6)
121 #define PSN_WIZNEXT              (PSN_FIRST - 7)
122 #define PSN_WIZFINISH            (PSN_FIRST - 8)
123 #define PSN_QUERYCANCEL          (PSN_FIRST - 9)
124 #define PSN_GETOBJECT            (PSN_FIRST - 10)
125 #define PSN_TRANSLATEACCELERATOR (PSN_FIRST - 12)
126 #define PSN_QUERYINITIALFOCUS    (PSN_FIRST - 13)
127 #define PSN_LAST                 (PSN_FIRST - 99)
128 
129 #define PSNRET_NOERROR	0
130 #define PSNRET_INVALID	1
131 #define PSNRET_INVALID_NOCHANGEPAGE	2
132 #define ID_PSRESTARTWINDOWS	2
133 #define ID_PSREBOOTSYSTEM	3
134 #define WIZ_CXDLG	276
135 #define WIZ_CYDLG	140
136 #define WIZ_CXBMP	80
137 #define WIZ_BODYX	92
138 #define WIZ_BODYCX	184
139 #define PROP_SM_CXDLG	212
140 #define PROP_SM_CYDLG	188
141 #define PROP_MED_CXDLG	227
142 #define PROP_MED_CYDLG	215
143 #define PROP_LG_CXDLG	252
144 #define PROP_LG_CYDLG	218
145 #define PSBTN_MAX	6
146 #define PSBTN_BACK	0
147 #define PSBTN_NEXT	1
148 #define PSBTN_FINISH	2
149 #define PSBTN_OK	3
150 #define PSBTN_APPLYNOW	4
151 #define PSBTN_CANCEL	5
152 #define PSBTN_HELP	6
153 #define PSWIZB_BACK	1
154 #define PSWIZB_NEXT	2
155 #define PSWIZB_FINISH	4
156 #define PSWIZB_DISABLEDFINISH	8
157 #define PSM_SETWIZBUTTONS	(WM_USER+112)
158 #define PSM_APPLY	(WM_USER+110)
159 #define PSM_UNCHANGED	(WM_USER+109)
160 #define PSM_QUERYSIBLINGS	(WM_USER+108)
161 #define PSM_CANCELTOCLOSE	(WM_USER+107)
162 #define PSM_REBOOTSYSTEM	(WM_USER+106)
163 #define PSM_RESTARTWINDOWS	(WM_USER+105)
164 #define PSM_CHANGED	(WM_USER+104)
165 #define PSM_ADDPAGE	(WM_USER+103)
166 #define PSM_REMOVEPAGE	(WM_USER+102)
167 #define PSM_SETCURSEL	(WM_USER+101)
168 #define PSM_SETTITLEA	(WM_USER+111)
169 #define PSM_SETTITLEW	(WM_USER+120)
170 
171 #define PSPCB_ADDREF 0
172 
173 #ifndef RC_INVOKED
174 
175 #pragma pack(push,8)
176 typedef struct _PROPSHEETPAGEA {
177 	DWORD	dwSize;
178 	DWORD	dwFlags;
179 	HINSTANCE	hInstance;
180 	_ANONYMOUS_UNION union {
181 		LPCSTR	pszTemplate;
182 		LPCDLGTEMPLATE	pResource;
183 	} DUMMYUNIONNAME;
184 	_ANONYMOUS_UNION union {
185 		HICON hIcon;
186 		LPCSTR pszIcon;
187 	} DUMMYUNIONNAME2;
188 	LPCSTR	pszTitle;
189 	DLGPROC	pfnDlgProc;
190 	LPARAM	lParam;
191 	UINT(CALLBACK *pfnCallback)(HWND,UINT,struct _PROPSHEETPAGEA*);
192 	UINT *pcRefParent;
193 #if (_WIN32_IE >= 0x0400)
194 	LPCSTR pszHeaderTitle;
195 	LPCSTR pszHeaderSubTitle;
196 #endif
197 #if (_WIN32_IE >= 0x0501)
198     HANDLE hActCtx;
199 #endif
200 #if (_WIN32_IE >= 0x0600)
201     _ANONYMOUS_UNION union {
202         HBITMAP hbmHeader;
203         LPCSTR pszbmHeader;
204     } DUMMYUNIONNAME3;
205 #endif
206 } PROPSHEETPAGEA,*LPPROPSHEETPAGEA,
207   PROPSHEETPAGEA_LATEST, *LPPROPSHEETPAGEA_LATEST;
208 typedef const PROPSHEETPAGEA *LPCPROPSHEETPAGEA, *LPCPROPSHEETPAGEA_LATEST;
209 #define PROPSHEETPAGEA_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEA, pcRefParent)
210 #define PROPSHEETPAGEA_V2_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEA, pszHeaderSubTitle)
211 #define PROPSHEETPAGEA_V3_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEA, hActCtx)
212 #define PROPSHEETPAGEA_V4_SIZE sizeof(PROPSHEETPAGEA)
213 typedef struct _PROPSHEETPAGEW {
214 	DWORD	dwSize;
215 	DWORD	dwFlags;
216 	HINSTANCE	hInstance;
217 	_ANONYMOUS_UNION union {
218 		LPCWSTR	pszTemplate;
219 		LPCDLGTEMPLATE	pResource;
220 	} DUMMYUNIONNAME;
221 	_ANONYMOUS_UNION union {
222 		HICON hIcon;
223 		LPCWSTR pszIcon;
224 	} DUMMYUNIONNAME2;
225 	LPCWSTR	pszTitle;
226 	DLGPROC	pfnDlgProc;
227 	LPARAM	lParam;
228 	UINT(CALLBACK *pfnCallback)(HWND,UINT,struct _PROPSHEETPAGEW*);
229 	UINT *pcRefParent;
230 #if (_WIN32_IE >= 0x0400)
231 	LPCWSTR pszHeaderTitle;
232 	LPCWSTR pszHeaderSubTitle;
233 #endif
234 #if (_WIN32_IE >= 0x0501)
235     HANDLE hActCtx;
236 #endif
237 #if (_WIN32_IE >= 0x0600)
238     _ANONYMOUS_UNION union {
239         HBITMAP hbmHeader;
240         LPCWSTR pszbmHeader;
241     } DUMMYUNIONNAME3;
242 #endif
243 } PROPSHEETPAGEW,*LPPROPSHEETPAGEW,
244   PROPSHEETPAGEW_LATEST, *LPPROPSHEETPAGEW_LATEST;
245 typedef const PROPSHEETPAGEW *LPCPROPSHEETPAGEW, *LPCPROPSHEETPAGEW_LATEST;
246 #define PROPSHEETPAGEW_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEW, pcRefParent)
247 #define PROPSHEETPAGEW_V2_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEW, pszHeaderSubTitle)
248 #define PROPSHEETPAGEW_V3_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEW, hActCtx)
249 #define PROPSHEETPAGEW_V4_SIZE sizeof(PROPSHEETPAGEW)
250 typedef UINT(CALLBACK *LPFNPSPCALLBACKA)(HWND,UINT,LPPROPSHEETPAGEA);
251 typedef UINT(CALLBACK *LPFNPSPCALLBACKW)(HWND,UINT,LPPROPSHEETPAGEW);
252 typedef int(CALLBACK *PFNPROPSHEETCALLBACK)(HWND,UINT,LPARAM);
253 #ifndef _HPROPSHEETPAGE_DEFINED
254 #define _HPROPSHEETPAGE_DEFINED
255 DECLARE_HANDLE(HPROPSHEETPAGE);
256 #endif /* _HPROPSHEETPAGE_DEFINED */
257 typedef struct _PROPSHEETHEADERA {
258 	DWORD	dwSize;
259 	DWORD	dwFlags;
260 	HWND	hwndParent;
261 	HINSTANCE	hInstance;
262 	_ANONYMOUS_UNION union {
263 		HICON	hIcon;
264 		LPCSTR	pszIcon;
265 	}DUMMYUNIONNAME;
266 	LPCSTR	pszCaption;
267 	UINT	nPages;
268 	_ANONYMOUS_UNION union {
269 		UINT	nStartPage;
270 		LPCSTR	pStartPage;
271 	}DUMMYUNIONNAME2;
272 	_ANONYMOUS_UNION union {
273 		LPCPROPSHEETPAGEA ppsp;
274 		HPROPSHEETPAGE *phpage;
275 	}DUMMYUNIONNAME3;
276 	PFNPROPSHEETCALLBACK pfnCallback;
277 #if (_WIN32_IE >= 0x0400)
278 	_ANONYMOUS_UNION union {
279 		HBITMAP hbmWatermark;
280 		LPCSTR pszbmWatermark;
281 	} DUMMYUNIONNAME4;
282 	HPALETTE hplWatermark;
283 	_ANONYMOUS_UNION union {
284 		HBITMAP hbmHeader;
285 		LPCSTR pszbmHeader;
286 	} DUMMYUNIONNAME5;
287 #endif
288 } PROPSHEETHEADERA,*LPPROPSHEETHEADERA;
289 typedef const PROPSHEETHEADERA *LPCPROPSHEETHEADERA;
290 #define PROPSHEETHEADERA_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETHEADERA, pfnCallback)
291 #define PROPSHEETHEADERA_V2_SIZE sizeof(PROPSHEETHEADERA)
292 typedef struct _PROPSHEETHEADERW {
293 	DWORD	dwSize;
294 	DWORD	dwFlags;
295 	HWND	hwndParent;
296 	HINSTANCE	hInstance;
297 	_ANONYMOUS_UNION union {
298 		HICON	hIcon;
299 		LPCWSTR	pszIcon;
300 	}DUMMYUNIONNAME;
301 	LPCWSTR	pszCaption;
302 	UINT	nPages;
303 	_ANONYMOUS_UNION union {
304 		UINT	nStartPage;
305 		LPCWSTR	pStartPage;
306 	}DUMMYUNIONNAME2;
307 	_ANONYMOUS_UNION union {
308 		LPCPROPSHEETPAGEW ppsp;
309 		HPROPSHEETPAGE *phpage;
310 	}DUMMYUNIONNAME3;
311 	PFNPROPSHEETCALLBACK pfnCallback;
312 #if (_WIN32_IE >= 0x0400)
313 	_ANONYMOUS_UNION union {
314 		HBITMAP hbmWatermark;
315 		LPCWSTR pszbmWatermark;
316 	} DUMMYUNIONNAME4;
317 	HPALETTE hplWatermark;
318 	_ANONYMOUS_UNION union {
319 		HBITMAP hbmHeader;
320 		LPCWSTR pszbmHeader;
321 	} DUMMYUNIONNAME5;
322 #endif
323 } PROPSHEETHEADERW,*LPPROPSHEETHEADERW;
324 typedef const PROPSHEETHEADERW *LPCPROPSHEETHEADERW;
325 #define PROPSHEETHEADERW_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETHEADERW, pfnCallback)
326 #define PROPSHEETHEADERW_V2_SIZE sizeof(PROPSHEETHEADERW)
327 typedef BOOL(CALLBACK *LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE,LPARAM);
328 typedef BOOL(CALLBACK *LPFNADDPROPSHEETPAGES)(LPVOID,LPFNADDPROPSHEETPAGE,LPARAM);
329 typedef struct _PSHNOTIFY {
330 	NMHDR hdr;
331 	LPARAM lParam;
332 } PSHNOTIFY,*LPPSHNOTIFY;
333 
334 #pragma pack(pop)
335 
336 HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA);
337 HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW);
338 BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE);
339 INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA);
340 INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW);
341 #define PropSheet_AddPage(d,p) SendMessage(d,PSM_ADDPAGE,0,(LPARAM)p)
342 #define PropSheet_Apply(d) SendMessage(d,PSM_APPLY,0,0)
343 #define PropSheet_CancelToClose(d) SendMessage(d,PSM_CANCELTOCLOSE,0,0)
344 #define PropSheet_Changed(d,w) SendMessage(d,PSM_CHANGED,(WPARAM)w,0)
345 #define PropSheet_GetCurrentPageHwnd(d) (HWND)SendMessage(d,PSM_GETCURRENTPAGEHWND,0,0)
346 #define PropSheet_GetTabControl(d) (HWND)SendMessage(d,PSM_GETTABCONTROL,0,0)
347 #define PropSheet_IsDialogMessage(d,m) (BOOL)SendMessage(d,PSM_ISDIALOGMESSAGE,0,(LPARAM)m)
348 #define PropSheet_PressButton(d,i) SendMessage(d,PSM_PRESSBUTTON,i,0)
349 #define PropSheet_QuerySiblings(d,w,l) SendMessage(d,PSM_QUERYSIBLINGS,w,l)
350 #define PropSheet_RebootSystem(d) SendMessage(d,PSM_REBOOTSYSTEM,0,0)
351 #define PropSheet_RemovePage(d,i,p) SendMessage(d,PSM_REMOVEPAGE,i,(LPARAM)p)
352 #define PropSheet_RestartWindows(d) SendMessage(d,PSM_RESTARTWINDOWS,0,0)
353 #define PropSheet_SetCurSel(d,p,i) SendMessage(d,PSM_SETCURSEL,i,(LPARAM)p)
354 #define PropSheet_SetCurSelByID(d,i) SendMessage(d,PSM_SETCURSELID,0,i)
355 #define PropSheet_SetFinishText(d,s) SendMessage(d,PSM_SETFINISHTEXT,0,(LPARAM)s)
356 #define PropSheet_SetTitle(d,w,s) SendMessage(d,PSM_SETTITLE,w,(LPARAM)s)
357 #define PropSheet_SetWizButtons(d,f) PostMessage(d,PSM_SETWIZBUTTONS,0,(LPARAM)f)
358 #define PropSheet_UnChanged(d,w) SendMessage(d,PSM_UNCHANGED,(WPARAM)w,0)
359 #define PropSheet_RecalcPageSizes(d) SendMessage(d,PSM_RECALCPAGESIZES,0,0)
360 #endif
361 
362 #define WC_PROPSHEETA      "SysPropertySheet"
363 #if defined(__GNUC__)
364 # define WC_PROPSHEETW (const WCHAR []){ 'S','y','s', \
365   'P','r','o','p','e','r','t','y','S','h','e','e','t',0 }
366 #elif defined(_MSC_VER)
367 # define WC_PROPSHEETW     L"SysPropertySheet"
368 #else
369 static const WCHAR WC_PROPSHEETW[] = { 'S','y','s',
370   'P','r','o','p','e','r','t','y','S','h','e','e','t',0 };
371 #endif
372 
373 #ifdef UNICODE
374 #define LPFNPSPCALLBACK	LPFNPSPCALLBACKW
375 #define PROPSHEETPAGE	PROPSHEETPAGEW
376 #define LPPROPSHEETPAGE	LPPROPSHEETPAGEW
377 #define LPCPROPSHEETPAGE	LPCPROPSHEETPAGEW
378 #define PROPSHEETHEADER	PROPSHEETHEADERW
379 #define LPPROPSHEETHEADER	LPPROPSHEETHEADERW
380 #define LPCPROPSHEETHEADER	LPCPROPSHEETHEADERW
381 #define PSM_SETTITLE PSM_SETTITLEW
382 #define PSM_SETFINISHTEXT PSM_SETFINISHTEXTW
383 #define PSM_SETHEADERTITLE PSM_SETHEADERTITLEW
384 #define PSM_SETHEADERSUBTITLE PSM_SETHEADERSUBTITLEW
385 #define CreatePropertySheetPage CreatePropertySheetPageW
386 #define PropertySheet PropertySheetW
387 #else
388 #define LPFNPSPCALLBACK	LPFNPSPCALLBACKA
389 #define PROPSHEETPAGE	PROPSHEETPAGEA
390 #define LPPROPSHEETPAGE	LPPROPSHEETPAGEA
391 #define LPCPROPSHEETPAGE	LPCPROPSHEETPAGEA
392 #define PROPSHEETHEADER	PROPSHEETHEADERA
393 #define LPPROPSHEETHEADER	LPPROPSHEETHEADERA
394 #define LPCPROPSHEETHEADER	LPCPROPSHEETHEADERA
395 #define PSM_SETTITLE PSM_SETTITLEA
396 #define PSM_SETFINISHTEXT PSM_SETFINISHTEXTA
397 #define PSM_SETHEADERTITLE PSM_SETHEADERTITLEA
398 #define PSM_SETHEADERSUBTITLE PSM_SETHEADERSUBTITLEA
399 #define CreatePropertySheetPage CreatePropertySheetPageA
400 #define PropertySheet PropertySheetA
401 #endif
402 
403 #ifdef _MSC_VER
404 #pragma warning(pop)
405 #endif
406 
407 #ifdef __cplusplus
408 }
409 #endif
410 #endif
411