]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/msw/winundef.h
Fixed.
[wxWidgets.git] / include / wx / msw / winundef.h
... / ...
CommitLineData
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
16
17// GetCharWidth
18
19#ifdef GetCharWidth
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 }
29#endif
30
31// FindWindow
32
33#ifdef FindWindow
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
46#endif
47
48// GetClassName
49
50#ifdef GetClassName
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
63#endif
64
65// GetClassInfo
66
67#ifdef GetClassInfo
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
80#endif
81
82// LoadAccelerators
83
84#ifdef LoadAccelerators
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
97#endif
98
99// DrawText
100
101#ifdef DrawText
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
114#endif
115
116// StartDoc
117
118#ifdef StartDoc
119 #undef StartDoc
120 #ifdef __MINGW32__
121 #define DOCINFOW DOCINFO
122 #define DOCINFOA DOCINFO
123 #endif
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
135#endif
136
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);
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
161 }
162#endif
163
164// For WINE
165
166#if defined(GetWindowStyle) || defined(__WXWINE__)
167 #undef GetWindowStyle
168#endif
169
170// For ming and cygwin
171
172// GetFirstChild
173#ifdef GetFirstChild
174 #undef GetFirstChild
175 inline HWND GetFirstChild(HWND h)
176 {
177 return GetTopWindow(h);
178 }
179#endif
180
181
182// GetNextSibling
183#ifdef GetNextSibling
184 #undef GetNextSibling
185 inline HWND GetNextSibling(HWND h)
186 {
187 return GetWindow(h, GW_HWNDNEXT);
188 }
189#endif
190
191// GetWindowProc
192//ifdef GetWindowProc
193// #undef GetWindowProc
194//endif
195//ifdef GetNextChild
196// #undef GetNextChild
197//endif
198
199#endif // _WX_WINUNDEF_H_