2 * Copyright (C) the Wine project
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.
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.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_PRSHT_H
20 #define __WINE_PRSHT_H
28 * Property sheet support (callback procs)
32 #define WC_PROPSHEETA "SysPropertySheet"
34 # define WC_PROPSHEETW (const WCHAR []){ 'S','y','s', \
35 'P','r','o','p','e','r','t','y','S','h','e','e','t',0 }
36 #elif defined(_MSC_VER)
37 # define WC_PROPSHEETW L"SysPropertySheet"
39 static const WCHAR WC_PROPSHEETW
[] = { 'S','y','s',
40 'P','r','o','p','e','r','t','y','S','h','e','e','t',0 };
42 #define WC_PROPSHEET WINELIB_NAME_AW(WC_PROPSHEET)
44 struct _PROPSHEETPAGEA
; /** need to forward declare those structs **/
45 struct _PROPSHEETPAGEW
;
47 #ifndef _HPROPSHEETPAGE_DEFINED
48 #define _HPROPSHEETPAGE_DEFINED
49 typedef struct _PSP
*HPROPSHEETPAGE
;
50 #endif /* _HPROPSHEETPAGE_DEFINED */
53 typedef UINT (CALLBACK
*LPFNPSPCALLBACKA
)(HWND
, UINT
, struct _PROPSHEETPAGEA
*);
54 typedef UINT (CALLBACK
*LPFNPSPCALLBACKW
)(HWND
, UINT
, struct _PROPSHEETPAGEW
*);
55 typedef INT (CALLBACK
*PFNPROPSHEETCALLBACK
)(HWND
, UINT
, LPARAM
);
56 typedef BOOL (CALLBACK
*LPFNADDPROPSHEETPAGE
)(HPROPSHEETPAGE
, LPARAM
);
57 typedef BOOL (CALLBACK
*LPFNADDPROPSHEETPAGES
)(LPVOID
, LPFNADDPROPSHEETPAGE
, LPARAM
);
60 * Property sheet support (structures)
63 typedef LPCDLGTEMPLATEA PROPSHEETPAGE_RESOURCEA
;
64 typedef LPCDLGTEMPLATEW PROPSHEETPAGE_RESOURCEW
;
65 DECL_WINELIB_TYPE_AW(PROPSHEETPAGE_RESOURCE
)
67 typedef struct _PROPSHEETPAGEA
75 PROPSHEETPAGE_RESOURCEA pResource
;
85 LPFNPSPCALLBACKA pfnCallback
;
87 LPCSTR pszHeaderTitle
;
88 LPCSTR pszHeaderSubTitle
;
95 } PROPSHEETPAGEA
, *LPPROPSHEETPAGEA
,
96 PROPSHEETPAGEA_LATEST
, *LPPROPSHEETPAGEA_LATEST
;
98 typedef const PROPSHEETPAGEA
*LPCPROPSHEETPAGEA
, *LPCPROPSHEETPAGEA_LATEST
;
99 #define PROPSHEETPAGEA_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEA, pcRefParent)
100 #define PROPSHEETPAGEA_V2_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEA, pszHeaderSubTitle)
101 #define PROPSHEETPAGEA_V3_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEA, hActCtx)
102 #define PROPSHEETPAGEA_V4_SIZE sizeof(PROPSHEETPAGEA)
104 typedef struct _PROPSHEETPAGEW
112 PROPSHEETPAGE_RESOURCEW pResource
;
122 LPFNPSPCALLBACKW pfnCallback
;
124 LPCWSTR pszHeaderTitle
;
125 LPCWSTR pszHeaderSubTitle
;
132 } PROPSHEETPAGEW
, *LPPROPSHEETPAGEW
,
133 PROPSHEETPAGEW_LATEST
, *LPPROPSHEETPAGEW_LATEST
;
135 typedef const PROPSHEETPAGEW
*LPCPROPSHEETPAGEW
, *LPCPROPSHEETPAGEW_LATEST
;
136 #define PROPSHEETPAGEW_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEW, pcRefParent)
137 #define PROPSHEETPAGEW_V2_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEW, pszHeaderSubTitle)
138 #define PROPSHEETPAGEW_V3_SIZE CCSIZEOF_STRUCT(PROPSHEETPAGEW, hActCtx)
139 #define PROPSHEETPAGEW_V4_SIZE sizeof(PROPSHEETPAGEW)
142 typedef struct _PROPSHEETHEADERA
162 LPCPROPSHEETPAGEA ppsp
;
163 HPROPSHEETPAGE
* phpage
;
165 PFNPROPSHEETCALLBACK pfnCallback
;
168 HBITMAP hbmWatermark
;
169 LPCSTR pszbmWatermark
;
171 HPALETTE hplWatermark
;
177 } PROPSHEETHEADERA
, *LPPROPSHEETHEADERA
;
179 typedef const PROPSHEETHEADERA
*LPCPROPSHEETHEADERA
;
180 #define PROPSHEETHEADERA_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETHEADERA, pfnCallback)
181 #define PROPSHEETHEADERA_V2_SIZE sizeof(PROPSHEETHEADERA)
183 typedef struct _PROPSHEETHEADERW
203 LPCPROPSHEETPAGEW ppsp
;
204 HPROPSHEETPAGE
* phpage
;
206 PFNPROPSHEETCALLBACK pfnCallback
;
209 HBITMAP hbmWatermark
;
210 LPCWSTR pszbmWatermark
;
212 HPALETTE hplWatermark
;
218 } PROPSHEETHEADERW
, *LPPROPSHEETHEADERW
;
220 typedef const PROPSHEETHEADERW
*LPCPROPSHEETHEADERW
;
221 #define PROPSHEETHEADERW_V1_SIZE CCSIZEOF_STRUCT(PROPSHEETHEADERW, pfnCallback)
222 #define PROPSHEETHEADERW_V2_SIZE sizeof(PROPSHEETHEADERW)
226 * Property sheet support (methods)
228 INT_PTR WINAPI
PropertySheetA(LPCPROPSHEETHEADERA
);
229 INT_PTR WINAPI
PropertySheetW(LPCPROPSHEETHEADERW
);
230 #define PropertySheet WINELIB_NAME_AW(PropertySheet)
231 HPROPSHEETPAGE WINAPI
CreatePropertySheetPageA(LPCPROPSHEETPAGEA
);
232 HPROPSHEETPAGE WINAPI
CreatePropertySheetPageW(LPCPROPSHEETPAGEW
);
233 #define CreatePropertySheetPage WINELIB_NAME_AW(CreatePropertySheetPage)
234 BOOL WINAPI
DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage
);
237 * Property sheet support (UNICODE-Winelib)
240 DECL_WINELIB_TYPE_AW(PROPSHEETPAGE
)
241 DECL_WINELIB_TYPE_AW(LPPROPSHEETPAGE
)
242 DECL_WINELIB_TYPE_AW(LPCPROPSHEETPAGE
)
243 DECL_WINELIB_TYPE_AW(PROPSHEETHEADER
)
244 DECL_WINELIB_TYPE_AW(LPPROPSHEETHEADER
)
245 DECL_WINELIB_TYPE_AW(LPCPROPSHEETHEADER
)
246 DECL_WINELIB_TYPE_AW(LPFNPSPCALLBACK
)
248 #ifdef WINE_NO_UNICODE_MACROS
249 # define PRSHT_NAME_AW(base, suffix) \
250 base##_##suffix##_must_use_W_or_A_in_this_context \
251 base##_##suffix##_must_use_W_or_A_in_this_context
252 # define DECL_PRSHT_TYPE_AW(base, suffix) /* nothing */
253 #else /* WINE_NO_UNICODE_MACROS */
255 # define PRSHT_NAME_AW(base, suffix) base##W_##suffix
257 # define PRSHT_NAME_AW(base, suffix) base##A_##suffix
259 # define DECL_PRSHT_TYPE_AW(base, suffix) typedef PRSHT_NAME_AW(base, suffix) base##_##suffix;
260 #endif /* WINE_NO_UNICODE_MACROS */
262 DECL_PRSHT_TYPE_AW(PROPSHEETPAGE
, LATEST
)
263 DECL_PRSHT_TYPE_AW(LPPROPSHEETPAGE
, LATEST
)
264 DECL_PRSHT_TYPE_AW(LPCPROPSHEETPAGE
, LATEST
)
265 #define PROPSHEETPAGE_V1_SIZE PRSHT_NAME_AW(PROPSHEETPAGE, V1_SIZE)
266 #define PROPSHEETPAGE_V2_SIZE PRSHT_NAME_AW(PROPSHEETPAGE, V2_SIZE)
267 #define PROPSHEETPAGE_V3_SIZE PRSHT_NAME_AW(PROPSHEETPAGE, V3_SIZE)
268 #define PROPSHEETPAGE_V4_SIZE PRSHT_NAME_AW(PROPSHEETPAGE, V4_SIZE)
269 #define PROPSHEETHEADER_V1_SIZE PRSHT_NAME_AW(PROPSHEETHEADER, V1_SIZE)
270 #define PROPSHEETHEADER_V2_SIZE PRSHT_NAME_AW(PROPSHEETHEADER, V2_SIZE)
273 #undef DECL_PRSHT_TYPE_AW
276 * Property sheet support (defines)
278 #define PSP_DEFAULT 0x0000
279 #define PSP_DLGINDIRECT 0x0001
280 #define PSP_USEHICON 0x0002
281 #define PSP_USEICONID 0x0004
282 #define PSP_USETITLE 0x0008
283 #define PSP_RTLREADING 0x0010
285 #define PSP_HASHELP 0x0020
286 #define PSP_USEREFPARENT 0x0040
287 #define PSP_USECALLBACK 0x0080
288 #define PSP_PREMATURE 0x0400
290 #define PSP_HIDEHEADER 0x00000800
291 #define PSP_USEHEADERTITLE 0x00001000
292 #define PSP_USEHEADERSUBTITLE 0x00002000
293 #define PSP_USEFUSIONCONTEXT 0x00004000
294 #define PSP_COMMANDLINKS 0x00040000
296 #define PSPCB_ADDREF 0
297 #define PSPCB_RELEASE 1
298 #define PSPCB_CREATE 2
300 #define PSH_DEFAULT 0x0000
301 #define PSH_PROPTITLE 0x0001
302 #define PSH_USEHICON 0x0002
303 #define PSH_USEICONID 0x0004
304 #define PSH_PROPSHEETPAGE 0x0008
305 #define PSH_WIZARDHASFINISH 0x0010
306 #define PSH_WIZARD 0x0020
307 #define PSH_USEPSTARTPAGE 0x0040
308 #define PSH_NOAPPLYNOW 0x0080
309 #define PSH_USECALLBACK 0x0100
310 #define PSH_HASHELP 0x0200
311 #define PSH_MODELESS 0x0400
312 #define PSH_RTLREADING 0x0800
313 #define PSH_WIZARDCONTEXTHELP 0x00001000
315 #define PSH_WIZARD97_OLD 0x00002000 /* for IE < 5 */
316 #define PSH_AEROWIZARD 0x00004000
317 #define PSH_WATERMARK 0x00008000
318 #define PSH_USEHBMWATERMARK 0x00010000
319 #define PSH_USEHPLWATERMARK 0x00020000
320 #define PSH_STRETCHWATERMARK 0x00040000
321 #define PSH_HEADER 0x00080000
322 #define PSH_USEHBMHEADER 0x00100000
323 #define PSH_USEPAGELANG 0x00200000
324 #define PSH_WIZARD_LITE 0x00400000
325 #define PSH_WIZARD97_NEW 0x01000000 /* for IE >= 5 */
326 #define PSH_NOCONTEXTHELP 0x02000000
327 #define PSH_RESIZABLE 0x04000000
328 #define PSH_HEADERBITMAP 0x08000000
329 #define PSH_NOMARGIN 0x10000000
331 # if defined(_WIN32_IE) && (_WIN32_IE < 0x0500)
332 # define PSH_WIZARD97 PSH_WIZARD97_OLD
334 # define PSH_WIZARD97 PSH_WIZARD97_NEW
338 #define PSCB_INITIALIZED 1
339 #define PSCB_PRECREATE 2
341 typedef struct _PSHNOTIFY
345 } PSHNOTIFY
, *LPPSHNOTIFY
;
347 #define PSN_FIRST (0U-200U)
348 #define PSN_LAST (0U-299U)
351 #define PSN_SETACTIVE (PSN_FIRST-0)
352 #define PSN_KILLACTIVE (PSN_FIRST-1)
353 /* #define PSN_VALIDATE (PSN_FIRST-1) */
354 #define PSN_APPLY (PSN_FIRST-2)
355 #define PSN_RESET (PSN_FIRST-3)
356 /* #define PSN_CANCEL (PSN_FIRST-3) */
357 #define PSN_HELP (PSN_FIRST-5)
358 #define PSN_WIZBACK (PSN_FIRST-6)
359 #define PSN_WIZNEXT (PSN_FIRST-7)
360 #define PSN_WIZFINISH (PSN_FIRST-8)
361 #define PSN_QUERYCANCEL (PSN_FIRST-9)
362 #define PSN_GETOBJECT (PSN_FIRST-10)
363 #define PSN_TRANSLATEACCELERATOR (PSN_FIRST-12)
364 #define PSN_QUERYINITIALFOCUS (PSN_FIRST-13)
366 #define PSNRET_NOERROR 0
367 #define PSNRET_INVALID 1
368 #define PSNRET_INVALID_NOCHANGEPAGE 2
371 #define PSM_SETCURSEL (WM_USER + 101)
372 #define PSM_REMOVEPAGE (WM_USER + 102)
373 #define PSM_ADDPAGE (WM_USER + 103)
374 #define PSM_CHANGED (WM_USER + 104)
375 #define PSM_RESTARTWINDOWS (WM_USER + 105)
376 #define PSM_REBOOTSYSTEM (WM_USER + 106)
377 #define PSM_CANCELTOCLOSE (WM_USER + 107)
378 #define PSM_QUERYSIBLINGS (WM_USER + 108)
379 #define PSM_UNCHANGED (WM_USER + 109)
380 #define PSM_APPLY (WM_USER + 110)
381 #define PSM_SETTITLEA (WM_USER + 111)
382 #define PSM_SETTITLEW (WM_USER + 120)
383 #define PSM_SETTITLE WINELIB_NAME_AW(PSM_SETTITLE)
384 #define PSM_SETWIZBUTTONS (WM_USER + 112)
385 #define PSM_PRESSBUTTON (WM_USER + 113)
386 #define PSM_SETCURSELID (WM_USER + 114)
387 #define PSM_SETFINISHTEXTA (WM_USER + 115)
388 #define PSM_SETFINISHTEXTW (WM_USER + 121)
389 #define PSM_SETFINISHTEXT WINELIB_NAME_AW(PSM_SETFINISHTEXT)
390 #define PSM_GETTABCONTROL (WM_USER + 116)
391 #define PSM_ISDIALOGMESSAGE (WM_USER + 117)
392 #define PSM_GETCURRENTPAGEHWND (WM_USER + 118)
393 #define PSM_INSERTPAGE (WM_USER + 119)
394 #define PSM_SETHEADERTITLEA (WM_USER + 125)
395 #define PSM_SETHEADERTITLEW (WM_USER + 126)
396 #define PSM_SETHEADERTITLE WINELIB_NAME_AW(PSM_SETHEADERTITLE)
397 #define PSM_SETHEADERSUBTITLEA (WM_USER + 127)
398 #define PSM_SETHEADERSUBTITLEW (WM_USER + 128)
399 #define PSM_SETHEADERSUBTITLE WINELIB_NAME_AW(PSM_SETHEADERSUBTITLE)
400 #define PSM_HWNDTOINDEX (WM_USER + 129)
401 #define PSM_INDEXTOHWND (WM_USER + 130)
402 #define PSM_PAGETOINDEX (WM_USER + 131)
403 #define PSM_INDEXTOPAGE (WM_USER + 132)
404 #define PSM_IDTOINDEX (WM_USER + 133)
405 #define PSM_INDEXTOID (WM_USER + 134)
406 #define PSM_GETRESULT (WM_USER + 135)
407 #define PSM_RECALCPAGESIZES (WM_USER + 136)
409 #define PSWIZB_BACK 0x00000001
410 #define PSWIZB_NEXT 0x00000002
411 #define PSWIZB_FINISH 0x00000004
412 #define PSWIZB_DISABLEDFINISH 0x00000008
416 #define PSBTN_FINISH 2
418 #define PSBTN_APPLYNOW 4
419 #define PSBTN_CANCEL 5
423 #define ID_PSRESTARTWINDOWS 0x2
424 #define ID_PSREBOOTSYSTEM (ID_PSRESTARTWINDOWS | 0x1)
427 #define WIZ_CXDLG 276
428 #define WIZ_CYDLG 140
433 #define WIZ_BODYCX 184
435 #define PROP_SM_CXDLG 212
436 #define PROP_SM_CYDLG 188
438 #define PROP_MED_CXDLG 227
439 #define PROP_MED_CYDLG 215
441 #define PROP_LG_CXDLG 252
442 #define PROP_LG_CYDLG 218
445 * Property sheet support (macros)
448 #define PropSheet_SetCurSel(hDlg, hpage, index) \
449 SendMessageA(hDlg, PSM_SETCURSEL, (WPARAM)index, (LPARAM)hpage)
451 #define PropSheet_RemovePage(hDlg, index, hpage) \
452 SNDMSG(hDlg, PSM_REMOVEPAGE, index, (LPARAM)hpage)
454 #define PropSheet_AddPage(hDlg, hpage) \
455 SNDMSG(hDlg, PSM_ADDPAGE, 0, (LPARAM)hpage)
457 #define PropSheet_Changed(hDlg, hwnd) \
458 SNDMSG(hDlg, PSM_CHANGED, (WPARAM)hwnd, 0)
460 #define PropSheet_RestartWindows(hDlg) \
461 SNDMSG(hDlg, PSM_RESTARTWINDOWS, 0, 0)
463 #define PropSheet_RebootSystem(hDlg) \
464 SNDMSG(hDlg, PSM_REBOOTSYSTEM, 0, 0)
466 #define PropSheet_CancelToClose(hDlg) \
467 PostMessage(hDlg, PSM_CANCELTOCLOSE, 0, 0)
469 #define PropSheet_QuerySiblings(hDlg, wParam, lParam) \
470 SNDMSG(hDlg, PSM_QUERYSIBLINGS, wParam, lParam)
472 #define PropSheet_UnChanged(hDlg, hwnd) \
473 SNDMSG(hDlg, PSM_UNCHANGED, (WPARAM)hwnd, 0)
475 #define PropSheet_Apply(hDlg) \
476 SNDMSG(hDlg, PSM_APPLY, 0, 0)
478 #define PropSheet_SetTitle(hDlg, wStyle, lpszText)\
479 SNDMSG(hDlg, PSM_SETTITLE, wStyle, (LPARAM)(LPCTSTR)lpszText)
481 #define PropSheet_SetWizButtons(hDlg, dwFlags) \
482 PostMessage(hDlg, PSM_SETWIZBUTTONS, 0, (LPARAM)dwFlags)
484 #define PropSheet_PressButton(hDlg, iButton) \
485 PostMessage(hDlg, PSM_PRESSBUTTON, (WPARAM)iButton, 0)
487 #define PropSheet_SetCurSelByID(hDlg, id) \
488 SNDMSG(hDlg, PSM_SETCURSELID, 0, (LPARAM)id)
490 #define PropSheet_SetFinishText(hDlg, lpszText) \
491 SNDMSG(hDlg, PSM_SETFINISHTEXT, 0, (LPARAM)lpszText)
493 #define PropSheet_GetTabControl(hDlg) \
494 (HWND)SNDMSG(hDlg, PSM_GETTABCONTROL, 0, 0)
496 #define PropSheet_IsDialogMessage(hDlg, pMsg) \
497 (BOOL)SNDMSG(hDlg, PSM_ISDIALOGMESSAGE, 0, (LPARAM)pMsg)
499 #define PropSheet_GetCurrentPageHwnd(hDlg) \
500 (HWND)SNDMSG(hDlg, PSM_GETCURRENTPAGEHWND, 0, 0)
502 #define PropSheet_InsertPage(hDlg, index, hpage) \
503 SNDMSG(hDlg, PSM_INSERTPAGE, (WPARAM)(index), (LPARAM)(hpage))
505 #define PropSheet_SetHeaderTitle(hDlg, index, lpszText) \
506 SNDMSG(hDlg, PSM_SETHEADERTITLE, (WPARAM)(index), (LPARAM)(lpszText))
508 #define PropSheet_SetHeaderSubTitle(hDlg, index, lpszText) \
509 SNDMSG(hDlg, PSM_SETHEADERSUBTITLE, (WPARAM)(index), (LPARAM)(lpszText))
511 #define PropSheet_HwndToIndex(hDlg, hwnd) \
512 (int)SNDMSG(hDlg, PSM_HWNDTOINDEX, (WPARAM)(hwnd), 0)
514 #define PropSheet_IndexToHwnd(hDlg, i) \
515 (HWND)SNDMSG(hDlg, PSM_INDEXTOHWND, (WPARAM)(i), 0)
517 #define PropSheet_PageToIndex(hDlg, hpage) \
518 (int)SNDMSG(hDlg, PSM_PAGETOINDEX, 0, (LPARAM)(hpage))
520 #define PropSheet_IndexToPage(hDlg, i) \
521 (HPROPSHEETPAGE)SNDMSG(hDlg, PSM_INDEXTOPAGE, (WPARAM)(i), 0)
523 #define PropSheet_IdToIndex(hDlg, id) \
524 (int)SNDMSG(hDlg, PSM_IDTOINDEX, 0, (LPARAM)(id))
526 #define PropSheet_IndexToId(hDlg, i) \
527 SNDMSG(hDlg, PSM_INDEXTOID, (WPARAM)(i), 0)
529 #define PropSheet_GetResult(hDlg) \
530 SNDMSG(hDlg, PSM_GETRESULT, 0, 0)
532 #define PropSheet_RecalcPageSizes(hDlg) \
533 SNDMSG(hDlg, PSM_RECALCPAGESIZES, 0, 0)
539 #endif /* __WINE_PRSHT_H */