]>
Commit | Line | Data |
---|---|---|
9ed0d735 | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/msw/wrapwin.h |
9ed0d735 | 3 | // Purpose: Wrapper around <windows.h>, to be included instead of it |
2f552802 | 4 | // Author: Vaclav Slavik |
9ed0d735 | 5 | // Created: 2003/07/22 |
2f552802 | 6 | // Copyright: (c) 2003 Vaclav Slavik |
65571936 | 7 | // Licence: wxWindows licence |
9ed0d735 VS |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
10 | #ifndef _WX_WRAPWIN_H_ | |
11 | #define _WX_WRAPWIN_H_ | |
12 | ||
13 | #include "wx/platform.h" | |
14 | ||
4edb3b83 | 15 | // strict type checking to detect conversion from HFOO to HBAR at compile-time |
9ed0d735 VS |
16 | #ifndef STRICT |
17 | #define STRICT 1 | |
18 | #endif | |
19 | ||
4edb3b83 VZ |
20 | // this macro tells windows.h to not define min() and max() as macros: we need |
21 | // this as otherwise they conflict with standard C++ functions | |
a97cd798 VZ |
22 | #ifndef NOMINMAX |
23 | #define NOMINMAX | |
24 | #endif // NOMINMAX | |
baec3aee | 25 | |
4edb3b83 | 26 | |
1033b836 VZ |
27 | // before including windows.h, define version macros at (currently) maximal |
28 | // values because we do all our checks at run-time anyhow | |
4edb3b83 VZ |
29 | #ifndef WINVER |
30 | // the only exception to the above is MSVC 6 which has a time bomb in its | |
31 | // headers: they warn against using them with WINVER >= 0x0500 as they | |
32 | // contain only part of the declarations and they're not always correct, so | |
33 | // don't define WINVER for it at all as this allows everything to work as | |
34 | // expected both with standard VC6 headers (which define WINVER as 0x0400 | |
35 | // by default) and headers from a newer SDK (which may define it as 0x0500) | |
36 | #if !defined(__VISUALC__) || (__VISUALC__ >= 1300) | |
37 | #define WINVER 0x0600 | |
38 | #endif | |
39 | #endif | |
40 | ||
1032aee2 VZ |
41 | // define _WIN32_WINNT and _WIN32_IE to the highest possible values because we |
42 | // always check for the version of installed DLLs at runtime anyway (see | |
43 | // wxGetWinVersion() and wxApp::GetComCtl32Version()) unless the user really | |
44 | // doesn't want to use APIs only available on later OS versions and had defined | |
45 | // them to (presumably lower) values | |
1033b836 VZ |
46 | #ifndef _WIN32_WINNT |
47 | #define _WIN32_WINNT 0x0600 | |
48 | #endif | |
4edb3b83 | 49 | |
1032aee2 VZ |
50 | #ifndef _WIN32_IE |
51 | #define _WIN32_IE 0x0700 | |
52 | #endif | |
53 | ||
839f48f2 JS |
54 | /* Deal with clash with __WINDOWS__ include guard */ |
55 | #if defined(__WXWINCE__) && defined(__WINDOWS__) | |
56 | #undef __WINDOWS__ | |
57 | #endif | |
1033b836 | 58 | |
8575ff50 VZ |
59 | // For IPv6 support, we must include winsock2.h before winsock.h, and |
60 | // windows.h include winsock.h so do it before including it | |
61 | #if wxUSE_IPV6 | |
62 | #include <winsock2.h> | |
63 | #endif | |
64 | ||
9ed0d735 | 65 | #include <windows.h> |
14d3c9f7 | 66 | |
839f48f2 JS |
67 | #if defined(__WXWINCE__) && !defined(__WINDOWS__) |
68 | #define __WINDOWS__ | |
69 | #endif | |
4edb3b83 VZ |
70 | |
71 | // #undef the macros defined in winsows.h which conflict with code elsewhere | |
9ed0d735 VS |
72 | #include "wx/msw/winundef.h" |
73 | ||
05e66a70 | 74 | // Types DWORD_PTR, ULONG_PTR and so on are used for 64-bit compatibility |
54892273 | 75 | // in the WINAPI SDK (they are an integral type that is the size of a |
03647350 VZ |
76 | // pointer) on MSVC 7 and later. However, they are not available in older |
77 | // Platform SDKs, and since they are typedefs and not #defines we simply | |
54892273 | 78 | // overwrite them if there is a chance that they're not defined |
3656eefc | 79 | #if (!defined(_MSC_VER) || (_MSC_VER < 1300)) && !defined(__WIN64__) |
f9438023 | 80 | #define UINT_PTR unsigned int |
dca0f651 | 81 | #define INT_PTR int |
97aa7b99 | 82 | #define HANDLE_PTR unsigned long |
ebb2300f | 83 | #define LONG_PTR long |
f9438023 VZ |
84 | #define ULONG_PTR unsigned long |
85 | #define DWORD_PTR unsigned long | |
54892273 | 86 | #endif // !defined(_MSC_VER) || _MSC_VER < 1300 |
f9438023 | 87 | |
6dad7fff VZ |
88 | // ---------------------------------------------------------------------------- |
89 | // Fix the functions wrongly implemented in unicows.dll | |
90 | // ---------------------------------------------------------------------------- | |
91 | ||
92 | #if wxUSE_UNICODE_MSLU | |
93 | ||
94 | #if wxUSE_GUI | |
95 | ||
53a2db12 | 96 | WXDLLIMPEXP_CORE int wxMSLU_DrawStateW(WXHDC dc, WXHBRUSH br, WXFARPROC outputFunc, |
6dad7fff VZ |
97 | WXLPARAM lData, WXWPARAM wData, |
98 | int x, int y, int cx, int cy, | |
99 | unsigned int flags); | |
100 | #define DrawStateW(dc, br, func, ld, wd, x, y, cx, cy, flags) \ | |
101 | wxMSLU_DrawStateW((WXHDC)dc,(WXHBRUSH)br,(WXFARPROC)func, \ | |
102 | ld, wd, x, y, cx, cy, flags) | |
103 | ||
53a2db12 | 104 | WXDLLIMPEXP_CORE int wxMSLU_GetOpenFileNameW(void *ofn); |
6dad7fff VZ |
105 | #define GetOpenFileNameW(ofn) wxMSLU_GetOpenFileNameW((void*)ofn) |
106 | ||
53a2db12 | 107 | WXDLLIMPEXP_CORE int wxMSLU_GetSaveFileNameW(void *ofn); |
6dad7fff VZ |
108 | #define GetSaveFileNameW(ofn) wxMSLU_GetSaveFileNameW((void*)ofn) |
109 | ||
110 | #endif // wxUSE_GUI | |
111 | ||
112 | #endif // wxUSE_UNICODE_MSLU | |
113 | ||
2f552802 VZ |
114 | #endif // _WX_WRAPWIN_H_ |
115 | ||
8575ff50 | 116 |