]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/winundef.h
Fixed.
[wxWidgets.git] / include / wx / msw / winundef.h
CommitLineData
98216d40
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: winundef.h
3// Purpose: undefine the common symbols #define'd by <windows.h>
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 16.05.99
7// RCS-ID: $Id$
8// Copyright: (c) wxWindows team
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_WINUNDEF_H_
13#define _WX_WINUNDEF_H_
14
15// windows.h #defines the following identifiers which are also used in wxWin
6bbd3344
BM
16
17// GetCharWidth
18
98216d40 19#ifdef GetCharWidth
379a3b04
BM
20 #undef GetCharWidth
21 inline BOOL GetCharWidth(HDC dc, UINT first, UINT last, LPINT buffer)
22 {
23 #ifdef _UNICODE
24 return GetCharWidthW(dc, first, last, buffer);
25 #else
26 return GetCharWidthA(dc, first, last, buffer);
27 #endif
28 }
e90babdf 29#endif
6bbd3344
BM
30
31// FindWindow
32
98216d40 33#ifdef FindWindow
379a3b04
BM
34 #undef FindWindow
35 #ifdef _UNICODE
36 inline HWND FindWindow(LPCWSTR classname, LPCWSTR windowname)
37 {
38 return FindWindowW(classname, windowname);
39 }
40 #else
41 inline HWND FindWindow(LPCSTR classname, LPCSTR windowname)
42 {
43 return FindWindowA(classname, windowname);
44 }
45 #endif
e90babdf 46#endif
6bbd3344
BM
47
48// GetClassName
49
98216d40 50#ifdef GetClassName
379a3b04
BM
51 #undef GetClassName
52 #ifdef _UNICODE
53 inline int GetClassName(HWND h, LPWSTR classname, int maxcount)
54 {
55 return GetClassNameW(h, classname, maxcount);
56 }
57 #else
58 inline int GetClassName(HWND h, LPSTR classname, int maxcount)
59 {
60 return GetClassNameA(h, classname, maxcount);
61 }
62 #endif
e90babdf 63#endif
6bbd3344
BM
64
65// GetClassInfo
66
98216d40 67#ifdef GetClassInfo
379a3b04
BM
68 #undef GetClassInfo
69 #ifdef _UNICODE
70 inline BOOL GetClassInfo(HINSTANCE h, LPCWSTR name, LPWNDCLASSW winclass)
71 {
72 return GetClassInfoW(h, name, winclass);
73 }
74 #else
75 inline BOOL GetClassInfo(HINSTANCE h, LPCSTR name, LPWNDCLASSA winclass)
76 {
77 return GetClassInfoA(h, name, winclass);
78 }
79 #endif
e90babdf 80#endif
6bbd3344
BM
81
82// LoadAccelerators
83
98216d40 84#ifdef LoadAccelerators
379a3b04
BM
85 #undef LoadAccelerators
86 #ifdef _UNICODE
87 inline HACCEL LoadAccelerators(HINSTANCE h, LPCWSTR name)
88 {
89 return LoadAcceleratorsW(h, name);
90 }
91 #else
92 inline HACCEL LoadAccelerators(HINSTANCE h, LPCSTR name)
93 {
94 return LoadAcceleratorsA(h, name);
95 }
96 #endif
98216d40 97#endif
6bbd3344
BM
98
99// DrawText
100
98216d40 101#ifdef DrawText
379a3b04
BM
102 #undef DrawText
103 #ifdef _UNICODE
104 inline int DrawText(HDC h, LPCWSTR str, int count, LPRECT rect, UINT format)
105 {
106 return DrawTextW(h, str, count, rect, format);
107 }
108 #else
109 inline int DrawText(HDC h, LPCSTR str, int count, LPRECT rect, UINT format)
110 {
111 return DrawTextA(h, str, count, rect, format);
112 }
113 #endif
e90babdf 114#endif
6bbd3344
BM
115
116// StartDoc
117
98216d40 118#ifdef StartDoc
379a3b04 119 #undef StartDoc
0c589ad0
BM
120 #ifdef __MINGW32__
121 #define DOCINFOW DOCINFO
122 #define DOCINFOA DOCINFO
123 #endif
379a3b04
BM
124 #ifdef _UNICODE
125 inline int StartDoc(HDC h, CONST DOCINFOW* info)
126 {
127 return StartDocW(h, info);
128 }
129 #else
130 inline int StartDoc(HDC h, CONST DOCINFOA* info)
131 {
132 return StartDocA(h, info);
133 }
134 #endif
98216d40
VZ
135#endif
136
379a3b04
BM
137// GetObject
138
139#ifdef GetObject
140 #undef GetObject
141 inline int GetObject(HGDIOBJ h, int i, LPVOID buffer)
142 {
143 #ifdef _UNICODE
144 return GetObjectW(h, i, buffer);
145 #else
146 return GetObjectA(h, i, buffer);
6ec9d18f
RD
147 #endif
148 }
149#endif
150
151
152#ifdef GetMessage
153 #undef GetMessage
154 inline int GetMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax)
155 {
156 #ifdef _UNICODE
157 return GetMessageW(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
158 #else
159 return GetMessageA(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
160 #endif
379a3b04 161 }
e90babdf 162#endif
98216d40 163
c455ab93
RR
164// For WINE
165
166#if defined(GetWindowStyle) || defined(__WXWINE__)
167 #undef GetWindowStyle
168#endif
98216d40 169
379a3b04 170// For ming and cygwin
6bbd3344 171
379a3b04
BM
172// GetFirstChild
173#ifdef GetFirstChild
174 #undef GetFirstChild
175 inline HWND GetFirstChild(HWND h)
176 {
177 return GetTopWindow(h);
178 }
179#endif
6bbd3344 180
98216d40 181
379a3b04
BM
182// GetNextSibling
183#ifdef GetNextSibling
0c589ad0
BM
184 #undef GetNextSibling
185 inline HWND GetNextSibling(HWND h)
186 {
187 return GetWindow(h, GW_HWNDNEXT);
188 }
98216d40
VZ
189#endif
190
379a3b04
BM
191// GetWindowProc
192//ifdef GetWindowProc
193// #undef GetWindowProc
194//endif
195//ifdef GetNextChild
196// #undef GetNextChild
197//endif
6bbd3344 198
98216d40 199#endif // _WX_WINUNDEF_H_