]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/winundef.h
Added progdlgg.cpp to makefiles; fixed true/false in treectrl.h; made IsFree
[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 #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 #endif
22
23 #ifndef __WIN16__
24 inline BOOL GetCharWidth(HDC dc, UINT first, UINT last, LPINT buffer)
25 {
26 #ifdef _UNICODE
27 return GetCharWidthW(dc, first, last, buffer);
28 #else
29 return GetCharWidthA(dc, first, last, buffer);
30 #endif
31 }
32 #endif
33
34 // FindWindow
35
36 #ifdef FindWindow
37 #undef FindWindow
38 #endif
39
40 #ifndef __WIN16__
41 #ifdef _UNICODE
42 inline HWND FindWindow(LPCWSTR classname, LPCWSTR windowname)
43 {
44 return FindWindowW(classname, windowname);
45 }
46 #else
47 inline HWND FindWindow(LPCSTR classname, LPCSTR windowname)
48 {
49 return FindWindowA(classname, windowname);
50 }
51 #endif
52 #endif
53
54 // GetClassName
55
56 #ifdef GetClassName
57 #undef GetClassName
58 #endif
59
60 #ifndef __WIN16__
61 #ifdef _UNICODE
62 inline int GetClassName(HWND h, LPWSTR classname, int maxcount)
63 {
64 return GetClassNameW(h, classname, maxcount);
65 }
66 #else
67 inline int GetClassName(HWND h, LPSTR classname, int maxcount)
68 {
69 return GetClassNameA(h, classname, maxcount);
70 }
71 #endif
72 #endif
73
74 // GetClassInfo
75
76 #ifdef GetClassInfo
77 #undef GetClassInfo
78 #endif
79
80 #ifndef __WIN16__
81 #ifdef _UNICODE
82 inline BOOL GetClassInfo(HINSTANCE h, LPCWSTR name, LPWNDCLASSW winclass)
83 {
84 return GetClassInfoW(h, name, winclass);
85 }
86 #else
87 inline BOOL GetClassInfo(HINSTANCE h, LPCSTR name, LPWNDCLASSA winclass)
88 {
89 return GetClassInfoA(h, name, winclass);
90 }
91 #endif
92 #endif
93
94 // LoadAccelerators
95
96 #ifdef LoadAccelerators
97 #undef LoadAccelerators
98 #endif
99
100 #ifndef __WIN16__
101 #ifdef _UNICODE
102 inline HACCEL LoadAccelerators(HINSTANCE h, LPCWSTR name)
103 {
104 return LoadAcceleratorsW(h, name);
105 }
106 #else
107 inline HACCEL LoadAccelerators(HINSTANCE h, LPCSTR name)
108 {
109 return LoadAcceleratorsA(h, name);
110 }
111 #endif
112 #endif
113
114 // GetWindowProc... this isn't a Windows API function?!?!
115 //ifdef GetWindowProc
116 // #undef GetWindowProc
117 //endif
118
119
120 // DrawText
121
122 #ifdef DrawText
123 #undef DrawText
124 #endif
125
126 #ifndef __WIN16__
127 #ifdef _UNICODE
128 inline int DrawText(HDC h, LPCWSTR str, int count, LPRECT rect, UINT format)
129 {
130 return DrawTextW(h, str, count, rect, format);
131 }
132 #else
133 inline int DrawText(HDC h, LPCSTR str, int count, LPRECT rect, UINT format)
134 {
135 return DrawTextA(h, str, count, rect, format);
136 }
137 #endif
138 #endif
139
140 // StartDoc
141
142 #ifdef StartDoc
143 #undef StartDoc
144 #endif
145
146 #ifndef __WIN16__
147 #ifdef _UNICODE
148 inline int StartDoc(HDC h, CONST DOCINFOW* info)
149 {
150 return StartDocW(h, info);
151 }
152 #else
153 inline int StartDoc(HDC h, CONST DOCINFOA* info)
154 {
155 return StartDocA(h, info);
156 }
157 #endif
158 #endif
159
160 // GetFirstChild... not a Windows API Function!?!?!
161 //ifdef GetFirstChild
162 // #undef GetFirstChild
163 //endif
164
165 //ifdef GetNextChild
166 // #undef GetNextChild
167 //endif
168
169 //ifdef GetNextSibling
170 // #undef GetNextSibling
171 //endif
172
173 // GetObject
174
175 #ifdef GetObject
176 #undef GetObject
177 #endif
178
179 #ifndef __WIN16__
180 inline int GetObject(HGDIOBJ h, int i, LPVOID buffer)
181 {
182 #ifdef _UNICODE
183 return GetObjectW(h, i, buffer);
184 #else
185 return GetObjectA(h, i, buffer);
186 #endif
187 }
188 #endif
189
190 #endif // _WX_WINUNDEF_H_