]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/wrapwin.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Wrapper around <windows.h>, to be included instead of it
4 // Author: Vaclav Slavik
7 // Copyright: (c) 2003 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_WRAPWIN_H_
12 #define _WX_WRAPWIN_H_
14 #include "wx/platform.h"
16 // strict type checking to detect conversion from HFOO to HBAR at compile-time
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
28 // before including windows.h, define version macros at (currently) maximal
29 // values because we do all our checks at run-time anyhow
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)
42 // define _WIN32_WINNT and _WIN32_IE to the highest possible values because we
43 // always check for the version of installed DLLs at runtime anyway (see
44 // wxGetWinVersion() and wxApp::GetComCtl32Version()) unless the user really
45 // doesn't want to use APIs only available on later OS versions and had defined
46 // them to (presumably lower) values
48 #define _WIN32_WINNT 0x0600
52 #define _WIN32_IE 0x0700
55 /* Deal with clash with __WINDOWS__ include guard */
56 #if defined(__WXWINCE__) && defined(__WINDOWS__)
60 // For IPv6 support, we must include winsock2.h before winsock.h, and
61 // windows.h include winsock.h so do it before including it
68 #if defined(__WXWINCE__) && !defined(__WINDOWS__)
72 // #undef the macros defined in winsows.h which conflict with code elsewhere
73 #include "wx/msw/winundef.h"
75 // Types DWORD_PTR, ULONG_PTR and so on are used for 64-bit compatability
76 // in the WINAPI SDK (they are an integral type that is the size of a
77 // pointer) on MSVC 7 and later. However, they are not available in older
78 // Platform SDKs, and since they are typedefs and not #defines we simply
79 // overwrite them if there is a chance that they're not defined
80 #if (!defined(_MSC_VER) || (_MSC_VER < 1300)) && !defined(__WIN64__)
81 #define UINT_PTR unsigned int
84 #define ULONG_PTR unsigned long
85 #define DWORD_PTR unsigned long
86 #endif // !defined(_MSC_VER) || _MSC_VER < 1300
88 // ----------------------------------------------------------------------------
89 // Fix the functions wrongly implemented in unicows.dll
90 // ----------------------------------------------------------------------------
92 #if wxUSE_UNICODE_MSLU
96 WXDLLIMPEXP_CORE
int wxMSLU_DrawStateW(WXHDC dc
, WXHBRUSH br
, WXFARPROC outputFunc
,
97 WXLPARAM lData
, WXWPARAM wData
,
98 int x
, int y
, int cx
, int cy
,
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)
104 WXDLLIMPEXP_CORE
int wxMSLU_GetOpenFileNameW(void *ofn
);
105 #define GetOpenFileNameW(ofn) wxMSLU_GetOpenFileNameW((void*)ofn)
107 WXDLLIMPEXP_CORE
int wxMSLU_GetSaveFileNameW(void *ofn
);
108 #define GetSaveFileNameW(ofn) wxMSLU_GetSaveFileNameW((void*)ofn)
112 #endif // wxUSE_UNICODE_MSLU
114 #endif // _WX_WRAPWIN_H_