]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/winundef.h
ac2fa36577be717723e9cc00be3100735f4ab548
[wxWidgets.git] / include / wx / msw / winundef.h
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 /* THIS SHOULD NOT BE USED since you might include it once e.g. in window.h,
13 * then again _AFTER_ you've included windows.h, in which case it won't work
14 * a 2nd time -- JACS
15 #ifndef _WX_WINUNDEF_H_
16 #define _WX_WINUNDEF_H_
17 */
18
19 // windows.h #defines the following identifiers which are also used in wxWin
20
21 // GetCharWidth
22
23 #ifdef GetCharWidth
24 #undef GetCharWidth
25 inline BOOL GetCharWidth(HDC dc, UINT first, UINT last, LPINT buffer)
26 {
27 #ifdef _UNICODE
28 return GetCharWidthW(dc, first, last, buffer);
29 #else
30 return GetCharWidthA(dc, first, last, buffer);
31 #endif
32 }
33 #endif
34
35 // FindWindow
36
37 #ifdef FindWindow
38 #undef FindWindow
39 #ifdef _UNICODE
40 inline HWND FindWindow(LPCWSTR classname, LPCWSTR windowname)
41 {
42 return FindWindowW(classname, windowname);
43 }
44 #else
45 inline HWND FindWindow(LPCSTR classname, LPCSTR windowname)
46 {
47 return FindWindowA(classname, windowname);
48 }
49 #endif
50 #endif
51
52 // GetClassName
53
54 #ifdef GetClassName
55 #undef GetClassName
56 #ifdef _UNICODE
57 inline int GetClassName(HWND h, LPWSTR classname, int maxcount)
58 {
59 return GetClassNameW(h, classname, maxcount);
60 }
61 #else
62 inline int GetClassName(HWND h, LPSTR classname, int maxcount)
63 {
64 return GetClassNameA(h, classname, maxcount);
65 }
66 #endif
67 #endif
68
69 // GetClassInfo
70
71 #ifdef GetClassInfo
72 #undef GetClassInfo
73 #ifdef _UNICODE
74 inline BOOL GetClassInfo(HINSTANCE h, LPCWSTR name, LPWNDCLASSW winclass)
75 {
76 return GetClassInfoW(h, name, winclass);
77 }
78 #else
79 inline BOOL GetClassInfo(HINSTANCE h, LPCSTR name, LPWNDCLASSA winclass)
80 {
81 return GetClassInfoA(h, name, winclass);
82 }
83 #endif
84 #endif
85
86 // LoadAccelerators
87
88 #ifdef LoadAccelerators
89 #undef LoadAccelerators
90 #ifdef _UNICODE
91 inline HACCEL LoadAccelerators(HINSTANCE h, LPCWSTR name)
92 {
93 return LoadAcceleratorsW(h, name);
94 }
95 #else
96 inline HACCEL LoadAccelerators(HINSTANCE h, LPCSTR name)
97 {
98 return LoadAcceleratorsA(h, name);
99 }
100 #endif
101 #endif
102
103 // DrawText
104
105 #ifdef DrawText
106 #undef DrawText
107 #ifdef _UNICODE
108 inline int DrawText(HDC h, LPCWSTR str, int count, LPRECT rect, UINT format)
109 {
110 return DrawTextW(h, str, count, rect, format);
111 }
112 #else
113 inline int DrawText(HDC h, LPCSTR str, int count, LPRECT rect, UINT format)
114 {
115 return DrawTextA(h, str, count, rect, format);
116 }
117 #endif
118 #endif
119
120 // StartDoc
121
122 #ifdef StartDoc
123 #undef StartDoc
124 #ifdef __GNUWIN32__
125 #define DOCINFOW DOCINFO
126 #define DOCINFOA DOCINFO
127 #endif
128 #ifdef _UNICODE
129 inline int StartDoc(HDC h, CONST DOCINFOW* info)
130 {
131 return StartDocW(h, info);
132 }
133 #else
134 inline int StartDoc(HDC h, CONST DOCINFOA* info)
135 {
136 return StartDocA(h, info);
137 }
138 #endif
139 #endif
140
141 // GetObject
142
143 #ifdef GetObject
144 #undef GetObject
145 inline int GetObject(HGDIOBJ h, int i, LPVOID buffer)
146 {
147 #ifdef _UNICODE
148 return GetObjectW(h, i, buffer);
149 #else
150 return GetObjectA(h, i, buffer);
151 #endif
152 }
153 #endif
154
155
156 #ifdef GetMessage
157 #undef GetMessage
158 inline int GetMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax)
159 {
160 #ifdef _UNICODE
161 return GetMessageW(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
162 #else
163 return GetMessageA(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
164 #endif
165 }
166 #endif
167
168 // For WINE
169
170 #if defined(GetWindowStyle) || defined(__WXWINE__)
171 #undef GetWindowStyle
172 #endif
173
174 // For ming and cygwin
175
176 // GetFirstChild
177 #ifdef GetFirstChild
178 #undef GetFirstChild
179 inline HWND GetFirstChild(HWND h)
180 {
181 return GetTopWindow(h);
182 }
183 #endif
184
185
186 // GetNextSibling
187 #ifdef GetNextSibling
188 #undef GetNextSibling
189 inline HWND GetNextSibling(HWND h)
190 {
191 return GetWindow(h, GW_HWNDNEXT);
192 }
193 #endif
194
195 // GetWindowProc
196 //ifdef GetWindowProc
197 // #undef GetWindowProc
198 //endif
199 //ifdef GetNextChild
200 // #undef GetNextChild
201 //endif
202
203 // #endif // _WX_WINUNDEF_H_
204