]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/wrapwin.h
wxChar -> char
[wxWidgets.git] / include / wx / msw / wrapwin.h
CommitLineData
9ed0d735 1/////////////////////////////////////////////////////////////////////////////
f9438023 2// Name: msw/wrapwin.h
9ed0d735 3// Purpose: Wrapper around <windows.h>, to be included instead of it
2f552802 4// Author: Vaclav Slavik
9ed0d735
VS
5// Created: 2003/07/22
6// RCS-ID: $Id$
2f552802 7// Copyright: (c) 2003 Vaclav Slavik
65571936 8// Licence: wxWindows licence
9ed0d735
VS
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_WRAPWIN_H_
12#define _WX_WRAPWIN_H_
13
14#include "wx/platform.h"
15
4edb3b83 16// strict type checking to detect conversion from HFOO to HBAR at compile-time
9ed0d735
VS
17#ifndef STRICT
18 #define STRICT 1
19#endif
20
4edb3b83
VZ
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
a97cd798
VZ
23#ifndef NOMINMAX
24 #define NOMINMAX
25#endif // NOMINMAX
baec3aee 26
4edb3b83 27
1033b836
VZ
28// before including windows.h, define version macros at (currently) maximal
29// values because we do all our checks at run-time anyhow
4edb3b83
VZ
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
1032aee2
VZ
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
1033b836
VZ
47#ifndef _WIN32_WINNT
48 #define _WIN32_WINNT 0x0600
49#endif
4edb3b83 50
1032aee2
VZ
51#ifndef _WIN32_IE
52 #define _WIN32_IE 0x0700
53#endif
54
839f48f2
JS
55/* Deal with clash with __WINDOWS__ include guard */
56#if defined(__WXWINCE__) && defined(__WINDOWS__)
57#undef __WINDOWS__
58#endif
1033b836 59
9ed0d735 60#include <windows.h>
14d3c9f7 61
839f48f2
JS
62#if defined(__WXWINCE__) && !defined(__WINDOWS__)
63#define __WINDOWS__
64#endif
4edb3b83
VZ
65
66// #undef the macros defined in winsows.h which conflict with code elsewhere
9ed0d735
VS
67#include "wx/msw/winundef.h"
68
54892273
VZ
69// Types DWORD_PTR, ULONG_PTR and so on are used for 64-bit compatability
70// in the WINAPI SDK (they are an integral type that is the size of a
71// pointer) on MSVC 7 and later. However, they are not available in older
72// Platform SDKs, and since they are typedefs and not #defines we simply
73// overwrite them if there is a chance that they're not defined
74#if !defined(_MSC_VER) || (_MSC_VER < 1300)
f9438023 75 #define UINT_PTR unsigned int
ebb2300f 76 #define LONG_PTR long
f9438023
VZ
77 #define ULONG_PTR unsigned long
78 #define DWORD_PTR unsigned long
54892273 79#endif // !defined(_MSC_VER) || _MSC_VER < 1300
f9438023 80
6dad7fff
VZ
81// ----------------------------------------------------------------------------
82// Fix the functions wrongly implemented in unicows.dll
83// ----------------------------------------------------------------------------
84
85#if wxUSE_UNICODE_MSLU
86
87#if wxUSE_GUI
88
89WXDLLEXPORT int wxMSLU_DrawStateW(WXHDC dc, WXHBRUSH br, WXFARPROC outputFunc,
90 WXLPARAM lData, WXWPARAM wData,
91 int x, int y, int cx, int cy,
92 unsigned int flags);
93#define DrawStateW(dc, br, func, ld, wd, x, y, cx, cy, flags) \
94 wxMSLU_DrawStateW((WXHDC)dc,(WXHBRUSH)br,(WXFARPROC)func, \
95 ld, wd, x, y, cx, cy, flags)
96
97WXDLLEXPORT int wxMSLU_GetOpenFileNameW(void *ofn);
98#define GetOpenFileNameW(ofn) wxMSLU_GetOpenFileNameW((void*)ofn)
99
100WXDLLEXPORT int wxMSLU_GetSaveFileNameW(void *ofn);
101#define GetSaveFileNameW(ofn) wxMSLU_GetSaveFileNameW((void*)ofn)
102
103#endif // wxUSE_GUI
104
105#endif // wxUSE_UNICODE_MSLU
106
2f552802
VZ
107#endif // _WX_WRAPWIN_H_
108