1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        msw/wrapwin.h
3 // Purpose:     Wrapper around <windows.h>, to be included instead of it
4 // Author:      Vaclav Slavik
5 // Created:     2003/07/22
6 // RCS-ID:      $Id: wrapwin.h 53877 2008-05-31 12:43:44Z SN $
7 // Copyright:   (c) 2003 Vaclav Slavik
8 // Licence:     wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10 
11 #ifndef _WX_WRAPWIN_H_
12 #define _WX_WRAPWIN_H_
13 
14 #include "wx/platform.h"
15 
16 // strict type checking to detect conversion from HFOO to HBAR at compile-time
17 #ifndef STRICT
18     #define STRICT 1
19 #endif
20 
21 // this macro tells windows.h to not define min() and max() as macros: we need
22 // this as otherwise they conflict with standard C++ functions
23 #ifndef NOMINMAX
24     #define NOMINMAX
25 #endif // NOMINMAX
26 
27 
28 // before including windows.h, define version macros at (currently) maximal
29 // values because we do all our checks at run-time anyhow
30 #ifndef WINVER
31     // the only exception to the above is MSVC 6 which has a time bomb in its
32     // headers: they warn against using them with WINVER >= 0x0500 as they
33     // contain only part of the declarations and they're not always correct, so
34     // don't define WINVER for it at all as this allows everything to work as
35     // expected both with standard VC6 headers (which define WINVER as 0x0400
36     // by default) and headers from a newer SDK (which may define it as 0x0500)
37     #if !defined(__VISUALC__) || (__VISUALC__ >= 1300)
38         #define WINVER 0x0600
39     #endif
40 #endif
41 
42 #ifndef _WIN32_WINNT
43     #define _WIN32_WINNT 0x0600
44 #endif
45 
46 /* Deal with clash with __WINDOWS__ include guard */
47 #if defined(__WXWINCE__) && defined(__WINDOWS__)
48 #undef __WINDOWS__
49 #endif
50 
51 #include <windows.h>
52 
53 #if defined(__WXWINCE__) && !defined(__WINDOWS__)
54 #define __WINDOWS__
55 #endif
56 
57 // #undef the macros defined in winsows.h which conflict with code elsewhere
58 #include "wx/msw/winundef.h"
59 
60 // Types DWORD_PTR, ULONG_PTR and so on are used for 64-bit compatability
61 // in the WINAPI SDK (they are an integral type that is the size of a
62 // pointer) on MSVC 7 and later. However, they are not available in older
63 // Platform SDKs, and since they are typedefs and not #defines we simply
64 // overwrite them if there is a chance that they're not defined
65 #if (!defined(_MSC_VER) || (_MSC_VER < 1300)) && !defined(__WIN64__)
66     #define UINT_PTR unsigned int
67     #define LONG_PTR long
68     #define ULONG_PTR unsigned long
69     #define DWORD_PTR unsigned long
70 #endif // !defined(_MSC_VER) || _MSC_VER < 1300
71 
72 // ----------------------------------------------------------------------------
73 // Fix the functions wrongly implemented in unicows.dll
74 // ----------------------------------------------------------------------------
75 
76 #if wxUSE_UNICODE_MSLU
77 
78 #if wxUSE_GUI
79 
80 WXDLLEXPORT int wxMSLU_DrawStateW(WXHDC dc, WXHBRUSH br, WXFARPROC outputFunc,
81                                   WXLPARAM lData, WXWPARAM wData,
82                                   int x, int y, int cx, int cy,
83                                   unsigned int flags);
84 #define DrawStateW(dc, br, func, ld, wd, x, y, cx, cy, flags) \
85     wxMSLU_DrawStateW((WXHDC)dc,(WXHBRUSH)br,(WXFARPROC)func, \
86                       ld, wd, x, y, cx, cy, flags)
87 
88 WXDLLEXPORT int wxMSLU_GetOpenFileNameW(void *ofn);
89 #define GetOpenFileNameW(ofn) wxMSLU_GetOpenFileNameW((void*)ofn)
90 
91 WXDLLEXPORT int wxMSLU_GetSaveFileNameW(void *ofn);
92 #define GetSaveFileNameW(ofn) wxMSLU_GetSaveFileNameW((void*)ofn)
93 
94 #endif // wxUSE_GUI
95 
96 #endif // wxUSE_UNICODE_MSLU
97 
98 #endif // _WX_WRAPWIN_H_
99 
100