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