]>
Commit | Line | Data |
---|---|---|
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 VZ |
19 | #ifdef GetCharWidth |
20 | #undef GetCharWidth | |
21 | #endif | |
22 | ||
6bbd3344 BM |
23 | inline BOOL GetCharWidth(HDC dc, UINT first, UINT last, LPINT buffer) |
24 | { | |
25 | #ifdef _UNICODE | |
26 | return GetCharWidthW(dc, first, last, buffer); | |
27 | #else | |
28 | return GetCharWidthA(dc, first, last, buffer); | |
29 | #endif | |
30 | } | |
31 | ||
32 | // FindWindow | |
33 | ||
98216d40 VZ |
34 | #ifdef FindWindow |
35 | #undef FindWindow | |
36 | #endif | |
37 | ||
6bbd3344 BM |
38 | #ifdef _UNICODE |
39 | inline HWND FindWindow(LPCWSTR classname, LPCWSTR windowname) | |
40 | { | |
41 | return FindWindowW(classname, windowname); | |
42 | } | |
43 | #else | |
44 | inline HWND FindWindow(LPCSTR classname, LPCSTR windowname) | |
45 | { | |
46 | return FindWindowA(classname, windowname); | |
47 | } | |
48 | #endif | |
49 | ||
50 | // GetClassName | |
51 | ||
98216d40 VZ |
52 | #ifdef GetClassName |
53 | #undef GetClassName | |
54 | #endif | |
55 | ||
6bbd3344 BM |
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 | ||
68 | // GetClassInfo | |
69 | ||
98216d40 VZ |
70 | #ifdef GetClassInfo |
71 | #undef GetClassInfo | |
72 | #endif | |
73 | ||
6bbd3344 BM |
74 | #ifdef _UNICODE |
75 | inline BOOL GetClassInfo(HINSTANCE h, LPCWSTR name, LPWNDCLASSW winclass) | |
76 | { | |
77 | return GetClassInfoW(h, name, winclass); | |
78 | } | |
79 | #else | |
80 | inline BOOL GetClassInfo(HINSTANCE h, LPCSTR name, LPWNDCLASSA winclass) | |
81 | { | |
82 | return GetClassInfoA(h, name, winclass); | |
83 | } | |
84 | #endif | |
85 | ||
86 | // LoadAccelerators | |
87 | ||
98216d40 VZ |
88 | #ifdef LoadAccelerators |
89 | #undef LoadAccelerators | |
90 | #endif | |
91 | ||
6bbd3344 BM |
92 | #ifdef _UNICODE |
93 | inline HACCEL LoadAccelerators(HINSTANCE h, LPCWSTR name) | |
94 | { | |
95 | return LoadAcceleratorsW(h, name); | |
96 | } | |
97 | #else | |
98 | inline HACCEL LoadAccelerators(HINSTANCE h, LPCSTR name) | |
99 | { | |
100 | return LoadAcceleratorsA(h, name); | |
101 | } | |
98216d40 VZ |
102 | #endif |
103 | ||
6bbd3344 BM |
104 | |
105 | // GetWindowProc... this isn't a Windows API function?!?! | |
106 | //ifdef GetWindowProc | |
107 | // #undef GetWindowProc | |
108 | //endif | |
109 | ||
110 | ||
111 | // DrawText | |
112 | ||
98216d40 VZ |
113 | #ifdef DrawText |
114 | #undef DrawText | |
115 | #endif | |
116 | ||
6bbd3344 BM |
117 | #ifdef _UNICODE |
118 | inline int DrawText(HDC h, LPCWSTR str, int count, LPRECT rect, UINT format) | |
119 | { | |
120 | return DrawTextW(h, str, count, rect, format); | |
121 | } | |
122 | #else | |
123 | inline int DrawText(HDC h, LPCSTR str, int count, LPRECT rect, UINT format) | |
124 | { | |
125 | return DrawTextA(h, str, count, rect, format); | |
126 | } | |
127 | #endif | |
128 | ||
129 | // StartDoc | |
130 | ||
98216d40 VZ |
131 | #ifdef StartDoc |
132 | #undef StartDoc | |
133 | #endif | |
134 | ||
6bbd3344 BM |
135 | #ifdef _UNICODE |
136 | inline int StartDoc(HDC h, CONST DOCINFOW* info) | |
137 | { | |
138 | return StartDocW(h, info); | |
139 | } | |
140 | #else | |
141 | inline int StartDoc(HDC h, CONST DOCINFOA* info) | |
142 | { | |
143 | return StartDocA(h, info); | |
144 | } | |
98216d40 VZ |
145 | #endif |
146 | ||
6bbd3344 BM |
147 | // GetFirstChild... not a Windows API Function!?!?! |
148 | //ifdef GetFirstChild | |
149 | // #undef GetFirstChild | |
150 | //endif | |
98216d40 | 151 | |
6bbd3344 BM |
152 | //ifdef GetNextChild |
153 | // #undef GetNextChild | |
154 | //endif | |
155 | ||
156 | //ifdef GetNextSibling | |
157 | // #undef GetNextSibling | |
158 | //endif | |
159 | ||
160 | // GetObject | |
98216d40 VZ |
161 | |
162 | #ifdef GetObject | |
163 | #undef GetObject | |
164 | #endif | |
165 | ||
6bbd3344 BM |
166 | inline int GetObject(HGDIOBJ h, int i, LPVOID buffer) |
167 | { | |
168 | #ifdef _UNICODE | |
169 | return GetObjectW(h, i, buffer); | |
170 | #else | |
171 | return GetObjectA(h, i, buffer); | |
172 | #endif | |
173 | } | |
174 | ||
98216d40 | 175 | #endif // _WX_WINUNDEF_H_ |