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