- New implementation of SendMessage, ReceiveMessage, ReplyMessage functions
[wine] / include / prsht.h
1 #ifndef _WINE_PRSHT_H
2 #define _WINE_PRSHT_H
3
4 #include "winuser.h"
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10
11 /*
12  * Property sheet support (callback procs)
13  */
14
15
16 #define WC_PROPSHEET32A      "SysPropertySheet"
17 #define WC_PROPSHEET32W      L"SysPropertySheet"
18 #define WC_PROPSHEET         WINELIB_NAME_AW(WC_PROPSHEET)
19
20 struct _PROPSHEETPAGE32A;  /** need to forward declare those structs **/
21 struct _PROPSHEETPAGE32W;
22 struct _PSP;
23 typedef struct _PSP *HPROPSHEETPAGE;
24
25
26 typedef UINT32 (CALLBACK *LPFNPSPCALLBACK32A)(HWND32, UINT32, struct _PROPSHEETPAGE32A*);
27 typedef UINT32 (CALLBACK *LPFNPSPCALLBACK32W)(HWND32, UINT32, struct _PROPSHEETPAGE32W*);
28 typedef INT32  (CALLBACK *PFNPROPSHEETCALLBACK32)(HWND32, UINT32, LPARAM);
29 typedef BOOL32 (CALLBACK *LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM);
30 typedef BOOL32 (CALLBACK *LPFNADDPROPSHEETPAGES)(LPVOID, LPFNADDPROPSHEETPAGE, LPARAM);
31
32 /* c++ likes nameless unions whereas c doesnt */
33 /* (used in property sheet structures)        */
34 #ifdef __cplusplus
35 #define DUMMYUNIONNAME
36 #define DUMMYUNIONNAME1
37 #define DUMMYUNIONNAME2
38 #define DUMMYUNIONNAME3
39 #define DUMMYUNIONNAME4
40 #define DUMMYUNIONNAME5
41 #else
42 #define DUMMYUNIONNAME   u
43 #define DUMMYUNIONNAME1  u1
44 #define DUMMYUNIONNAME2  u2
45 #define DUMMYUNIONNAME3  u3
46 #define DUMMYUNIONNAME4  u4
47 #define DUMMYUNIONNAME5  u5
48 #endif
49
50 /*
51  * Property sheet support (structures)
52  */
53 typedef struct _PROPSHEETPAGE32A
54 {
55     DWORD              dwSize;
56     DWORD              dwFlags;
57     HINSTANCE32        hInstance;
58     union 
59     {
60         LPCSTR           pszTemplate;
61         LPCDLGTEMPLATE   pResource;
62     }DUMMYUNIONNAME1;
63     union
64     {
65         HICON32          hIcon;
66         LPCSTR           pszIcon;
67     }DUMMYUNIONNAME2;
68     LPCSTR             pszTitle;
69     DLGPROC32          pfnDlgProc;
70     LPARAM             lParam;
71     LPFNPSPCALLBACK32A pfnCallback;
72     UINT32*            pcRefParent;
73     LPCWSTR            pszHeaderTitle;
74     LPCWSTR            pszHeaderSubTitle;
75 } PROPSHEETPAGE32A, *LPPROPSHEETPAGE32A;
76
77 typedef const PROPSHEETPAGE32A *LPCPROPSHEETPAGE32A;
78
79 typedef struct _PROPSHEETPAGE32W
80 {
81     DWORD               dwSize;
82     DWORD               dwFlags;
83     HINSTANCE32         hInstance;
84     union 
85     {
86         LPCWSTR          pszTemplate;
87         LPCDLGTEMPLATE   pResource;
88     }DUMMYUNIONNAME1;
89     union
90     {
91         HICON32          hIcon;
92         LPCWSTR          pszIcon;
93     }DUMMYUNIONNAME2;
94     LPCWSTR            pszTitle;
95     DLGPROC32          pfnDlgProc;
96     LPARAM             lParam;
97     LPFNPSPCALLBACK32W pfnCallback;
98     UINT32*            pcRefParent;
99     LPCWSTR            pszHeaderTitle;
100     LPCWSTR            pszHeaderSubTitle;
101 } PROPSHEETPAGE32W, *LPPROPSHEETPAGE32W;
102
103 typedef const PROPSHEETPAGE32W *LPCPROPSHEETPAGE32W;
104
105
106 typedef struct _PROPSHEETHEADER32A
107 {
108     DWORD                    dwSize;
109     DWORD                    dwFlags;
110     HWND32                   hwndParent;
111     HINSTANCE32              hInstance;
112     union
113     {
114       HICON32                  hIcon;
115       LPCSTR                   pszIcon;
116     }DUMMYUNIONNAME1;
117     LPCSTR                   pszCaption;
118     UINT32                   nPages;
119     union
120     {
121         UINT32                 nStartPage;
122         LPCSTR                 pStartPage;
123     }DUMMYUNIONNAME2;
124     union
125     {
126         LPCPROPSHEETPAGE32A    ppsp;
127         HPROPSHEETPAGE*        phpage;
128     }DUMMYUNIONNAME3;
129     PFNPROPSHEETCALLBACK32   pfnCallback;
130     union
131     {
132         HBITMAP32              hbmWatermark;
133         LPCSTR                 pszbmWatermark;
134     }DUMMYUNIONNAME4;
135     HPALETTE32               hplWatermark;
136     union
137     {
138         HBITMAP32              hbmHeader;
139         LPCSTR                 pszbmHeader;
140     }DUMMYUNIONNAME5;
141 } PROPSHEETHEADER32A, *LPPROPSHEETHEADER32A;
142
143 typedef const PROPSHEETHEADER32A *LPCPROPSHEETHEADER32A;
144
145 typedef struct _PROPSHEETHEADER32W
146 {
147     DWORD                    dwSize;
148     DWORD                    dwFlags;
149     HWND32                   hwndParent;
150     HINSTANCE32              hInstance;
151     union
152     {
153       HICON32                  hIcon;
154       LPCSTR                   pszIcon;
155     }DUMMYUNIONNAME1;
156     LPCWSTR                  pszCaption;
157     UINT32                   nPages;
158     union
159     {
160         UINT32                 nStartPage;
161         LPCWSTR                pStartPage;
162     }DUMMYUNIONNAME2;
163     union
164     {
165         LPCPROPSHEETPAGE32W    ppsp;
166         HPROPSHEETPAGE*        phpage;
167     }DUMMYUNIONNAME3;
168     PFNPROPSHEETCALLBACK32   pfnCallback;
169     union
170     {
171         HBITMAP32              hbmWatermark;
172         LPCWSTR                pszbmWatermark;
173     }DUMMYUNIONNAME4;
174     HPALETTE32               hplWatermark;
175     union
176     {
177         HBITMAP32              hbmHeader;
178         LPCWSTR                pszbmHeader;
179     }DUMMYUNIONNAME5;
180 } PROPSHEETHEADER32W, *LPPROPSHEETHEADER32W;
181
182 typedef const PROPSHEETHEADER32W *LPCPROPSHEETHEADER32W;
183
184
185 /*
186  * Property sheet support (methods)
187  */
188 INT32 WINAPI PropertySheet32A(LPCPROPSHEETHEADER32A);
189 INT32 WINAPI PropertySheet32W(LPCPROPSHEETHEADER32W);
190 #define PropertySheet WINELIB_NAME_AW(PropertySheet)
191 HPROPSHEETPAGE WINAPI CreatePropertySheetPage32A(LPCPROPSHEETPAGE32A);
192 HPROPSHEETPAGE WINAPI CreatePropertySheetPage32W(LPCPROPSHEETPAGE32W);
193 #define CreatePropertySheetPage WINELIB_NAME_AW(CreatePropertySheetPage)
194 BOOL32 WINAPI DestroyPropertySheetPage32(HPROPSHEETPAGE hPropPage);
195 #define DestroyPropertySheetPage WINELIB_NAME(DestroyPropertySheetPage)
196
197 /*
198  * Property sheet support (UNICODE-WineLib)
199  */
200
201 DECL_WINELIB_TYPE_AW(PROPSHEETPAGE) 
202 DECL_WINELIB_TYPE_AW(LPPROPSHEETPAGE) 
203 DECL_WINELIB_TYPE_AW(LPCPROPSHEETPAGE) 
204 DECL_WINELIB_TYPE_AW(PROPSHEETHEADER) 
205 DECL_WINELIB_TYPE_AW(LPPROPSHEETHEADER) 
206 DECL_WINELIB_TYPE_AW(LPCPROPSHEETHEADER) 
207 DECL_WINELIB_TYPE_AW(LPFNPSPCALLBACK) 
208 DECL_WINELIB_TYPE(PFNPROPSHEETCALLBACK) 
209
210
211 /*
212  * Property sheet support (defines)
213  */
214 #define PSP_DEFAULT             0x0000
215 #define PSP_DLGINDIRECT         0x0001
216 #define PSP_USEHICON            0x0002
217 #define PSP_USEICONID           0x0004
218 #define PSP_USETITLE            0x0008
219 #define PSP_RTLREADING          0x0010
220
221 #define PSP_HASHELP             0x0020
222 #define PSP_USEREFPARENT        0x0040
223 #define PSP_USECALLBACK         0x0080
224
225
226 #define PSPCB_RELEASE           1
227 #define PSPCB_CREATE            2
228
229 #define PSH_DEFAULT             0x0000
230 #define PSH_PROPTITLE           0x0001
231 #define PSH_USEHICON            0x0002
232 #define PSH_USEICONID           0x0004
233 #define PSH_PROPSHEETPAGE       0x0008
234 #define PSH_WIZARD              0x0020
235 #define PSH_USEPSTARTPAGE       0x0040
236 #define PSH_NOAPPLYNOW          0x0080
237 #define PSH_USECALLBACK         0x0100
238 #define PSH_HASHELP             0x0200
239 #define PSH_MODELESS            0x0400
240 #define PSH_RTLREADING          0x0800
241
242 #define PSCB_INITIALIZED  1
243 #define PSCB_PRECREATE    2
244
245 #define PSN_FIRST               (0U-200U)
246 #define PSN_LAST                (0U-299U)
247
248
249 #define PSN_SETACTIVE           (PSN_FIRST-0)
250 #define PSN_KILLACTIVE          (PSN_FIRST-1)
251 /* #define PSN_VALIDATE            (PSN_FIRST-1) */
252 #define PSN_APPLY               (PSN_FIRST-2)
253 #define PSN_RESET               (PSN_FIRST-3)
254 /* #define PSN_CANCEL              (PSN_FIRST-3) */
255 #define PSN_HELP                (PSN_FIRST-5)
256 #define PSN_WIZBACK             (PSN_FIRST-6)
257 #define PSN_WIZNEXT             (PSN_FIRST-7)
258 #define PSN_WIZFINISH           (PSN_FIRST-8)
259 #define PSN_QUERYCANCEL         (PSN_FIRST-9)
260
261 #define PSNRET_NOERROR              0
262 #define PSNRET_INVALID              1
263 #define PSNRET_INVALID_NOCHANGEPAGE 2
264  
265
266 #define PSM_SETCURSEL           (WM_USER + 101)
267 #define PSM_REMOVEPAGE          (WM_USER + 102)
268 #define PSM_ADDPAGE             (WM_USER + 103)
269 #define PSM_CHANGED             (WM_USER + 104)
270 #define PSM_RESTARTWINDOWS      (WM_USER + 105)
271 #define PSM_REBOOTSYSTEM        (WM_USER + 106)
272 #define PSM_CANCELTOCLOSE       (WM_USER + 107)
273 #define PSM_QUERYSIBLINGS       (WM_USER + 108)
274 #define PSM_UNCHANGED           (WM_USER + 109)
275 #define PSM_APPLY               (WM_USER + 110)
276 #define PSM_SETTITLE32A         (WM_USER + 111)
277 #define PSM_SETTITLE32W         (WM_USER + 120)
278 #define PSM_SETTITLE WINELIB_NAME_AW(PSM_SETTITLE)
279 #define PSM_SETWIZBUTTONS       (WM_USER + 112)
280 #define PSM_PRESSBUTTON         (WM_USER + 113)
281 #define PSM_SETCURSELID         (WM_USER + 114)
282 #define PSM_SETFINISHTEXT32A    (WM_USER + 115)
283 #define PSM_SETFINISHTEXT32W    (WM_USER + 121)
284 #define PSM_SETFINISHTEXT WINELIB_NAME_AW(PSM_SETFINISHTEXT)
285 #define PSM_GETTABCONTROL       (WM_USER + 116)
286 #define PSM_ISDIALOGMESSAGE     (WM_USER + 117)
287 #define PSM_GETCURRENTPAGEHWND  (WM_USER + 118)
288
289 #define PSWIZB_BACK             0x00000001
290 #define PSWIZB_NEXT             0x00000002
291 #define PSWIZB_FINISH           0x00000004
292 #define PSWIZB_DISABLEDFINISH   0x00000008
293
294 #define PSBTN_BACK              0
295 #define PSBTN_NEXT              1
296 #define PSBTN_FINISH            2
297 #define PSBTN_OK                3
298 #define PSBTN_APPLYNOW          4
299 #define PSBTN_CANCEL            5
300 #define PSBTN_HELP              6
301 #define PSBTN_MAX               6
302
303 #define ID_PSRESTARTWINDOWS     0x2
304 #define ID_PSREBOOTSYSTEM       (ID_PSRESTARTWINDOWS | 0x1)
305
306
307 #define WIZ_CXDLG               276
308 #define WIZ_CYDLG               140
309
310 #define WIZ_CXBMP               80
311
312 #define WIZ_BODYX               92
313 #define WIZ_BODYCX              184
314
315 #define PROP_SM_CXDLG           212
316 #define PROP_SM_CYDLG           188
317
318 #define PROP_MED_CXDLG          227
319 #define PROP_MED_CYDLG          215
320
321 #define PROP_LG_CXDLG           252
322 #define PROP_LG_CYDLG           218
323
324 /*
325  * Property sheet support (macros)
326  */
327
328 #define PropSheet_SetCurSel(hDlg, hpage, index) \
329         SeandMessage32A(hDlg, PSM_SETCURSEL, (WPARAM32)index, (LPARAM)hpage)
330          
331 #define PropSheet_RemovePage(hDlg, index, hpage) \
332         SNDMSG(hDlg, PSM_REMOVEPAGE, index, (LPARAM)hpage)
333          
334 #define PropSheet_AddPage(hDlg, hpage) \
335         SNDMSG(hDlg, PSM_ADDPAGE, 0, (LPARAM)hpage)
336          
337 #define PropSheet_Changed(hDlg, hwnd) \
338         SNDMSG(hDlg, PSM_CHANGED, (WPARAM)hwnd, 0L)
339          
340 #define PropSheet_RestartWindows(hDlg) \
341         SNDMSG(hDlg, PSM_RESTARTWINDOWS, 0, 0L)
342          
343 #define PropSheet_RebootSystem(hDlg) \
344         SNDMSG(hDlg, PSM_REBOOTSYSTEM, 0, 0L)
345          
346 #define PropSheet_CancelToClose(hDlg) \
347         PostMessage(hDlg, PSM_CANCELTOCLOSE, 0, 0L)
348          
349 #define PropSheet_QuerySiblings(hDlg, wParam, lParam) \
350         SNDMSG(hDlg, PSM_QUERYSIBLINGS, wParam, lParam)
351          
352 #define PropSheet_UnChanged(hDlg, hwnd) \
353         SNDMSG(hDlg, PSM_UNCHANGED, (WPARAM)hwnd, 0L)
354          
355 #define PropSheet_Apply(hDlg) \
356         SNDMSG(hDlg, PSM_APPLY, 0, 0L)
357           
358 #define PropSheet_SetTitle(hDlg, wStyle, lpszText)\
359         SNDMSG(hDlg, PSM_SETTITLE, wStyle, (LPARAM)(LPCTSTR)lpszText)
360          
361 #define PropSheet_SetWizButtons(hDlg, dwFlags) \
362         PostMessage(hDlg, PSM_SETWIZBUTTONS, 0, (LPARAM)dwFlags)
363          
364 #define PropSheet_PressButton(hDlg, iButton) \
365         PostMessage(hDlg, PSM_PRESSBUTTON, (WPARAM)iButton, 0)
366          
367 #define PropSheet_SetCurSelByID(hDlg, id) \
368         SNDMSG(hDlg, PSM_SETCURSELID, 0, (LPARAM)id)
369
370 #define PropSheet_SetFinishText(hDlg, lpszText) \
371         SNDMSG(hDlg, PSM_SETFINISHTEXT, 0, (LPARAM)lpszText)
372          
373 #define PropSheet_GetTabControl(hDlg) \
374         (HWND)SNDMSG(hDlg, PSM_GETTABCONTROL, 0, 0)
375          
376 #define PropSheet_IsDialogMessage(hDlg, pMsg) \
377         (BOOL)SNDMSG(hDlg, PSM_ISDIALOGMESSAGE, 0, (LPARAM)pMsg)
378          
379 #define PropSheet_GetCurrentPageHwnd(hDlg) \
380         (HWND)SNDMSG(hDlg, PSM_GETCURRENTPAGEHWND, 0, 0L)
381          
382
383 #ifdef __cplusplus
384 }
385 #endif
386
387
388
389 #endif /* _WINE_PRSHT_H */