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