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