|
|
1.1 root 1: // Microsoft Foundation Classes C++ library.
2: // Copyright (C) 1992 Microsoft Corporation,
3: // All rights reserved.
4:
5: // This source code is only intended as a supplement to the
6: // Microsoft Foundation Classes Reference and Microsoft
7: // QuickHelp documentation provided with the library.
8: // See these sources for detailed information regarding the
9: // Microsoft Foundation Classes product.
10:
11: #ifndef __AFXWIN_INL__
12: #define __AFXWIN_INL__
13:
14: #ifdef _DEBUG
15: extern char BASED_CODE _afxSzAfxWinInl[]; // defined in dumpcont.cpp
16: #undef THIS_FILE
17: #define THIS_FILE _afxSzAfxWinInl
18: #endif
19:
20: // Global helper functions
21: inline CWinApp* AfxGetApp()
22: { return afxCurrentWinApp; }
23: inline HINSTANCE AfxGetInstanceHandle()
24: { ASSERT(afxCurrentInstanceHandle != NULL);
25: return (HINSTANCE)afxCurrentInstanceHandle; }
26: inline HINSTANCE AfxGetResourceHandle()
27: { ASSERT(afxCurrentResourceHandle != NULL);
28: return (HINSTANCE)afxCurrentResourceHandle; }
29: inline const char* AfxGetAppName()
30: { ASSERT(afxCurrentAppName != NULL); return afxCurrentAppName; }
31:
32: // CSize inline functions
33: inline CSize::CSize()
34: { /* random filled */ }
35: inline CSize::CSize(int initCX, int initCY)
36: { cx = initCX; cy = initCY; }
37: inline CSize::CSize(SIZE initSize)
38: { *(SIZE*)this = initSize; }
39: inline CSize::CSize(POINT initPt)
40: { *(POINT*)this = initPt; }
41: inline CSize::CSize(DWORD dwSize)
42: #ifdef _NTWIN
43: { cx = LOWORD(dwSize); cy = HIWORD(dwSize); }
44: #else
45: { *(DWORD*)this = dwSize; }
46: #endif
47: inline BOOL CSize::operator==(SIZE size) const
48: { return (cx == size.cx && cy == size.cy); }
49: inline BOOL CSize::operator!=(SIZE size) const
50: { return (cx != size.cx || cy != size.cy); }
51: inline void CSize::operator+=(SIZE size)
52: { cx += size.cx; cy += size.cy; }
53: inline void CSize::operator-=(SIZE size)
54: { cx -= size.cx; cy -= size.cy; }
55: inline CSize CSize::operator+(SIZE size) const
56: { return CSize(cx + size.cx, cy + size.cy); }
57: inline CSize CSize::operator-(SIZE size) const
58: { return CSize(cx - size.cx, cy - size.cy); }
59:
60: // CPoint inline functions
61: inline CPoint::CPoint()
62: { /* random filled */ }
63: inline CPoint::CPoint(int initX, int initY)
64: { x = initX; y = initY; }
65: inline CPoint::CPoint(POINT initPt)
66: { *(POINT*)this = initPt; }
67: inline CPoint::CPoint(SIZE initSize)
68: { *(SIZE*)this = initSize; }
69: inline CPoint::CPoint(DWORD dwPoint)
70: #ifdef _NTWIN
71: { x = LOWORD(dwPoint); y = HIWORD(dwPoint); }
72: #else
73: { *(DWORD*)this = dwPoint; }
74: #endif
75: inline void CPoint::Offset(int xOffset, int yOffset)
76: { x += xOffset; y += yOffset; }
77: inline void CPoint::Offset(POINT point)
78: { x += point.x; y += point.y; }
79: inline void CPoint::Offset(SIZE size)
80: { x += size.cx; y += size.cy; }
81: inline BOOL CPoint::operator==(POINT point) const
82: { return (x == point.x && y == point.y); }
83: inline BOOL CPoint::operator!=(POINT point) const
84: { return (x != point.x || y != point.y); }
85: inline void CPoint::operator+=(SIZE size)
86: { x += size.cx; y += size.cy; }
87: inline void CPoint::operator-=(SIZE size)
88: { x -= size.cx; y -= size.cy; }
89: inline CPoint CPoint::operator+(SIZE size) const
90: { return CPoint(x + size.cx, y + size.cy); }
91: inline CPoint CPoint::operator-(SIZE size) const
92: { return CPoint(x - size.cx, y - size.cy); }
93: inline CSize CPoint::operator-(POINT point) const
94: { return CSize(x - point.x, y - point.y); }
95:
96:
97: // CRect inline functions
98: inline CRect::CRect()
99: { /* random filled */ }
100: inline CRect::CRect(int l, int t, int r, int b)
101: { left = l; top = t; right = r; bottom = b; }
102: inline CRect::CRect(const RECT& srcRect)
103: { ::CopyRect((LPRECT)this, (LPRECT)&srcRect); }
104: inline CRect::CRect(LPRECT lpSrcRect)
105: { ::CopyRect((LPRECT)this, lpSrcRect); }
106: inline CRect::CRect(POINT point, SIZE size)
107: { left = point.x; top = point.y;
108: right = point.x + size.cx; bottom = point.y + size.cy; }
109: inline int CRect::Width() const
110: { return right - left; }
111: inline int CRect::Height() const
112: { return bottom - top; }
113: inline CSize CRect::Size() const
114: { return CSize(right - left, bottom - top); }
115: inline CPoint& CRect::TopLeft()
116: { return *((CPoint*)this); }
117: inline CPoint& CRect::BottomRight()
118: { return *((CPoint*)this+1); }
119: inline CRect::operator LPRECT()
120: { return (LPRECT)this; }
121: inline BOOL CRect::IsRectEmpty() const
122: { return ::IsRectEmpty((LPRECT)this); }
123: inline BOOL CRect::IsRectNull() const
124: { return (left == 0 && right == 0 && top == 0 && bottom == 0); }
125: inline BOOL CRect::PtInRect(POINT point) const
126: { return ::PtInRect((LPRECT)this, point); }
127: inline void CRect::SetRect(int x1, int y1, int x2, int y2)
128: { ::SetRect((LPRECT)this, x1, y1, x2, y2); }
129: inline void CRect::SetRectEmpty()
130: { ::SetRectEmpty((LPRECT)this); }
131: inline void CRect::CopyRect(LPRECT lpSrcRect)
132: { ::CopyRect((LPRECT)this, lpSrcRect); }
133: inline BOOL CRect::EqualRect(LPRECT lpRect) const
134: { return ::EqualRect((LPRECT)this, lpRect); }
135: inline void CRect::InflateRect(int x, int y)
136: { ::InflateRect((LPRECT)this, x, y); }
137: inline void CRect::InflateRect(SIZE size)
138: { ::InflateRect((LPRECT)this, size.cx, size.cy); }
139: inline void CRect::OffsetRect(int x, int y)
140: { ::OffsetRect((LPRECT)this, x, y); }
141: inline void CRect::OffsetRect(POINT point)
142: { ::OffsetRect((LPRECT)this, point.x, point.y); }
143: inline void CRect::OffsetRect(SIZE size)
144: { ::OffsetRect((LPRECT)this, size.cx, size.cy); }
145: inline int CRect::IntersectRect(LPRECT lpRect1, LPRECT lpRect2)
146: { return ::IntersectRect((LPRECT)this, lpRect1, lpRect2);}
147: inline int CRect::UnionRect(LPRECT lpRect1, LPRECT lpRect2)
148: { return ::UnionRect((LPRECT)this, lpRect1, lpRect2); }
149: inline void CRect::operator=(const RECT& srcRect)
150: { ::CopyRect((LPRECT)this, (LPRECT)&srcRect); }
151: inline BOOL CRect::operator==(const RECT& rect) const
152: { return ::EqualRect((LPRECT)this, (LPRECT)&rect); }
153: inline BOOL CRect::operator!=(const RECT& rect) const
154: { return !::EqualRect((LPRECT)this, (LPRECT)&rect); }
155: inline void CRect::operator+=(POINT point)
156: { ::OffsetRect((LPRECT)this, point.x, point.y); }
157: inline void CRect::operator-=(POINT point)
158: { ::OffsetRect((LPRECT)this, -point.x, -point.y); }
159: inline void CRect::operator&=(const RECT& rect)
160: { ::IntersectRect((LPRECT)this, this, (LPRECT)&rect); }
161: inline void CRect::operator|=(const RECT& rect)
162: { ::UnionRect((LPRECT)this, this, (LPRECT)&rect); }
163: inline CRect CRect::operator+(POINT pt) const
164: { CRect rect(*this); ::OffsetRect(&rect, pt.x, pt.y); return rect; }
165: inline CRect CRect::operator-(POINT pt) const
166: { CRect rect(*this); ::OffsetRect(&rect, -pt.x, -pt.y); return rect; }
167: inline CRect CRect::operator&(const RECT& rect2) const
168: { CRect rect; ::IntersectRect(&rect, (LPRECT)this, (LPRECT)&rect2);
169: return rect; }
170: inline CRect CRect::operator|(const RECT& rect2) const
171: { CRect rect; ::UnionRect(&rect, (LPRECT)this, (LPRECT)&rect2);
172: return rect; }
173: #if (WINVER >= 0x030a)
174: inline BOOL CRect::SubtractRect(LPRECT lpRectSrc1, LPRECT lpRectSrc2)
175: { return ::SubtractRect((LPRECT)this, lpRectSrc1, lpRectSrc2); }
176: #endif /* WINVER >= 0x030a */
177:
178: inline CArchive& operator<<(CArchive& ar, SIZE size)
179: { ar.Write(&size, sizeof(SIZE));
180: return ar; }
181: inline CArchive& operator<<(CArchive& ar, POINT point)
182: { ar.Write(&point, sizeof(POINT));
183: return ar; }
184: inline CArchive& operator<<(CArchive& ar, const RECT& rect)
185: { ar.Write(&rect, sizeof(RECT));
186: return ar; }
187: inline CArchive& operator>>(CArchive& ar, SIZE& size)
188: { ar.Read(&size, sizeof(SIZE));
189: return ar; }
190: inline CArchive& operator>>(CArchive& ar, POINT& point)
191: { ar.Read(&point, sizeof(POINT));
192: return ar; }
193: inline CArchive& operator>>(CArchive& ar, RECT& rect)
194: { ar.Read(&rect, sizeof(RECT));
195: return ar; }
196:
197:
198: // CResourceException inline functions
199: inline CResourceException::CResourceException()
200: { }
201:
202: // CGdiObject inline functions
203: inline HANDLE CGdiObject::GetSafeHandle() const
204: { return this == NULL ? NULL : m_hObject; }
205: inline CGdiObject::CGdiObject()
206: { m_hObject = NULL; }
207: inline int CGdiObject::GetObject(int nCount, void FAR* lpObject) const
208: { return ::GetObject(m_hObject, nCount, lpObject); }
209: inline BOOL CGdiObject::CreateStockObject(int nIndex)
210: { return Attach(::GetStockObject(nIndex)); }
211: inline BOOL CGdiObject::UnrealizeObject()
212: #ifdef _NTWIN
213: { return TRUE; }
214: #else
215: { return ::UnrealizeObject(m_hObject); }
216: #endif
217:
218: // CPen inline functions
219: inline CPen* CPen::FromHandle(HPEN hPen)
220: { return (CPen*) CGdiObject::FromHandle(hPen); }
221: inline CPen::CPen()
222: { }
223: inline BOOL CPen::CreatePen(int nPenStyle, int nWidth, DWORD crColor)
224: { return Attach(::CreatePen(nPenStyle, nWidth, crColor)); }
225: inline BOOL CPen::CreatePenIndirect(LPLOGPEN lpLogPen)
226: { return Attach(::CreatePenIndirect(lpLogPen)); }
227:
228: // CBrush inline functions
229: inline CBrush* CBrush::FromHandle(HBRUSH hBrush)
230: { return (CBrush*) CGdiObject::FromHandle(hBrush); }
231: inline CBrush::CBrush()
232: { }
233: inline BOOL CBrush::CreateSolidBrush(DWORD crColor)
234: { return Attach(::CreateSolidBrush(crColor)); }
235: inline BOOL CBrush::CreateHatchBrush(int nIndex, DWORD crColor)
236: { return Attach(::CreateHatchBrush(nIndex, crColor)); }
237: inline BOOL CBrush::CreateBrushIndirect(LPLOGBRUSH lpLogBrush)
238: { return Attach(::CreateBrushIndirect(lpLogBrush)); }
239: inline BOOL CBrush::CreateDIBPatternBrush(GLOBALHANDLE hPackedDIB, UINT nUsage)
240: { return Attach(::CreateDIBPatternBrush(hPackedDIB, nUsage)); }
241: inline BOOL CBrush::CreatePatternBrush(CBitmap* pBitmap)
242: { return Attach(::CreatePatternBrush((HBITMAP)pBitmap->m_hObject)); }
243:
244: // CFont inline functions
245: inline CFont* CFont::FromHandle(HFONT hFont)
246: { return (CFont*) CGdiObject::FromHandle(hFont); }
247: inline CFont::CFont()
248: { }
249: inline BOOL CFont::CreateFontIndirect(LPLOGFONT lpLogFont)
250: { return Attach(::CreateFontIndirect(lpLogFont)); }
251: inline BOOL CFont::CreateFont(int nHeight, int nWidth, int nEscapement,
252: int nOrientation, int nWeight, BYTE bItalic, BYTE bUnderline,
253: BYTE cStrikeOut, BYTE nCharSet, BYTE nOutPrecision,
254: BYTE nClipPrecision, BYTE nQuality, BYTE nPitchAndFamily,
255: LPCSTR lpFacename)
256: { return Attach(::CreateFont(nHeight, nWidth, nEscapement,
257: nOrientation, nWeight, bItalic, bUnderline, cStrikeOut,
258: nCharSet, nOutPrecision, nClipPrecision, nQuality,
259: nPitchAndFamily, lpFacename)); }
260:
261: // CBitmap inline functions
262: inline CBitmap* CBitmap::FromHandle(HBITMAP hBitmap)
263: { return (CBitmap*) CGdiObject::FromHandle(hBitmap); }
264: inline CBitmap::CBitmap()
265: { }
266: inline BOOL CBitmap::CreateBitmap(int nWidth, int nHeight, BYTE nPlanes,
267: BYTE nBitcount, const void FAR* lpBits)
268: { return Attach(::CreateBitmap(nWidth, nHeight, nPlanes, nBitcount, lpBits)); }
269: inline BOOL CBitmap::CreateBitmapIndirect(LPBITMAP lpBitmap)
270: { return Attach(::CreateBitmapIndirect(lpBitmap)); }
271:
272: inline DWORD CBitmap::SetBitmapBits(DWORD dwCount, const void FAR* lpBits)
273: { return ::SetBitmapBits((HBITMAP)m_hObject, dwCount, (const BYTE*)lpBits); }
274: inline DWORD CBitmap::GetBitmapBits(DWORD dwCount, void FAR* lpBits) const
275: { return ::GetBitmapBits((HBITMAP)m_hObject, dwCount, lpBits); }
276: inline CSize CBitmap::SetBitmapDimension(int nWidth, int nHeight)
277: #ifdef _NTWIN
278: { SIZE size;
279: VERIFY(::SetBitmapDimensionEx((HBITMAP)m_hObject, nWidth, nHeight, &size));
280: return size; }
281: #else
282: { return ::SetBitmapDimension((HBITMAP)m_hObject, nWidth, nHeight); }
283: #endif
284:
285: inline CSize CBitmap::GetBitmapDimension() const
286: #ifdef _NTWIN
287: { SIZE size;
288: VERIFY(::GetBitmapDimensionEx((HBITMAP)m_hObject, &size));
289: return size; }
290: #else
291: { return ::GetBitmapDimension((HBITMAP)m_hObject); }
292: #endif
293: inline BOOL CBitmap::LoadBitmap(LPCSTR lpBitmapName)
294: { return Attach(::LoadBitmap(AfxGetResourceHandle(), lpBitmapName));}
295: inline BOOL CBitmap::LoadBitmap(UINT nIDBitmap)
296: { return Attach(::LoadBitmap(AfxGetResourceHandle(),
297: MAKEINTRESOURCE(nIDBitmap))); }
298: inline BOOL CBitmap::LoadOEMBitmap(UINT nIDBitmap)
299: { return Attach(::LoadBitmap(NULL, MAKEINTRESOURCE(nIDBitmap))); }
300: inline BOOL CBitmap::CreateCompatibleBitmap(CDC* pDC, int nWidth, int nHeight)
301: { return Attach(::CreateCompatibleBitmap(pDC->m_hDC, nWidth, nHeight)); }
302: inline BOOL CBitmap::CreateDiscardableBitmap(CDC* pDC, int nWidth, int nHeight)
303: { return Attach(::CreateDiscardableBitmap(pDC->m_hDC, nWidth, nHeight)); }
304:
305: // CPalette inline functions
306: inline CPalette* CPalette::FromHandle(HPALETTE hPalette)
307: { return (CPalette*) CGdiObject::FromHandle(hPalette); }
308: inline CPalette::CPalette()
309: { }
310: inline BOOL CPalette::CreatePalette(LPLOGPALETTE lpLogPalette)
311: { return Attach(::CreatePalette(lpLogPalette)); }
312: inline UINT CPalette::GetPaletteEntries(UINT nStartIndex, UINT nNumEntries,
313: LPPALETTEENTRY lpPaletteColors) const
314: { return ::GetPaletteEntries((HPALETTE)m_hObject, nStartIndex,
315: nNumEntries, lpPaletteColors); }
316: inline UINT CPalette::SetPaletteEntries(UINT nStartIndex, UINT nNumEntries,
317: LPPALETTEENTRY lpPaletteColors)
318: { return ::SetPaletteEntries((HPALETTE)m_hObject, nStartIndex,
319: nNumEntries, lpPaletteColors); }
320: inline void CPalette::AnimatePalette(UINT nStartIndex, UINT nNumEntries,
321: LPPALETTEENTRY lpPaletteColors)
322: { ::AnimatePalette((HPALETTE)m_hObject, nStartIndex, nNumEntries,
323: lpPaletteColors); }
324: inline UINT CPalette::GetNearestPaletteIndex(DWORD crColor) const
325: { return ::GetNearestPaletteIndex((HPALETTE)m_hObject, crColor); }
326: inline BOOL CPalette::ResizePalette(UINT nNumEntries)
327: { return ::ResizePalette((HPALETTE)m_hObject, nNumEntries); }
328:
329:
330: // CRgn inline functions
331: inline CRgn* CRgn::FromHandle(HRGN hRgn)
332: { return (CRgn*) CGdiObject::FromHandle(hRgn); }
333: inline CRgn::CRgn()
334: { }
335: inline BOOL CRgn::CreateRectRgn(int x1, int y1, int x2, int y2)
336: { return Attach(::CreateRectRgn(x1, y1, x2, y2)); }
337: inline BOOL CRgn::CreateRectRgnIndirect(LPRECT lpRect)
338: { return Attach(::CreateRectRgnIndirect(lpRect)); }
339: inline BOOL CRgn::CreateEllipticRgn(int x1, int y1, int x2, int y2)
340: { return Attach(::CreateEllipticRgn(x1, y1, x2, y2)); }
341: inline BOOL CRgn::CreateEllipticRgnIndirect(LPRECT lpRect)
342: { return Attach(::CreateEllipticRgnIndirect(lpRect)); }
343: inline BOOL CRgn::CreatePolygonRgn(LPPOINT lpPoints, int nCount, int nMode)
344: { return Attach(::CreatePolygonRgn(lpPoints, nCount, nMode)); }
345: inline BOOL CRgn::CreatePolyPolygonRgn(LPPOINT lpPoints, LPINT lpPolyCounts, int nCount, int nPolyFillMode)
346: { return Attach(::CreatePolyPolygonRgn(lpPoints, lpPolyCounts, nCount, nPolyFillMode)); }
347: inline BOOL CRgn::CreateRoundRectRgn(int x1, int y1, int x2, int y2, int x3, int y3)
348: { return Attach(::CreateRoundRectRgn(x1, y1, x2, y2, x3, y3)); }
349: inline void CRgn::SetRectRgn(int x1, int y1, int x2, int y2)
350: { ::SetRectRgn((HRGN)m_hObject, x1, y1, x2, y2); }
351: inline void CRgn::SetRectRgn(LPRECT lpRect)
352: { ::SetRectRgn((HRGN)m_hObject, lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); }
353: inline int CRgn::CombineRgn(CRgn* pRgn1, CRgn* pRgn2, int nCombineMode)
354: { return ::CombineRgn((HRGN)m_hObject, (HRGN)pRgn1->m_hObject,
355: (HRGN)pRgn2->GetSafeHandle(), nCombineMode); }
356: inline int CRgn::CopyRgn(CRgn* pRgnSrc)
357: { return ::CombineRgn((HRGN)m_hObject, (HRGN)pRgnSrc->m_hObject, NULL, RGN_COPY); }
358: inline BOOL CRgn::EqualRgn(CRgn* pRgn) const
359: { return ::EqualRgn((HRGN)m_hObject, (HRGN)pRgn->m_hObject); }
360: inline int CRgn::OffsetRgn(int x, int y)
361: { return ::OffsetRgn((HRGN)m_hObject, x, y); }
362: inline int CRgn::OffsetRgn(POINT point)
363: { return ::OffsetRgn((HRGN)m_hObject, point.x, point.y); }
364: inline int CRgn::GetRgnBox(LPRECT lpRect) const
365: { return ::GetRgnBox((HRGN)m_hObject, lpRect); }
366: inline BOOL CRgn::PtInRegion(int x, int y) const
367: { return ::PtInRegion((HRGN)m_hObject, x, y); }
368: inline BOOL CRgn::PtInRegion(POINT point) const
369: { return ::PtInRegion((HRGN)m_hObject, point.x, point.y); }
370: inline BOOL CRgn::RectInRegion(LPRECT lpRect) const
371: { return ::RectInRegion((HRGN)m_hObject, lpRect); }
372:
373: // CDC inline functions
374: inline HDC CDC::GetSafeHdc() const
375: { return this == NULL ? NULL : m_hDC; }
376: inline CDC::CDC()
377: { m_hDC = NULL; }
378: #ifdef _NTWIN
379: //REVIEW: NT Header file difference
380: inline BOOL CDC::CreateDC(LPCSTR lpDriverName,
381: LPCSTR lpDeviceName, LPCSTR lpOutput,
382: const void FAR* lpInitData)
383: { return Attach(::CreateDC(lpDriverName,
384: lpDeviceName, lpOutput, (const DEVMODE*)lpInitData)); }
385: inline BOOL CDC::CreateIC(LPCSTR lpDriverName,
386: LPCSTR lpDeviceName, LPCSTR lpOutput,
387: const void FAR* lpInitData)
388: { return Attach(::CreateIC(lpDriverName,
389: lpDeviceName, lpOutput, (LPDEVMODE)lpInitData)); }
390: #else
391: inline BOOL CDC::CreateIC(LPCSTR lpDriverName,
392: LPCSTR lpDeviceName, LPCSTR lpOutput,
393: const void FAR* lpInitData)
394: { return Attach(::CreateIC(lpDriverName,
395: lpDeviceName, lpOutput, lpInitData)); }
396: inline BOOL CDC::CreateDC(LPCSTR lpDriverName,
397: LPCSTR lpDeviceName, LPCSTR lpOutput,
398: const void FAR* lpInitData)
399: { return Attach(::CreateDC(lpDriverName,
400: lpDeviceName, lpOutput, lpInitData)); }
401: #endif
402: inline BOOL CDC::CreateCompatibleDC(CDC* pDC)
403: { return Attach(::CreateCompatibleDC(pDC->GetSafeHdc())); }
404: inline int CDC::ExcludeUpdateRgn(CWnd* pWnd)
405: { return ::ExcludeUpdateRgn(m_hDC, pWnd->m_hWnd); }
406: #ifndef _NTWIN
407: inline CPoint CDC::GetDCOrg() const
408: { return ::GetDCOrg(m_hDC); }
409: #endif
410: inline int CDC::SaveDC() const
411: { return ::SaveDC(m_hDC); }
412: inline BOOL CDC::RestoreDC(int nSavedDC)
413: { return ::RestoreDC(m_hDC, nSavedDC); }
414: inline int CDC::GetDeviceCaps(int nIndex) const
415: { return ::GetDeviceCaps(m_hDC, nIndex); }
416:
417: inline CPoint CDC::GetBrushOrg() const
418: #ifdef _NTWIN
419: { POINT point;
420: VERIFY(::GetBrushOrgEx(m_hDC, &point));
421: return point; }
422: #else
423: { return ::GetBrushOrg(m_hDC); }
424: #endif
425:
426: inline CPoint CDC::SetBrushOrg(int x, int y)
427: #ifdef _NTWIN
428: { POINT point;
429: VERIFY(::SetBrushOrgEx(m_hDC, x, y, &point));
430: return point; }
431: #else
432: { return ::SetBrushOrg(m_hDC, x, y); }
433: #endif
434:
435: inline CPoint CDC::SetBrushOrg(POINT point)
436: #ifdef _NTWIN
437: { VERIFY(::SetBrushOrgEx(m_hDC, point.x, point.y, &point));
438: return point; }
439: #else
440: { return ::SetBrushOrg(m_hDC, point.x, point.y); }
441: #endif
442:
443: inline int CDC::EnumObjects(int nObjectType,
444: int (FAR PASCAL EXPORT* lpfn)(LPSTR, LPSTR), LPSTR lpData)
445: #ifdef STRICT
446: { return ::EnumObjects(m_hDC, nObjectType, (GOBJENUMPROC)lpfn, (LPARAM)lpData); }
447: #else
448: { return ::EnumObjects(m_hDC, nObjectType, (GOBJENUMPROC)lpfn, lpData); }
449: #endif
450: inline CGdiObject* CDC::SelectObject(CGdiObject* pObject)
451: { return SelectGdiObject(m_hDC, pObject->m_hObject); }
452: inline CGdiObject* CDC::SelectStockObject(int nIndex)
453: { ASSERT(::GetStockObject(nIndex) != NULL);
454: return SelectGdiObject(m_hDC, ::GetStockObject(nIndex)); }
455: inline CPen* CDC::SelectObject(CPen* pPen)
456: { return (CPen*) SelectGdiObject(m_hDC, pPen->m_hObject); }
457: inline CBrush* CDC::SelectObject(CBrush* pBrush)
458: { return (CBrush*) SelectGdiObject(m_hDC, pBrush->m_hObject); }
459: inline CFont* CDC::SelectObject(CFont* pFont)
460: { return (CFont*) SelectGdiObject(m_hDC, pFont->m_hObject); }
461: inline CBitmap* CDC::SelectObject(CBitmap* pBitmap)
462: { return (CBitmap*) SelectGdiObject(m_hDC, pBitmap->m_hObject);}
463: inline int CDC::SelectObject(CRgn* pRgn)
464: { return (int)::SelectObject(m_hDC, pRgn->m_hObject); }
465: inline DWORD CDC::GetNearestColor(DWORD crColor) const
466: { return ::GetNearestColor(m_hDC, crColor); }
467: inline UINT CDC::RealizePalette()
468: { return ::RealizePalette(m_hDC); }
469: inline void CDC::UpdateColors()
470: { ::UpdateColors(m_hDC); }
471: inline DWORD CDC::GetBkColor() const
472: { return ::GetBkColor(m_hDC); }
473: inline DWORD CDC::SetBkColor(DWORD crColor)
474: { return ::SetBkColor(m_hDC, crColor); }
475: inline int CDC::GetBkMode() const
476: { return ::GetBkMode(m_hDC); }
477: inline int CDC::SetBkMode(int nBkMode)
478: { return ::SetBkMode(m_hDC, nBkMode); }
479: inline int CDC::GetPolyFillMode() const
480: { return ::GetPolyFillMode(m_hDC); }
481: inline int CDC::SetPolyFillMode(int nPolyFillMode)
482: { return ::SetPolyFillMode(m_hDC, nPolyFillMode); }
483: inline int CDC::GetROP2() const
484: { return ::GetROP2(m_hDC); }
485: inline int CDC::SetROP2(int nDrawMode)
486: { return ::SetROP2(m_hDC, nDrawMode); }
487: inline int CDC::GetStretchBltMode() const
488: { return ::GetStretchBltMode(m_hDC); }
489: inline int CDC::SetStretchBltMode(int nStretchMode)
490: { return ::SetStretchBltMode(m_hDC, nStretchMode); }
491: inline DWORD CDC::GetTextColor() const
492: { return ::GetTextColor(m_hDC); }
493: inline DWORD CDC::SetTextColor(DWORD crColor)
494: { return ::SetTextColor(m_hDC, crColor); }
495: inline int CDC::GetMapMode() const
496: { return ::GetMapMode(m_hDC); }
497: inline int CDC::SetMapMode(int nMapMode)
498: { return ::SetMapMode(m_hDC, nMapMode); }
499: inline CPoint CDC::GetViewportOrg() const
500: #ifdef _NTWIN
501: { POINT point;
502: VERIFY(::GetViewportOrgEx(m_hDC, &point));
503: return point; }
504: #else
505: { return ::GetViewportOrg(m_hDC); }
506: #endif
507: inline CPoint CDC::SetViewportOrg(int x, int y)
508: #ifdef _NTWIN
509: { POINT point;
510: VERIFY(::SetViewportOrgEx(m_hDC, x, y, &point));
511: return point; }
512: #else
513: { return ::SetViewportOrg(m_hDC, x, y); }
514: #endif
515: inline CPoint CDC::SetViewportOrg(POINT point)
516: #ifdef _NTWIN
517: { VERIFY(::SetViewportOrgEx(m_hDC, point.x, point.y, &point));
518: return point; }
519: #else
520: { return ::SetViewportOrg(m_hDC, point.x, point.y); }
521: #endif
522: inline CPoint CDC::OffsetViewportOrg(int nWidth, int nHeight)
523: #ifdef _NTWIN
524: { POINT point;
525: VERIFY(::OffsetViewportOrgEx(m_hDC, nWidth, nHeight, &point));
526: return point; }
527: #else
528: { return ::OffsetViewportOrg(m_hDC, nWidth, nHeight); }
529: #endif
530: inline CSize CDC::GetViewportExt() const
531: #ifdef _NTWIN
532: { SIZE size;
533: VERIFY(::GetViewportExtEx(m_hDC, &size));
534: return size; }
535: #else
536: { return ::GetViewportExt(m_hDC); }
537: #endif
538: inline CSize CDC::SetViewportExt(int x, int y)
539: #ifdef _NTWIN
540: { SIZE size;
541: VERIFY(::SetViewportExtEx(m_hDC, x, y, &size));
542: return size; }
543: #else
544: { return ::SetViewportExt(m_hDC, x, y); }
545: #endif
546: inline CSize CDC::SetViewportExt(SIZE size)
547: #ifdef _NTWIN
548: { VERIFY(::SetViewportExtEx(m_hDC, size.cx, size.cy, &size));
549: return size; }
550: #else
551: { return ::SetViewportExt(m_hDC, size.cx, size.cy); }
552: #endif
553: inline CSize CDC::ScaleViewportExt(int xNum, int xDenom, int yNum, int yDenom)
554: #ifdef _NTWIN
555: { SIZE size;
556: VERIFY(::ScaleViewportExtEx(m_hDC, xNum, xDenom, yNum, yDenom, &size));
557: return size; }
558: #else
559: { return ::ScaleViewportExt(m_hDC, xNum, xDenom, yNum, yDenom);}
560: #endif
561: inline CPoint CDC::GetWindowOrg() const
562: #ifdef _NTWIN
563: { POINT point;
564: VERIFY(::GetWindowOrgEx(m_hDC, &point));
565: return point; }
566: #else
567: { return ::GetWindowOrg(m_hDC); }
568: #endif
569: inline CPoint CDC::SetWindowOrg(int x, int y)
570: #ifdef _NTWIN
571: { POINT point;
572: VERIFY(::SetWindowOrgEx(m_hDC, x, y, &point));
573: return point; }
574: #else
575: { return ::SetWindowOrg(m_hDC, x, y); }
576: #endif
577: inline CPoint CDC::SetWindowOrg(POINT point)
578: #ifdef _NTWIN
579: { VERIFY(::SetWindowOrgEx(m_hDC, point.x, point.y, &point));
580: return point; }
581: #else
582: { return ::SetWindowOrg(m_hDC, point.x, point.y); }
583: #endif
584: inline CPoint CDC::OffsetWindowOrg(int nWidth, int nHeight)
585: #ifdef _NTWIN
586: { POINT point;
587: VERIFY(::OffsetWindowOrgEx(m_hDC, nWidth, nHeight, &point));
588: return point; }
589: #else
590: { return ::OffsetWindowOrg(m_hDC, nWidth, nHeight); }
591: #endif
592: inline CSize CDC::SetWindowExt(SIZE size)
593: #ifdef _NTWIN
594: { VERIFY(::SetWindowExtEx(m_hDC, size.cx, size.cy, &size));
595: return size; }
596: #else
597: { return ::SetWindowExt(m_hDC, size.cx, size.cy); }
598: #endif
599: inline CSize CDC::ScaleWindowExt(int xNum, int xDenom, int yNum, int yDenom)
600: #ifdef _NTWIN
601: { SIZE size;
602: VERIFY(::ScaleWindowExtEx(m_hDC, xNum, xDenom, yNum, yDenom, &size));
603: return size; }
604: #else
605: { return ::ScaleWindowExt(m_hDC, xNum, xDenom, yNum, yDenom);}
606: #endif
607:
608: inline void CDC::DPtoLP(LPPOINT lpPoints, int nCount /* = 1 */) const
609: { VERIFY(::DPtoLP(m_hDC, lpPoints, nCount)); }
610: inline void CDC::DPtoLP(LPRECT lpRect) const
611: { VERIFY(::DPtoLP(m_hDC, (LPPOINT)lpRect, 2)); }
612: inline void CDC::LPtoDP(LPPOINT lpPoints, int nCount /* = 1 */) const
613: { VERIFY(::LPtoDP(m_hDC, lpPoints, nCount)); }
614: inline void CDC::LPtoDP(LPRECT lpRect) const
615: { VERIFY(::LPtoDP(m_hDC, (LPPOINT)lpRect, 2)); }
616: inline BOOL CDC::FillRgn(CRgn* pRgn, CBrush* pBrush)
617: { return ::FillRgn(m_hDC, (HRGN)pRgn->m_hObject, (HBRUSH)pBrush->m_hObject); }
618: inline BOOL CDC::FrameRgn(CRgn* pRgn, CBrush* pBrush, int nWidth, int nHeight)
619: { return ::FrameRgn(m_hDC, (HRGN)pRgn->m_hObject, (HBRUSH)pBrush->m_hObject,
620: nWidth, nHeight); }
621: inline BOOL CDC::InvertRgn(CRgn* pRgn)
622: { return ::InvertRgn(m_hDC, (HRGN)pRgn->m_hObject); }
623: inline BOOL CDC::PaintRgn(CRgn* pRgn)
624: { return ::PaintRgn(m_hDC, (HRGN)pRgn->m_hObject); }
625: inline int CDC::GetClipBox(LPRECT lpRect) const
626: { return ::GetClipBox(m_hDC, lpRect); }
627: inline int CDC::SelectClipRgn(CRgn* pRgn)
628: { return ::SelectClipRgn(m_hDC, (HRGN)pRgn->GetSafeHandle()); }
629: inline int CDC::ExcludeClipRect(int x1, int y1, int x2, int y2)
630: { return ::ExcludeClipRect(m_hDC, x1, y1, x2, y2); }
631: inline int CDC::ExcludeClipRect(LPRECT lpRect)
632: { return ::ExcludeClipRect(m_hDC, lpRect->left, lpRect->top,
633: lpRect->right, lpRect->bottom); }
634: inline int CDC::IntersectClipRect(int x1, int y1, int x2, int y2)
635: { return ::IntersectClipRect(m_hDC, x1, y1, x2, y2); }
636: inline int CDC::IntersectClipRect(LPRECT lpRect)
637: { return ::IntersectClipRect(m_hDC, lpRect->left, lpRect->top,
638: lpRect->right, lpRect->bottom); }
639: inline int CDC::OffsetClipRgn(int x, int y)
640: { return ::OffsetClipRgn(m_hDC, x, y); }
641: inline int CDC::OffsetClipRgn(SIZE size)
642: { return ::OffsetClipRgn(m_hDC, size.cx, size.cy); }
643: inline BOOL CDC::PtVisible(int x, int y) const
644: { return ::PtVisible(m_hDC, x, y); }
645: inline BOOL CDC::PtVisible(POINT point) const
646: { return ::PtVisible(m_hDC, point.x, point.y); }
647: inline BOOL CDC::RectVisible(LPRECT lpRect) const
648: { return ::RectVisible(m_hDC, lpRect); }
649: inline CPoint CDC::GetCurrentPosition() const
650: #ifdef _NTWIN
651: { POINT point;
652: VERIFY(::GetCurrentPositionEx(m_hDC, &point));
653: return point; }
654: #else
655: { return ::GetCurrentPosition(m_hDC); }
656: #endif
657: inline CPoint CDC::MoveTo(int x, int y)
658: #ifdef _NTWIN
659: { POINT point;
660: VERIFY(::MoveToEx(m_hDC, x, y, &point));
661: return point; }
662: #else
663: { return ::MoveTo(m_hDC, x, y); }
664: #endif
665: inline CPoint CDC::MoveTo(POINT point)
666: #ifdef _NTWIN
667: { VERIFY(::MoveToEx(m_hDC, point.x, point.y, &point));
668: return point; }
669: #else
670: { return ::MoveTo(m_hDC, point.x, point.y); }
671: #endif
672: inline BOOL CDC::LineTo(int x, int y)
673: { return ::LineTo(m_hDC, x, y); }
674: inline BOOL CDC::LineTo(POINT point)
675: { return ::LineTo(m_hDC, point.x, point.y); }
676: inline BOOL CDC::Arc(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
677: { return ::Arc(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4); }
678: inline BOOL CDC::Arc(LPRECT lpRect, POINT ptStart, POINT ptEnd)
679: { return ::Arc(m_hDC, lpRect->left, lpRect->top,
680: lpRect->right, lpRect->bottom, ptStart.x, ptStart.y,
681: ptEnd.x, ptEnd.y); }
682: inline BOOL CDC::Polyline(LPPOINT lpPoints, int nCount)
683: { return ::Polyline(m_hDC, lpPoints, nCount); }
684: inline void CDC::FillRect(LPRECT lpRect, CBrush* pBrush)
685: { ::FillRect(m_hDC, lpRect, (HBRUSH)pBrush->m_hObject); }
686: inline void CDC::FrameRect(LPRECT lpRect, CBrush* pBrush)
687: { ::FrameRect(m_hDC, lpRect, (HBRUSH)pBrush->m_hObject); }
688: inline void CDC::InvertRect(LPRECT lpRect)
689: { ::InvertRect(m_hDC, lpRect); }
690: inline BOOL CDC::DrawIcon(int x, int y, HICON hIcon)
691: { return ::DrawIcon(m_hDC, x, y, hIcon); }
692: inline BOOL CDC::DrawIcon(POINT point, HICON hIcon)
693: { return ::DrawIcon(m_hDC, point.x, point.y, hIcon); }
694: inline BOOL CDC::Chord(int x1, int y1, int x2, int y2, int x3, int y3,
695: int x4, int y4)
696: { return ::Chord(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4); }
697: inline BOOL CDC::Chord(LPRECT lpRect, POINT ptStart, POINT ptEnd)
698: { return ::Chord(m_hDC, lpRect->left, lpRect->top,
699: lpRect->right, lpRect->bottom, ptStart.x, ptStart.y,
700: ptEnd.x, ptEnd.y); }
701: inline void CDC::DrawFocusRect(LPRECT lpRect)
702: { ::DrawFocusRect(m_hDC, lpRect); }
703: inline BOOL CDC::Ellipse(int x1, int y1, int x2, int y2)
704: { return ::Ellipse(m_hDC, x1, y1, x2, y2); }
705: inline BOOL CDC::Ellipse(LPRECT lpRect)
706: { return ::Ellipse(m_hDC, lpRect->left, lpRect->top,
707: lpRect->right, lpRect->bottom); }
708: inline BOOL CDC::Pie(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
709: { return ::Pie(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4); }
710: inline BOOL CDC::Pie(LPRECT lpRect, POINT ptStart, POINT ptEnd)
711: { return ::Pie(m_hDC, lpRect->left, lpRect->top,
712: lpRect->right, lpRect->bottom, ptStart.x, ptStart.y,
713: ptEnd.x, ptEnd.y); }
714: inline BOOL CDC::Polygon(LPPOINT lpPoints, int nCount)
715: { return ::Polygon(m_hDC, lpPoints, nCount); }
716: inline BOOL CDC::PolyPolygon(LPPOINT lpPoints, LPINT lpPolyCounts, int nCount)
717: { return ::PolyPolygon(m_hDC, lpPoints, lpPolyCounts, nCount); }
718: inline BOOL CDC::Rectangle(int x1, int y1, int x2, int y2)
719: { return ::Rectangle(m_hDC, x1, y1, x2, y2); }
720: inline BOOL CDC::Rectangle(LPRECT lpRect)
721: { return ::Rectangle(m_hDC, lpRect->left, lpRect->top,
722: lpRect->right, lpRect->bottom); }
723: inline BOOL CDC::RoundRect(int x1, int y1, int x2, int y2, int x3, int y3)
724: { return ::RoundRect(m_hDC, x1, y1, x2, y2, x3, y3); }
725: inline BOOL CDC::RoundRect(LPRECT lpRect, POINT point)
726: { return ::RoundRect(m_hDC, lpRect->left, lpRect->top,
727: lpRect->right, lpRect->bottom, point.x, point.y); }
728: inline BOOL CDC::PatBlt(int x, int y, int nWidth, int nHeight, DWORD dwRop)
729: { return ::PatBlt(m_hDC, x, y, nWidth, nHeight, dwRop); }
730: inline BOOL CDC::BitBlt(int x, int y, int nWidth, int nHeight, CDC* pSrcDC,
731: int xSrc, int ySrc, DWORD dwRop)
732: { return ::BitBlt(m_hDC, x, y, nWidth, nHeight,
733: pSrcDC->GetSafeHdc(), xSrc, ySrc, dwRop); }
734: inline BOOL CDC::StretchBlt(int x, int y, int nWidth, int nHeight, CDC* pSrcDC,
735: int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, DWORD dwRop)
736: { return ::StretchBlt(m_hDC, x, y, nWidth, nHeight,
737: pSrcDC->GetSafeHdc(), xSrc, ySrc, nSrcWidth, nSrcHeight,
738: dwRop); }
739: inline DWORD CDC::GetPixel(int x, int y) const
740: { return ::GetPixel(m_hDC, x, y); }
741: inline DWORD CDC::GetPixel(POINT point) const
742: { return ::GetPixel(m_hDC, point.x, point.y); }
743: inline DWORD CDC::SetPixel(int x, int y, DWORD crColor)
744: { return ::SetPixel(m_hDC, x, y, crColor); }
745: inline DWORD CDC::SetPixel(POINT point, DWORD crColor)
746: { return ::SetPixel(m_hDC, point.x, point.y, crColor); }
747: inline BOOL CDC::FloodFill(int x, int y, DWORD crColor)
748: { return ::FloodFill(m_hDC, x, y, crColor); }
749: inline BOOL CDC::ExtFloodFill(int x, int y, DWORD crColor, UINT nFillType)
750: { return ::ExtFloodFill(m_hDC, x, y, crColor, nFillType); }
751: inline BOOL CDC::TextOut(int x, int y, const CString& str)
752: { return ::TextOut(m_hDC, x, y, (const char*)str, str.GetLength()); }
753: inline BOOL CDC::TextOut(int x, int y, LPCSTR lpString, int nCount)
754: { return ::TextOut(m_hDC, x, y, lpString, nCount); }
755: inline BOOL CDC::ExtTextOut(int x, int y, UINT nOptions, LPRECT lpRect,
756: LPCSTR lpString, UINT nCount, LPINT lpDxWidths)
757: { return ::ExtTextOut(m_hDC, x, y, nOptions, lpRect,
758: lpString, nCount, lpDxWidths); }
759: inline CSize CDC::TabbedTextOut(int x, int y, LPCSTR lpString, int nCount,
760: int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin)
761: { return ::TabbedTextOut(m_hDC, x, y, (LPSTR)lpString, nCount,
762: nTabPositions, lpnTabStopPositions, nTabOrigin); }
763: //NTHACK
764: inline int CDC::DrawText(LPCSTR lpString, int nCount, LPRECT lpRect,
765: UINT nFormat)
766: { return ::DrawText(m_hDC, lpString, nCount, lpRect,
767: nFormat); }
768: inline CSize CDC::GetTextExtent(LPCSTR lpString, int nCount) const
769: #ifdef _NTWIN
770: { SIZE size;
771: VERIFY(::GetTextExtentPoint(m_hDC, lpString, nCount, &size));
772: return size; }
773: #else
774: { return ::GetTextExtent(m_hDC, lpString, nCount); }
775: #endif
776: inline CSize CDC::GetTabbedTextExtent(LPCSTR lpString, int nCount,
777: int nTabPositions, LPINT lpnTabStopPositions) const
778: { return ::GetTabbedTextExtent(m_hDC, lpString, nCount,
779: nTabPositions, lpnTabStopPositions); }
780: inline BOOL CDC::GrayString(CBrush* pBrush,
781: BOOL (FAR PASCAL EXPORT* lpfnOutput)(HDC, DWORD, int),
782: DWORD lpData, int nCount,
783: int x, int y, int nWidth, int nHeight)
784: { return ::GrayString(m_hDC, (HBRUSH)pBrush->m_hObject,
785: (GRAYSTRINGPROC)lpfnOutput, lpData, nCount, x, y, nWidth, nHeight); }
786: inline UINT CDC::GetTextAlign() const
787: { return ::GetTextAlign(m_hDC); }
788: inline UINT CDC::SetTextAlign(UINT nFlags)
789: { return ::SetTextAlign(m_hDC, nFlags); }
790: inline int CDC::GetTextFace(int nCount, LPSTR lpFacename) const
791: { return ::GetTextFace(m_hDC, nCount, lpFacename); }
792: inline BOOL CDC::GetTextMetrics(LPTEXTMETRIC lpMetrics) const
793: { return ::GetTextMetrics(m_hDC, lpMetrics); }
794: inline int CDC::SetTextJustification(int nBreakExtra, int nBreakCount)
795: { return ::SetTextJustification(m_hDC, nBreakExtra,
796: nBreakCount); }
797: inline int CDC::GetTextCharacterExtra() const
798: { return ::GetTextCharacterExtra(m_hDC); }
799: inline int CDC::SetTextCharacterExtra(int nCharExtra)
800: { return ::SetTextCharacterExtra(m_hDC, nCharExtra); }
801: inline BOOL CDC::GetCharWidth(UINT nFirstChar, UINT nLastChar, LPINT lpBuffer) const
802: { return ::GetCharWidth(m_hDC, nFirstChar, nLastChar,
803: lpBuffer); }
804: inline DWORD CDC::SetMapperFlags(DWORD dwFlag)
805: { return ::SetMapperFlags(m_hDC, dwFlag); }
806: inline CSize CDC::GetAspectRatioFilter() const
807: #ifdef _NTWIN
808: { SIZE size;
809: VERIFY(::GetAspectRatioFilterEx(m_hDC, &size));
810: return size; }
811: #else
812: { return ::GetAspectRatioFilter(m_hDC); }
813: #endif
814: inline BOOL CDC::ScrollDC(int dx, int dy, LPRECT lpRectScroll, LPRECT lpRectClip,
815: CRgn* pRgnUpdate, LPRECT lpRectUpdate)
816: { return ::ScrollDC(m_hDC, dx, dy, lpRectScroll,
817: lpRectClip, (HRGN)pRgnUpdate->GetSafeHandle(), lpRectUpdate); }
818: inline BOOL CDC::PlayMetaFile(HANDLE hMF)
819: { return ::PlayMetaFile(m_hDC, (HMETAFILE)hMF); }
820: inline CSize CDC::GetWindowExt() const
821: #ifdef _NTWIN
822: { SIZE size;
823: VERIFY(::GetWindowExtEx(m_hDC, &size));
824: return size; }
825: #else
826: { return ::GetWindowExt(m_hDC); }
827: #endif
828: inline CSize CDC::SetWindowExt(int x, int y)
829: #ifdef _NTWIN
830: { SIZE size;
831: VERIFY(::SetWindowExtEx(m_hDC, x, y, &size));
832: return size; }
833: #else
834: { return ::SetWindowExt(m_hDC, x, y); }
835: #endif
836:
837: // Printer Escape Functions
838: inline int CDC::Escape(int nEscape, int nCount, LPCSTR lpInData, void FAR* lpOutData)
839: { return ::Escape(m_hDC, nEscape, nCount, lpInData, lpOutData);}
840:
841: #ifndef _NTWIN
842: inline int CDC::StartDoc(LPCSTR pDocName)
843: { return ::Escape(m_hDC, STARTDOC, _fstrlen(pDocName),
844: pDocName, NULL);}
845: #endif
846:
847: #if (WINVER >= 0x030a)
848: inline BOOL CDC::QueryAbort() const
849: { return ::QueryAbort(m_hDC, 0); }
850: inline int CDC::StartDoc(LPDOCINFO lpDocInfo)
851: { return ::StartDoc(m_hDC, lpDocInfo);}
852: inline int CDC::StartPage()
853: { return ::StartPage(m_hDC); }
854: inline int CDC::EndPage()
855: { return ::EndPage(m_hDC);}
856: inline int CDC::SetAbortProc(BOOL (FAR PASCAL EXPORT* lpfn)(HDC, int))
857: { return ::SetAbortProc(m_hDC, (ABORTPROC)lpfn);}
858: inline int CDC::AbortDoc()
859: { return ::AbortDoc(m_hDC);}
860: inline int CDC::EndDoc()
861: { return ::EndDoc(m_hDC);}
862: #else
863: inline int CDC::StartPage()
864: { return 0; /* not implemented */ }
865: inline int CDC::EndPage()
866: { return ::Escape(m_hDC, NEWFRAME, 0, NULL, NULL);}
867: inline int CDC::SetAbortProc(BOOL (FAR PASCAL EXPORT* lpfn)(HDC, int))
868: { return ::Escape(m_hDC, SETABORTPROC, 0, (LPCSTR)lpfn, NULL);}
869: inline int CDC::AbortDoc()
870: { return ::Escape(m_hDC, ABORTDOC, 0, NULL, NULL);}
871: inline int CDC::EndDoc()
872: { return ::Escape(m_hDC, ENDDOC, 0, NULL, NULL);}
873: #endif
874:
875: // CDC 3.1 Specific functions
876: #if (WINVER >= 0x030a)
877: inline UINT CDC::SetBoundsRect(const RECT FAR* lpRectBounds, UINT flags)
878: { return ::SetBoundsRect(m_hDC, (LPRECT)lpRectBounds, flags); } //NTHACK
879: inline UINT CDC::GetBoundsRect(LPRECT lpRectBounds, UINT flags)
880: { return ::GetBoundsRect(m_hDC, lpRectBounds, flags); }
881: inline UINT CDC::GetOutlineTextMetrics(UINT cbData, OUTLINETEXTMETRIC FAR* lpotm) const
882: // REVIEW: NT header file difference
883: { return (UINT)::GetOutlineTextMetrics(m_hDC, cbData, lpotm); }
884: inline BOOL CDC::GetCharABCWidths(UINT nFirst, UINT nLast, LPABC lpabc) const
885: { return ::GetCharABCWidths(m_hDC, nFirst, nLast, lpabc); }
886: inline DWORD CDC::GetFontData(DWORD dwTable, DWORD dwOffset, LPVOID lpData,
887: DWORD cbData) const
888: { return ::GetFontData(m_hDC, dwTable, dwOffset, lpData, cbData); }
889: inline int CDC::GetKerningPairs(int nPairs, KERNINGPAIR FAR* lpkrnpair) const
890: { return ::GetKerningPairs(m_hDC, nPairs, lpkrnpair); }
891: inline DWORD CDC::GetGlyphOutline(UINT nChar, UINT nFormat, GLYPHMETRICS FAR* lpgm,
892: DWORD cbBuffer, void FAR* lpBuffer, const MAT2 FAR* lpmat2) const
893: { return ::GetGlyphOutline(m_hDC, nChar, nFormat,
894: lpgm, cbBuffer, lpBuffer, (MAT2*)lpmat2); } //NTHACK
895: #endif /* WINVER >= 0x030a */
896:
897: // CMetaFileDC inline functions
898: inline CMetaFileDC::CMetaFileDC()
899: { }
900: inline BOOL CMetaFileDC::Create(LPCSTR lpFilename /* = NULL */)
901: { return Attach(::CreateMetaFile(lpFilename)); }
902: inline HANDLE CMetaFileDC::Close()
903: { return ::CloseMetaFile(Detach()); }
904: inline BOOL CMetaFileDC::SelectObject(CGdiObject* pObject)
905: { return (BOOL)::SelectObject(m_hDC, pObject->m_hObject); }
906: inline BOOL CMetaFileDC::SelectStockObject(int nIndex)
907: { ASSERT(::GetStockObject(nIndex) != NULL);
908: return (BOOL)::SelectObject(m_hDC, ::GetStockObject(nIndex)); }
909:
910:
911: // CMenu inline functions
912: inline CMenu::CMenu()
913: { m_hMenu = NULL; }
914: inline BOOL CMenu::CreateMenu()
915: { return Attach(::CreateMenu()); }
916: inline BOOL CMenu::CreatePopupMenu()
917: { return Attach(::CreatePopupMenu()); }
918: inline HMENU CMenu::GetSafeHmenu() const
919: { return this == NULL ? NULL : m_hMenu; }
920: inline BOOL CMenu::DeleteMenu(UINT nPosition, UINT nFlags)
921: { return ::DeleteMenu(m_hMenu, nPosition, nFlags); }
922: inline BOOL CMenu::AppendMenu(UINT nFlags, UINT nIDNewItem /* = 0 */, LPCSTR lpNewItem /* = NULL */)
923: { return ::AppendMenu(m_hMenu, nFlags, nIDNewItem, lpNewItem); }
924: inline BOOL CMenu::AppendMenu(UINT nFlags, UINT nIDNewItem, const CBitmap* pBmp)
925: { return ::AppendMenu(m_hMenu, nFlags | MF_BITMAP, nIDNewItem,
926: MAKEINTRESOURCE(pBmp->m_hObject)); }
927: inline BOOL CMenu::CheckMenuItem(UINT nIDCheckItem, UINT nCheck)
928: //REVIEW: NT header file difference
929: { return (BOOL)::CheckMenuItem(m_hMenu, nIDCheckItem, nCheck); }
930: inline BOOL CMenu::EnableMenuItem(UINT nIDEnableItem, UINT nEnable)
931: { return ::EnableMenuItem(m_hMenu, nIDEnableItem, nEnable); }
932: inline UINT CMenu::GetMenuItemCount() const
933: { return ::GetMenuItemCount(m_hMenu); }
934: inline UINT CMenu::GetMenuItemID(int nPos) const
935: { return ::GetMenuItemID(m_hMenu, nPos); }
936: inline UINT CMenu::GetMenuState(UINT nID, UINT nFlags) const
937: { return ::GetMenuState(m_hMenu, nID, nFlags); }
938: inline int CMenu::GetMenuString(UINT nIDItem, LPSTR lpString, int nMaxCount, UINT nFlags) const
939: { return ::GetMenuString(m_hMenu, nIDItem, lpString, nMaxCount, nFlags); }
940: inline CMenu* CMenu::GetSubMenu(int nPos) const
941: { return CMenu::FromHandle(::GetSubMenu(m_hMenu, nPos)); }
942: inline BOOL CMenu::InsertMenu(UINT nPosition, UINT nFlags, UINT nIDNewItem /* = 0 */,
943: LPCSTR lpNewItem /* = NULL */)
944: { return ::InsertMenu(m_hMenu, nPosition, nFlags, nIDNewItem, lpNewItem); }
945: inline BOOL CMenu::InsertMenu(UINT nPosition, UINT nFlags, UINT nIDNewItem, const CBitmap* pBmp)
946: { return ::InsertMenu(m_hMenu, nPosition, nFlags | MF_BITMAP, nIDNewItem, MAKEINTRESOURCE(pBmp->m_hObject)); }
947: inline BOOL CMenu::ModifyMenu(UINT nPosition, UINT nFlags, UINT nIDNewItem /* = 0 */, LPCSTR lpNewItem /* = NULL */)
948: { return ::ModifyMenu(m_hMenu, nPosition, nFlags, nIDNewItem, lpNewItem); }
949: inline BOOL CMenu::ModifyMenu(UINT nPosition, UINT nFlags, UINT nIDNewItem, const CBitmap* pBmp)
950: { return ::ModifyMenu(m_hMenu, nPosition, nFlags | MF_BITMAP, nIDNewItem, MAKEINTRESOURCE(pBmp->m_hObject)); }
951: inline BOOL CMenu::RemoveMenu(UINT nPosition, UINT nFlags)
952: { return ::RemoveMenu(m_hMenu, nPosition, nFlags); }
953: inline BOOL CMenu::SetMenuItemBitmaps(UINT nPosition, UINT nFlags,
954: const CBitmap* pBmpUnchecked, const CBitmap* pBmpChecked)
955: { return ::SetMenuItemBitmaps(m_hMenu, nPosition, nFlags,
956: (HBITMAP)pBmpUnchecked->GetSafeHandle(),
957: (HBITMAP)pBmpChecked->GetSafeHandle()); }
958: inline BOOL CMenu::LoadMenu(LPCSTR lpMenuName)
959: { return Attach(::LoadMenu(AfxGetResourceHandle(), lpMenuName)); }
960: inline BOOL CMenu::LoadMenu(UINT nIDMenu)
961: { return Attach(::LoadMenu(AfxGetResourceHandle(),
962: MAKEINTRESOURCE(nIDMenu))); }
963: inline BOOL CMenu::LoadMenuIndirect(const void FAR* lpMenuTemplate)
964: { return Attach(::LoadMenuIndirect((LPVOID)lpMenuTemplate)); } //NTHACK
965: inline BOOL CMenu::TrackPopupMenu(UINT nFlags, int x, int y,
966: const CWnd* pWnd, const RECT FAR* lpRect)
967: { return ::TrackPopupMenu(m_hMenu, nFlags, x, y, 0, pWnd->m_hWnd,
968: lpRect); }
969:
970: // CWnd
971: inline HWND CWnd::GetSafeHwnd() const
972: { return this == NULL ? NULL : m_hWnd; }
973: inline CWnd::CWnd()
974: { m_hWnd = NULL; }
975: inline CWnd::CWnd(HWND hWnd)
976: { m_hWnd = hWnd; }
977: inline DWORD CWnd::GetStyle() const
978: { return (DWORD)GetWindowLong(m_hWnd, GWL_STYLE); }
979: inline DWORD CWnd::GetExStyle() const
980: { return (DWORD)GetWindowLong(m_hWnd, GWL_EXSTYLE); }
981: inline LONG CWnd::SendMessage(UINT message, UINT wParam, LONG lParam)
982: { return ::SendMessage(m_hWnd, message, wParam, lParam); }
983: inline BOOL CWnd::PostMessage(UINT message, UINT wParam, LONG lParam)
984: { return ::PostMessage(m_hWnd, message, wParam, lParam); }
985: inline void CWnd::SetWindowText(LPCSTR lpString)
986: { ::SetWindowText(m_hWnd, lpString); }
987: inline int CWnd::GetWindowText(LPSTR lpString, int nMaxCount) const
988: { return ::GetWindowText(m_hWnd, lpString, nMaxCount); }
989: inline int CWnd::GetWindowTextLength() const
990: { return ::GetWindowTextLength(m_hWnd); }
991: inline void CWnd::GetWindowText(CString& rString) const
992: { int nLen = GetWindowTextLength();
993: GetWindowText(rString.GetBufferSetLength(nLen), nLen+1); }
994: inline void CWnd::SetFont(CFont* pFont, BOOL bRedraw /* = TRUE */)
995: { SendMessage(WM_SETFONT, (UINT)pFont->GetSafeHandle(), bRedraw); }
996: inline CFont* CWnd::GetFont()
997: { return CFont::FromHandle((HFONT)SendMessage(WM_GETFONT)); }
998: inline CMenu* CWnd::GetMenu() const
999: { return CMenu::FromHandle(::GetMenu(m_hWnd)); }
1000: inline BOOL CWnd::SetMenu(CMenu* pMenu)
1001: { return ::SetMenu(m_hWnd, pMenu->GetSafeHmenu()); }
1002: inline void CWnd::DrawMenuBar()
1003: { ::DrawMenuBar(m_hWnd); }
1004: inline CMenu* CWnd::GetSystemMenu(BOOL bRevert) const
1005: { return CMenu::FromHandle(::GetSystemMenu(m_hWnd, bRevert)); }
1006: inline BOOL CWnd::HiliteMenuItem(CMenu* pMenu, UINT nIDHiliteItem, UINT nHilite)
1007: { return ::HiliteMenuItem(m_hWnd, pMenu->m_hMenu, nIDHiliteItem, nHilite); }
1008: inline int CWnd::GetDlgCtrlID() const
1009: { return ::GetDlgCtrlID(m_hWnd); }
1010: inline void CWnd::CloseWindow()
1011: { ::CloseWindow(m_hWnd); }
1012: inline BOOL CWnd::OpenIcon()
1013: { return ::OpenIcon(m_hWnd); }
1014: inline BOOL CWnd::IsIconic() const
1015: { return ::IsIconic(m_hWnd); }
1016: inline BOOL CWnd::IsZoomed() const
1017: { return ::IsZoomed(m_hWnd); }
1018: inline void CWnd::MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint /* = TRUE */)
1019: { ::MoveWindow(m_hWnd, x, y, nWidth, nHeight, bRepaint); }
1020: inline void CWnd::MoveWindow(LPRECT lpRect, BOOL bRepaint /* = TRUE */)
1021: { ::MoveWindow(m_hWnd, lpRect->left, lpRect->top, lpRect->right - lpRect->left,
1022: lpRect->bottom - lpRect->top, bRepaint); }
1023: inline BOOL CWnd::SetWindowPos(const CWnd* pWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
1024: #if (WINVER >= 0x030a)
1025: { return ::SetWindowPos(m_hWnd, pWndInsertAfter->GetSafeHwnd(),
1026: x, y, cx, cy, nFlags); }
1027: #else
1028: { ::SetWindowPos(m_hWnd, pWndInsertAfter->GetSafeHwnd(),
1029: x, y, cx, cy, nFlags); return TRUE; }
1030: #endif /* WINVER >= 0x030a */
1031: inline UINT CWnd::ArrangeIconicWindows()
1032: { return ::ArrangeIconicWindows(m_hWnd); }
1033: inline void CWnd::BringWindowToTop()
1034: { ::BringWindowToTop(m_hWnd); }
1035: inline void CWnd::GetWindowRect(LPRECT lpRect) const
1036: { ::GetWindowRect(m_hWnd, lpRect); }
1037: inline void CWnd::GetClientRect(LPRECT lpRect) const
1038: { ::GetClientRect(m_hWnd, lpRect); }
1039: #if (WINVER >= 0x030a)
1040: inline BOOL CWnd::GetWindowPlacement(WINDOWPLACEMENT FAR* lpwndpl) const
1041: { return ::GetWindowPlacement(m_hWnd, lpwndpl); }
1042: inline BOOL CWnd::SetWindowPlacement(const WINDOWPLACEMENT FAR* lpwndpl)
1043: { return ::SetWindowPlacement(m_hWnd, (WINDOWPLACEMENT*)lpwndpl); } //NTHACK
1044: inline void CWnd::MapWindowPoints(CWnd* pwndTo, LPPOINT lpPoint, UINT nCount) const
1045: { ::MapWindowPoints(m_hWnd, pwndTo->GetSafeHwnd(), lpPoint, nCount); }
1046: inline void CWnd::MapWindowPoints(CWnd* pwndTo, LPRECT lpRect) const
1047: { ::MapWindowPoints(m_hWnd, pwndTo->GetSafeHwnd(), (LPPOINT)lpRect, 2); }
1048: #endif /* WINVER >= 0x030a */
1049: inline void CWnd::ClientToScreen(LPPOINT lpPoint) const
1050: { ::ClientToScreen(m_hWnd, lpPoint); }
1051: inline void CWnd::ClientToScreen(LPRECT lpRect) const
1052: { ::ClientToScreen(m_hWnd, (LPPOINT)lpRect);
1053: ::ClientToScreen(m_hWnd, ((LPPOINT)lpRect)+1); }
1054: inline void CWnd::ScreenToClient(LPPOINT lpPoint) const
1055: { ::ScreenToClient(m_hWnd, lpPoint); }
1056: inline void CWnd::ScreenToClient(LPRECT lpRect) const
1057: { ::ScreenToClient(m_hWnd, (LPPOINT)lpRect);
1058: ::ScreenToClient(m_hWnd, ((LPPOINT)lpRect)+1); }
1059: inline CDC* CWnd::BeginPaint(LPPAINTSTRUCT lpPaint)
1060: { return CDC::FromHandle(::BeginPaint(m_hWnd, lpPaint)); }
1061: inline void CWnd::EndPaint(LPPAINTSTRUCT lpPaint)
1062: { ::EndPaint(m_hWnd, lpPaint); }
1063: inline CDC* CWnd::GetDC()
1064: { return CDC::FromHandle(::GetDC(m_hWnd)); }
1065: #if (WINVER >= 0x030a)
1066: inline CDC* CWnd::GetDCEx(CRgn* prgnClip, DWORD flags)
1067: { return CDC::FromHandle(::GetDCEx(m_hWnd, (HRGN)prgnClip->GetSafeHandle(), flags)); }
1068: #endif /* WINVER >= 0x030a */
1069: inline CDC* CWnd::GetWindowDC()
1070: { return CDC::FromHandle(::GetWindowDC(m_hWnd)); }
1071: inline int CWnd::ReleaseDC(CDC* pDC)
1072: { return ::ReleaseDC(m_hWnd, pDC->m_hDC); }
1073: inline void CWnd::UpdateWindow()
1074: { ::UpdateWindow(m_hWnd); }
1075: inline void CWnd::SetRedraw(BOOL bRedraw /* = TRUE */)
1076: { ::SendMessage(m_hWnd, WM_SETREDRAW, bRedraw, 0); }
1077: inline BOOL CWnd::GetUpdateRect(LPRECT lpRect, BOOL bErase /* = FALSE */)
1078: { return ::GetUpdateRect(m_hWnd, lpRect, bErase); }
1079: inline int CWnd::GetUpdateRgn(CRgn* pRgn, BOOL bErase /* = FALSE */)
1080: { return ::GetUpdateRgn(m_hWnd, (HRGN)pRgn->m_hObject, bErase); }
1081: inline void CWnd::Invalidate(BOOL bErase /* = TRUE */)
1082: { ::InvalidateRect(m_hWnd, (LPRECT)NULL, bErase); }
1083: inline void CWnd::InvalidateRect(LPRECT lpRect, BOOL bErase /* = TRUE */)
1084: { ::InvalidateRect(m_hWnd, lpRect, bErase); }
1085: inline void CWnd::InvalidateRgn(CRgn* pRgn, BOOL bErase /* = TRUE */)
1086: { ::InvalidateRgn(m_hWnd, (HRGN)pRgn->GetSafeHandle(), bErase); }
1087: inline void CWnd::ValidateRect(LPRECT lpRect)
1088: { ::ValidateRect(m_hWnd, lpRect); }
1089: inline void CWnd::ValidateRgn(CRgn* pRgn)
1090: { ::ValidateRgn(m_hWnd, (HRGN)pRgn->GetSafeHandle()); }
1091: inline BOOL CWnd::ShowWindow(int nCmdShow)
1092: { return ::ShowWindow(m_hWnd, nCmdShow); }
1093: inline BOOL CWnd::IsWindowVisible() const
1094: { return ::IsWindowVisible(m_hWnd); }
1095: inline void CWnd::ShowOwnedPopups(BOOL bShow /* = TRUE */)
1096: { ::ShowOwnedPopups(m_hWnd, bShow); }
1097: #if (WINVER >= 0x030a)
1098: inline BOOL CWnd::LockWindowUpdate()
1099: { return ::LockWindowUpdate(m_hWnd); }
1100: inline BOOL CWnd::RedrawWindow(const RECT FAR* lpRectUpdate,
1101: CRgn* prgnUpdate,
1102: UINT flags /* = RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE */)
1103: { return ::RedrawWindow(m_hWnd, lpRectUpdate, (HRGN)prgnUpdate->GetSafeHandle(), flags); }
1104: inline BOOL CWnd::EnableScrollBar(int nBar,
1105: UINT nArrowFlags /* = ESB_ENABLE_BOTH */)
1106: { return (BOOL)::EnableScrollBar(m_hWnd, nBar, nArrowFlags); }
1107: #endif /* WINVER >= 0x030a */
1108: inline UINT CWnd::SetTimer(int nIDEvent, UINT nElapse,
1109: UINT (FAR PASCAL EXPORT* lpfnTimer)(HWND, UINT, int, DWORD))
1110: { return ::SetTimer(m_hWnd, nIDEvent, nElapse,
1111: (TIMERPROC)lpfnTimer); }
1112: inline BOOL CWnd::KillTimer(int nIDEvent)
1113: { return ::KillTimer(m_hWnd, nIDEvent); }
1114: inline BOOL CWnd::IsWindowEnabled() const
1115: { return ::IsWindowEnabled(m_hWnd); }
1116: inline BOOL CWnd::EnableWindow(BOOL bEnable /* = TRUE */)
1117: { return ::EnableWindow(m_hWnd, bEnable); }
1118: inline CWnd* CWnd::GetActiveWindow()
1119: { return CWnd::FromHandle(::GetActiveWindow()); }
1120: inline CWnd* CWnd::SetActiveWindow()
1121: { return CWnd::FromHandle(::SetActiveWindow(m_hWnd)); }
1122: inline CWnd* CWnd::GetCapture()
1123: { return CWnd::FromHandle(::GetCapture()); }
1124: inline CWnd* CWnd::SetCapture()
1125: { return CWnd::FromHandle(::SetCapture(m_hWnd)); }
1126: inline CWnd* CWnd::GetFocus()
1127: { return CWnd::FromHandle(::GetFocus()); }
1128: inline CWnd* CWnd::SetFocus()
1129: { return CWnd::FromHandle(::SetFocus(m_hWnd)); }
1130: inline CWnd* CWnd::SetSysModalWindow()
1131: { return CWnd::FromHandle(::SetSysModalWindow(m_hWnd)); }
1132: inline CWnd* CWnd::GetSysModalWindow()
1133: { return CWnd::FromHandle(::GetSysModalWindow()); }
1134: inline CWnd* CWnd::GetDesktopWindow()
1135: { return CWnd::FromHandle(::GetDesktopWindow()); }
1136: inline void CWnd::CheckDlgButton(int nIDButton, UINT nCheck)
1137: { ::CheckDlgButton(m_hWnd, nIDButton, nCheck); }
1138: inline void CWnd::CheckRadioButton(int nIDFirstButton, int nIDLastButton,
1139: int nIDCheckButton)
1140: { ::CheckRadioButton(m_hWnd, nIDFirstButton, nIDLastButton, nIDCheckButton); }
1141: inline int CWnd::DlgDirList(LPSTR lpPathSpec, int nIDListBox,
1142: int nIDStaticPath, UINT nFileType)
1143: { return ::DlgDirList(m_hWnd, lpPathSpec, nIDListBox,
1144: nIDStaticPath, nFileType); }
1145: inline int CWnd::DlgDirListComboBox(LPSTR lpPathSpec, int nIDComboBox,
1146: int nIDStaticPath, UINT nFileType)
1147: { return ::DlgDirListComboBox(m_hWnd, lpPathSpec,
1148: nIDComboBox, nIDStaticPath, nFileType); }
1149: inline BOOL CWnd::DlgDirSelect(LPSTR lpString, int nIDListBox)
1150: #ifdef _NTWIN
1151: { return ::DlgDirSelectEx(m_hWnd, lpString, _MAX_PATH, nIDListBox); }
1152: #else
1153: { return ::DlgDirSelect(m_hWnd, lpString, nIDListBox); }
1154: #endif
1155: inline BOOL CWnd::DlgDirSelectComboBox(LPSTR lpString, int nIDComboBox)
1156: #ifdef _NTWIN
1157: { return ::DlgDirSelectComboBoxEx(m_hWnd, lpString, _MAX_PATH, nIDComboBox);}
1158: #else
1159: { return ::DlgDirSelectComboBox(m_hWnd, lpString, nIDComboBox);}
1160: #endif
1161: inline CWnd* CWnd::GetDlgItem(int nID) const
1162: { return CWnd::FromHandle(::GetDlgItem(m_hWnd, nID)); }
1163: inline UINT CWnd::GetDlgItemInt(int nID, BOOL* lpTrans /* = NULL */,
1164: BOOL bSigned /* = TRUE */) const
1165: { return ::GetDlgItemInt(m_hWnd, nID, lpTrans, bSigned);}
1166: inline int CWnd::GetDlgItemText(int nID, LPSTR lpStr, int nMaxCount) const
1167: { return ::GetDlgItemText(m_hWnd, nID, lpStr, nMaxCount);}
1168: inline CWnd* CWnd::GetNextDlgGroupItem(CWnd* pWndCtl, BOOL bPrevious /* = FALSE */) const
1169: { return CWnd::FromHandle(::GetNextDlgGroupItem(m_hWnd,
1170: pWndCtl->m_hWnd, bPrevious)); }
1171: inline CWnd* CWnd::GetNextDlgTabItem(CWnd* pWndCtl, BOOL bPrevious /* = FALSE */) const
1172: { return CWnd::FromHandle(::GetNextDlgTabItem(m_hWnd,
1173: pWndCtl->m_hWnd, bPrevious)); }
1174: inline UINT CWnd::IsDlgButtonChecked(int nIDButton) const
1175: { return ::IsDlgButtonChecked(m_hWnd, nIDButton); }
1176: inline LONG CWnd::SendDlgItemMessage(int nID, UINT message, UINT wParam /* = 0 */, LONG lParam /* = 0 */)
1177: { return ::SendDlgItemMessage(m_hWnd, nID, message, wParam, lParam); }
1178: inline void CWnd::SetDlgItemInt(int nID, UINT nValue, BOOL bSigned /* = TRUE */)
1179: { ::SetDlgItemInt(m_hWnd, nID, nValue, bSigned); }
1180: inline void CWnd::SetDlgItemText(int nID, LPCSTR lpString)
1181: { ::SetDlgItemText(m_hWnd, nID, lpString); }
1182: inline int CWnd::GetScrollPos(int nBar) const
1183: { return ::GetScrollPos(m_hWnd, nBar); }
1184: inline void CWnd::GetScrollRange(int nBar, LPINT lpMinPos, LPINT lpMaxPos) const
1185: { ::GetScrollRange(m_hWnd, nBar, lpMinPos, lpMaxPos); }
1186: inline void CWnd::ScrollWindow(int xAmount, int yAmount,
1187: const RECT FAR* lpRect /* = NULL */,
1188: const RECT FAR* lpClipRect /* = NULL */)
1189: {::ScrollWindow(m_hWnd, xAmount, yAmount, lpRect, lpClipRect); }
1190: #if (WINVER >= 0x030a)
1191: inline int CWnd::ScrollWindowEx(int dx, int dy,
1192: const RECT FAR* lpScrollRect, const RECT FAR* lpClipRect,
1193: CRgn* prgnUpdate, LPRECT lpUpdateRect, UINT flags)
1194: { return ::ScrollWindowEx(m_hWnd, dx, dy, lpScrollRect, lpClipRect,
1195: (HRGN)prgnUpdate->GetSafeHandle(), lpUpdateRect, flags); }
1196: #endif /* WINVER >= 0x030a */
1197: inline int CWnd::SetScrollPos(int nBar, int nPos, BOOL bRedraw /* = TRUE */)
1198: { return ::SetScrollPos(m_hWnd, nBar, nPos, bRedraw); }
1199: inline void CWnd::SetScrollRange(int nBar, int nMinPos, int nMaxPos,
1200: BOOL bRedraw /* = TRUE */)
1201: { ::SetScrollRange(m_hWnd, nBar, nMinPos, nMaxPos, bRedraw); }
1202: inline void CWnd::ShowScrollBar(UINT nBar, BOOL bShow /* = TRUE */)
1203: { ::ShowScrollBar(m_hWnd, nBar, bShow); }
1204: inline CWnd* CWnd::ChildWindowFromPoint(POINT point) const
1205: { return CWnd::FromHandle(::ChildWindowFromPoint(m_hWnd, point)); }
1206: inline CWnd* CWnd::FindWindow(LPCSTR lpClassName, LPCSTR lpWindowName)
1207: { return CWnd::FromHandle(
1208: ::FindWindow(lpClassName, lpWindowName)); }
1209: inline CWnd* CWnd::GetNextWindow(UINT nFlag /* = GW_HWNDNEXT */) const
1210: { return CWnd::FromHandle(::GetNextWindow(m_hWnd, nFlag)); }
1211: inline CWnd* CWnd::GetTopWindow() const
1212: { return CWnd::FromHandle(::GetTopWindow(m_hWnd)); }
1213: inline CWnd* CWnd::GetWindow(UINT nCmd) const
1214: { return CWnd::FromHandle(::GetWindow(m_hWnd, nCmd)); }
1215: inline CWnd* CWnd::GetLastActivePopup() const
1216: { return CWnd::FromHandle(::GetLastActivePopup(m_hWnd)); }
1217: inline BOOL CWnd::IsChild(CWnd* pWnd) const
1218: { return ::IsChild(m_hWnd, pWnd->GetSafeHwnd()); }
1219: inline CWnd* CWnd::GetParent() const
1220: { return CWnd::FromHandle(::GetParent(m_hWnd)); }
1221: inline CWnd* CWnd::SetParent(CWnd* pWndNewParent)
1222: { return CWnd::FromHandle(::SetParent(m_hWnd,
1223: pWndNewParent->GetSafeHwnd())); }
1224: inline CWnd* CWnd::WindowFromPoint(POINT point)
1225: { return CWnd::FromHandle(::WindowFromPoint(point)); }
1226: inline BOOL CWnd::FlashWindow(BOOL bInvert)
1227: { return ::FlashWindow(m_hWnd, bInvert); }
1228: inline int CWnd::MessageBox(LPCSTR lpText, LPCSTR lpCaption /* = NULL */,
1229: UINT nType /* = MB_OK */)
1230: #ifdef _NTWIN
1231: { return ::MessageBoxEx(GetSafeHwnd(), lpText, lpCaption, nType, 0); }
1232: #else
1233: { return ::MessageBox(GetSafeHwnd(), lpText, lpCaption,nType); }
1234: #endif
1235: inline BOOL CWnd::ChangeClipboardChain(HWND hWndNext)
1236: { return ::ChangeClipboardChain(m_hWnd, hWndNext); }
1237: inline HWND CWnd::SetClipboardViewer()
1238: { return ::SetClipboardViewer(m_hWnd); }
1239: inline BOOL CWnd::OpenClipboard()
1240: { return ::OpenClipboard(m_hWnd); }
1241: #if (WINVER >= 0x030a)
1242: inline CWnd* CWnd::GetOpenClipboardWindow()
1243: { return CWnd::FromHandle(::GetOpenClipboardWindow()); }
1244: #endif /* WINVER >= 0x030a */
1245: inline CWnd* CWnd::GetClipboardOwner()
1246: { return CWnd::FromHandle(::GetClipboardOwner()); }
1247: inline CWnd* CWnd::GetClipboardViewer()
1248: { return CWnd::FromHandle(::GetClipboardViewer()); }
1249: inline void CWnd::CreateCaret(CBitmap* pBitmap)
1250: { ::CreateCaret(m_hWnd, (HBITMAP)pBitmap->GetSafeHandle(), 0, 0); }
1251: inline void CWnd::CreateSolidCaret(int nWidth, int nHeight)
1252: { ::CreateCaret(m_hWnd, (HBITMAP)0, nWidth, nHeight); }
1253: inline void CWnd::CreateGrayCaret(int nWidth, int nHeight)
1254: { ::CreateCaret(m_hWnd, (HBITMAP)1, nWidth, nHeight); }
1255: inline CPoint CWnd::GetCaretPos()
1256: { CPoint point; ::GetCaretPos((LPPOINT)&point); return point; }
1257: inline void CWnd::SetCaretPos(POINT point)
1258: { ::SetCaretPos(point.x, point.y); }
1259: inline void CWnd::HideCaret()
1260: { ::HideCaret(m_hWnd); }
1261: inline void CWnd::ShowCaret()
1262: { ::ShowCaret(m_hWnd); }
1263: inline afx_msg void CWnd::OnActivate(UINT, CWnd*, BOOL)
1264: { Default(); }
1265: inline afx_msg void CWnd::OnActivateApp(BOOL, HANDLE)
1266: { Default(); }
1267: inline afx_msg void CWnd::OnCancelMode()
1268: { Default(); }
1269: inline afx_msg void CWnd::OnChildActivate()
1270: { Default(); }
1271: inline afx_msg void CWnd::OnClose()
1272: { Default(); }
1273: inline afx_msg int CWnd::OnCreate(LPCREATESTRUCT)
1274: { return (int)Default(); }
1275: inline afx_msg HBRUSH CWnd::OnCtlColor(CDC*, CWnd*, UINT)
1276: { return (HBRUSH)Default(); }
1277: inline afx_msg void CWnd::OnEnable(BOOL)
1278: { Default(); }
1279: inline afx_msg void CWnd::OnEndSession(BOOL)
1280: { Default(); }
1281: inline afx_msg void CWnd::OnEnterIdle(UINT, CWnd*)
1282: { Default(); }
1283: inline afx_msg BOOL CWnd::OnEraseBkgnd(CDC*)
1284: { return (BOOL)Default(); }
1285: inline afx_msg void CWnd::OnGetMinMaxInfo(LPPOINT)
1286: { Default(); }
1287: inline afx_msg void CWnd::OnIconEraseBkgnd(CDC*)
1288: { Default(); }
1289: inline afx_msg void CWnd::OnKillFocus(CWnd*)
1290: { Default(); }
1291: inline afx_msg LONG CWnd::OnMenuChar(UINT, UINT, CMenu*)
1292: { return Default(); }
1293: inline afx_msg void CWnd::OnMenuSelect(UINT, UINT, HMENU)
1294: { Default(); }
1295: inline afx_msg void CWnd::OnMove(int, int)
1296: { Default(); }
1297: inline afx_msg void CWnd::OnPaint()
1298: { Default(); }
1299: inline afx_msg void CWnd::OnParentNotify(UINT, LONG)
1300: { Default(); }
1301: inline afx_msg HCURSOR CWnd::OnQueryDragIcon()
1302: { return (HCURSOR)Default(); }
1303: inline afx_msg BOOL CWnd::OnQueryEndSession()
1304: { return (BOOL)Default(); }
1305: inline afx_msg BOOL CWnd::OnQueryNewPalette()
1306: { return (BOOL)Default(); }
1307: inline afx_msg BOOL CWnd::OnQueryOpen()
1308: { return (BOOL)Default(); }
1309: inline afx_msg void CWnd::OnSetFocus(CWnd*)
1310: { Default(); }
1311: inline afx_msg void CWnd::OnShowWindow(BOOL, UINT)
1312: { Default(); }
1313: inline afx_msg void CWnd::OnSize(UINT, int, int)
1314: { Default(); }
1315:
1316: #if (WINVER >= 0x030a)
1317: inline afx_msg void CWnd::OnWindowPosChanging(WINDOWPOS FAR*)
1318: { Default(); }
1319: inline afx_msg void CWnd::OnWindowPosChanged(WINDOWPOS FAR*)
1320: { Default(); }
1321: inline afx_msg void CWnd::OnDropFiles(HANDLE)
1322: { Default(); }
1323: inline afx_msg void CWnd::OnPaletteIsChanging(CWnd*)
1324: { Default(); }
1325: #endif /* WINVER >= 0x030a */
1326:
1327: inline afx_msg BOOL CWnd::OnNcActivate(BOOL)
1328: { return (BOOL)Default(); }
1329: inline afx_msg void CWnd::OnNcCalcSize(NCCALCSIZE_PARAMS FAR*)
1330: { Default(); }
1331: inline afx_msg BOOL CWnd::OnNcCreate(LPCREATESTRUCT)
1332: { return (BOOL)Default(); }
1333: inline afx_msg UINT CWnd::OnNcHitTest(CPoint)
1334: { return (UINT)Default(); }
1335: inline afx_msg void CWnd::OnNcLButtonDblClk(UINT, CPoint)
1336: { Default(); }
1337: inline afx_msg void CWnd::OnNcLButtonDown(UINT, CPoint)
1338: { Default(); }
1339: inline afx_msg void CWnd::OnNcLButtonUp(UINT, CPoint)
1340: { Default(); }
1341: inline afx_msg void CWnd::OnNcMButtonDblClk(UINT, CPoint)
1342: { Default(); }
1343: inline afx_msg void CWnd::OnNcMButtonDown(UINT, CPoint)
1344: { Default(); }
1345: inline afx_msg void CWnd::OnNcMButtonUp(UINT, CPoint)
1346: { Default(); }
1347: inline afx_msg void CWnd::OnNcMouseMove(UINT, CPoint)
1348: { Default(); }
1349: inline afx_msg void CWnd::OnNcPaint()
1350: { Default(); }
1351: inline afx_msg void CWnd::OnNcRButtonDblClk(UINT, CPoint)
1352: { Default(); }
1353: inline afx_msg void CWnd::OnNcRButtonDown(UINT, CPoint)
1354: { Default(); }
1355: inline afx_msg void CWnd::OnNcRButtonUp(UINT, CPoint)
1356: { Default(); }
1357: inline afx_msg void CWnd::OnSysChar(UINT, UINT, UINT)
1358: { Default(); }
1359: inline afx_msg void CWnd::OnSysCommand(UINT, LONG)
1360: { Default(); }
1361: inline afx_msg void CWnd::OnSysDeadChar(UINT, UINT, UINT)
1362: { Default(); }
1363: inline afx_msg void CWnd::OnSysKeyDown(UINT, UINT, UINT)
1364: { Default(); }
1365: inline afx_msg void CWnd::OnSysKeyUp(UINT, UINT, UINT)
1366: { Default(); }
1367: inline afx_msg void CWnd::OnCompacting(UINT)
1368: { Default(); }
1369: inline afx_msg void CWnd::OnDevModeChange(LPSTR)
1370: { Default(); }
1371: inline afx_msg void CWnd::OnFontChange()
1372: { Default(); }
1373: inline afx_msg void CWnd::OnPaletteChanged(CWnd*)
1374: { Default(); }
1375: inline afx_msg void CWnd::OnSpoolerStatus(UINT, UINT)
1376: { Default(); }
1377: inline afx_msg void CWnd::OnSysColorChange()
1378: { Default(); }
1379: inline afx_msg void CWnd::OnTimeChange()
1380: { Default(); }
1381: inline afx_msg void CWnd::OnWinIniChange(LPSTR)
1382: { Default(); }
1383: inline afx_msg void CWnd::OnChar(UINT, UINT, UINT)
1384: { Default(); }
1385: inline afx_msg void CWnd::OnDeadChar(UINT, UINT, UINT)
1386: { Default(); }
1387: inline afx_msg void CWnd::OnHScroll(UINT, UINT, CScrollBar*)
1388: { Default(); }
1389: inline afx_msg void CWnd::OnKeyDown(UINT, UINT, UINT)
1390: { Default(); }
1391: inline afx_msg void CWnd::OnKeyUp(UINT, UINT, UINT)
1392: { Default(); }
1393: inline afx_msg void CWnd::OnLButtonDblClk(UINT, CPoint)
1394: { Default(); }
1395: inline afx_msg void CWnd::OnLButtonDown(UINT, CPoint)
1396: { Default(); }
1397: inline afx_msg void CWnd::OnLButtonUp(UINT, CPoint)
1398: { Default(); }
1399: inline afx_msg void CWnd::OnMButtonDblClk(UINT, CPoint)
1400: { Default(); }
1401: inline afx_msg void CWnd::OnMButtonDown(UINT, CPoint)
1402: { Default(); }
1403: inline afx_msg void CWnd::OnMButtonUp(UINT, CPoint)
1404: { Default(); }
1405: inline afx_msg int CWnd::OnMouseActivate(CWnd*, UINT, UINT)
1406: { return (int)Default(); }
1407: inline afx_msg void CWnd::OnMouseMove(UINT, CPoint)
1408: { Default(); }
1409: inline afx_msg void CWnd::OnRButtonDblClk(UINT, CPoint)
1410: { Default(); }
1411: inline afx_msg void CWnd::OnRButtonDown(UINT, CPoint)
1412: { Default(); }
1413: inline afx_msg void CWnd::OnRButtonUp(UINT, CPoint)
1414: { Default(); }
1415: inline afx_msg BOOL CWnd::OnSetCursor(CWnd*, UINT, UINT)
1416: { return (BOOL)Default(); }
1417: inline afx_msg void CWnd::OnTimer(UINT)
1418: { Default(); }
1419: inline afx_msg void CWnd::OnVScroll(UINT, UINT, CScrollBar*)
1420: { Default(); }
1421: inline afx_msg void CWnd::OnInitMenu(CMenu*)
1422: { Default(); }
1423: inline afx_msg void CWnd::OnInitMenuPopup(CMenu*, UINT, BOOL)
1424: { Default(); }
1425: inline afx_msg void CWnd::OnAskCbFormatName(UINT, LPSTR)
1426: { Default(); }
1427: inline afx_msg void CWnd::OnChangeCbChain(HWND, HWND)
1428: { Default(); }
1429: inline afx_msg void CWnd::OnDestroyClipboard()
1430: { Default(); }
1431: inline afx_msg void CWnd::OnDrawClipboard()
1432: { Default(); }
1433: inline afx_msg void CWnd::OnHScrollClipboard(CWnd*, UINT, UINT)
1434: { Default(); }
1435: inline afx_msg void CWnd::OnPaintClipboard(CWnd*, HANDLE)
1436: { Default(); }
1437: inline afx_msg void CWnd::OnRenderAllFormats()
1438: { Default(); }
1439: inline afx_msg void CWnd::OnRenderFormat(UINT)
1440: { Default(); }
1441: inline afx_msg void CWnd::OnSizeClipboard(CWnd*, HANDLE)
1442: { Default(); }
1443: inline afx_msg void CWnd::OnVScrollClipboard(CWnd*, UINT, UINT)
1444: { Default(); }
1445: inline afx_msg int CWnd::OnCharToItem(UINT, CListBox*, UINT)
1446: { return (int)Default(); }
1447: inline afx_msg UINT CWnd::OnGetDlgCode()
1448: { return (UINT)Default(); }
1449: inline afx_msg int CWnd::OnVKeyToItem(UINT, CListBox*, UINT)
1450: { return (int)Default(); }
1451: inline afx_msg void CWnd::OnMDIActivate(BOOL, CWnd*, CWnd*)
1452: { Default(); }
1453:
1454: // CDialog inline functions
1455: inline BOOL CDialog::Create(UINT nIDTemplate, CWnd* pParentWnd /* = NULL */)
1456: { return Create(MAKEINTRESOURCE(nIDTemplate), pParentWnd); }
1457: inline void CDialog::MapDialogRect(LPRECT lpRect) const
1458: { ::MapDialogRect(m_hWnd, lpRect); }
1459: inline BOOL CDialog::IsDialogMessage(LPMSG lpMsg)
1460: { return ::IsDialogMessage(m_hWnd, lpMsg); }
1461: inline void CDialog::NextDlgCtrl() const
1462: { ::SendMessage(m_hWnd, WM_NEXTDLGCTL, 0, 0); }
1463: inline void CDialog::PrevDlgCtrl() const
1464: { ::SendMessage(m_hWnd, WM_NEXTDLGCTL, 1, 0); }
1465: inline void CDialog::GotoDlgCtrl(CWnd* pWndCtrl)
1466: { ::SendMessage(m_hWnd, WM_NEXTDLGCTL, (UINT)pWndCtrl->m_hWnd, 1L); }
1467: inline void CDialog::SetDefID(UINT nID)
1468: { ::SendMessage(m_hWnd, DM_SETDEFID, nID, 0); }
1469: inline DWORD CDialog::GetDefID()
1470: { return ::SendMessage(m_hWnd, DM_GETDEFID, 0, 0); }
1471: inline void CDialog::EndDialog(int nResult)
1472: { ::EndDialog(m_hWnd, nResult); }
1473:
1474: // Window control inline functions
1475: inline CStatic::CStatic()
1476: { }
1477: inline CButton::CButton()
1478: { }
1479: #if (WINVER >= 0x030a)
1480: inline HICON CStatic::SetIcon(HICON hIcon)
1481: { return (HICON)::SendMessage(m_hWnd, STM_SETICON, (WPARAM)hIcon, 0L); }
1482: inline HICON CStatic::GetIcon() const
1483: { return (HICON)::SendMessage(m_hWnd, STM_GETICON, 0, 0L); }
1484: #endif /* WINVER >= 0x030a */
1485:
1486: inline UINT CButton::GetState() const
1487: { return (UINT)::SendMessage(m_hWnd, BM_GETSTATE, 0, 0); }
1488: inline void CButton::SetState(BOOL bHighlight)
1489: { ::SendMessage(m_hWnd, BM_SETSTATE, bHighlight, 0); }
1490: inline int CButton::GetCheck() const
1491: { return (BOOL)::SendMessage(m_hWnd, BM_GETCHECK, 0, 0); }
1492: inline void CButton::SetCheck(int nCheck)
1493: { ::SendMessage(m_hWnd, BM_SETCHECK, nCheck, 0); }
1494: inline UINT CButton::GetButtonStyle() const
1495: { return (UINT)GetWindowLong(m_hWnd, GWL_STYLE) & 0xff; }
1496: inline void CButton::SetButtonStyle(UINT nStyle, BOOL bRedraw /* = TRUE */)
1497: { ::SendMessage(m_hWnd, BM_SETSTYLE, nStyle, (LONG)bRedraw); }
1498: inline CListBox::CListBox()
1499: { }
1500: inline int CListBox::GetCount() const
1501: { return (int)::SendMessage(m_hWnd, LB_GETCOUNT, 0, 0); }
1502: inline int CListBox::GetCurSel() const
1503: { return (int)::SendMessage(m_hWnd, LB_GETCURSEL, 0, 0); }
1504: inline int CListBox::SetCurSel(int nSelect)
1505: { return (int)::SendMessage(m_hWnd, LB_SETCURSEL, nSelect, 0); }
1506: inline int CListBox::GetHorizontalExtent() const
1507: { return (int)::SendMessage(m_hWnd, LB_GETHORIZONTALEXTENT,
1508: 0, 0); }
1509: inline void CListBox::SetHorizontalExtent(int cxExtent)
1510: { ::SendMessage(m_hWnd, LB_SETHORIZONTALEXTENT, cxExtent, 0); }
1511: inline int CListBox::GetSelCount() const
1512: { return (int)::SendMessage(m_hWnd, LB_GETSELCOUNT, 0, 0); }
1513: inline int CListBox::GetSelItems(int nMaxItems, LPINT rgIndex) const
1514: { return (int)::SendMessage(m_hWnd, LB_GETSELITEMS, nMaxItems, (LONG)rgIndex); }
1515: inline int CListBox::GetTopIndex() const
1516: { return (int)::SendMessage(m_hWnd, LB_GETTOPINDEX, 0, 0); }
1517: inline int CListBox::SetTopIndex(int nIndex)
1518: { return (int)::SendMessage(m_hWnd, LB_SETTOPINDEX, nIndex, 0);}
1519: inline DWORD CListBox::GetItemData(int nIndex) const
1520: { return ::SendMessage(m_hWnd, LB_GETITEMDATA, nIndex, 0); }
1521: inline int CListBox::SetItemData(int nIndex, DWORD dwItemData)
1522: { return (int)::SendMessage(m_hWnd, LB_SETITEMDATA, nIndex, (LONG)dwItemData); }
1523: inline int CListBox::GetItemRect(int nIndex, LPRECT lpRect) const
1524: { return (int)::SendMessage(m_hWnd, LB_GETITEMRECT, nIndex, (LONG)lpRect); }
1525: inline int CListBox::GetSel(int nIndex) const
1526: { return (int)::SendMessage(m_hWnd, LB_GETSEL, nIndex, 0); }
1527: inline int CListBox::SetSel(int nIndex, BOOL bSelect)
1528: { return (int)::SendMessage(m_hWnd, LB_SETSEL, bSelect, nIndex); }
1529: inline int CListBox::GetText(int nIndex, LPSTR lpBuffer) const
1530: { return (int)::SendMessage(m_hWnd, LB_GETTEXT, nIndex, (LONG)lpBuffer); }
1531: inline int CListBox::GetTextLen(int nIndex) const
1532: { return (int)::SendMessage(m_hWnd, LB_GETTEXTLEN, nIndex, 0); }
1533: inline void CListBox::GetText(int nIndex, CString& rString) const
1534: { GetText(nIndex, rString.GetBufferSetLength(GetTextLen(nIndex))); }
1535: inline void CListBox::SetColumnWidth(int cxWidth)
1536: { ::SendMessage(m_hWnd, LB_SETCOLUMNWIDTH, cxWidth, 0); }
1537: inline BOOL CListBox::SetTabStops(int nTabStops, LPINT rgTabStops)
1538: { return (BOOL)::SendMessage(m_hWnd, LB_SETTABSTOPS, nTabStops, (LONG)rgTabStops); }
1539: inline void CListBox::SetTabStops()
1540: { VERIFY(::SendMessage(m_hWnd, LB_SETTABSTOPS, 0, 0)); }
1541: inline BOOL CListBox::SetTabStops(int cxEachStop)
1542: { return (BOOL)::SendMessage(m_hWnd, LB_SETTABSTOPS, 1, (LONG)(LPINT)&cxEachStop); }
1543: #if (WINVER >= 0x030a)
1544: inline int CListBox::SetItemHeight(int nIndex, UINT cyItemHeight)
1545: { return (int)::SendMessage(m_hWnd, LB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0)); }
1546: inline int CListBox::GetItemHeight(int nIndex) const
1547: { return (int)::SendMessage(m_hWnd, LB_GETITEMHEIGHT, nIndex, 0L); }
1548: inline int CListBox::FindStringExact(int nIndexStart, LPCSTR lpszFind) const
1549: { return (int)::SendMessage(m_hWnd, LB_FINDSTRINGEXACT, nIndexStart, (LONG)lpszFind); }
1550: inline int CListBox::GetCaretIndex() const
1551: { return (int)::SendMessage(m_hWnd, LB_GETCARETINDEX, 0, 0L); }
1552: inline int CListBox::SetCaretIndex(int nIndex, BOOL bScroll /* = TRUE */)
1553: { return (int)::SendMessage(m_hWnd, LB_SETCARETINDEX, nIndex, MAKELONG(bScroll, 0)); }
1554: #endif /* WINVER >= 0x030a */
1555: inline int CListBox::AddString(LPCSTR lpItem)
1556: { return (int)::SendMessage(m_hWnd, LB_ADDSTRING, 0, (LONG)lpItem); }
1557: inline int CListBox::DeleteString(UINT nIndex)
1558: { return (int)::SendMessage(m_hWnd, LB_DELETESTRING, nIndex, 0); }
1559: inline int CListBox::InsertString(int nIndex, LPCSTR lpItem)
1560: { return (int)::SendMessage(m_hWnd, LB_INSERTSTRING, nIndex, (LONG)lpItem); }
1561: inline void CListBox::ResetContent()
1562: { ::SendMessage(m_hWnd, LB_RESETCONTENT, 0, 0); }
1563: inline int CListBox::Dir(UINT attr, LPCSTR lpWildCard)
1564: { return (int)::SendMessage(m_hWnd, LB_DIR, attr, (LONG)lpWildCard); }
1565: inline int CListBox::FindString(int nStartAfter, LPCSTR lpItem) const
1566: { return (int)::SendMessage(m_hWnd, LB_FINDSTRING,
1567: nStartAfter, (LONG)lpItem); }
1568: inline int CListBox::SelectString(int nStartAfter, LPCSTR lpItem)
1569: { return (int)::SendMessage(m_hWnd, LB_SELECTSTRING,
1570: nStartAfter, (LONG)lpItem); }
1571: inline int CListBox::SelItemRange(BOOL bSelect, int nFirstItem, int nLastItem)
1572: { return (int)::SendMessage(m_hWnd, LB_SELITEMRANGE, bSelect,
1573: MAKELONG(nFirstItem, nLastItem)); }
1574: inline CComboBox::CComboBox()
1575: { }
1576: inline int CComboBox::GetCount() const
1577: { return (int)::SendMessage(m_hWnd, CB_GETCOUNT, 0, 0); }
1578: inline int CComboBox::GetCurSel() const
1579: { return (int)::SendMessage(m_hWnd, CB_GETCURSEL, 0, 0); }
1580: inline int CComboBox::SetCurSel(int nSelect)
1581: { return (int)::SendMessage(m_hWnd, CB_SETCURSEL, nSelect, 0); }
1582: inline DWORD CComboBox::GetEditSel() const
1583: { return ::SendMessage(m_hWnd, CB_GETEDITSEL, 0, 0); }
1584: inline BOOL CComboBox::LimitText(int nMaxChars)
1585: { return (BOOL)::SendMessage(m_hWnd, CB_LIMITTEXT, nMaxChars, 0); }
1586: inline BOOL CComboBox::SetEditSel(int nStartChar, int nEndChar)
1587: { return (BOOL)::SendMessage(m_hWnd, CB_SETEDITSEL, 0, MAKELONG(nStartChar, nEndChar)); }
1588: inline DWORD CComboBox::GetItemData(int nIndex) const
1589: { return ::SendMessage(m_hWnd, CB_GETITEMDATA, nIndex, 0); }
1590: inline int CComboBox::SetItemData(int nIndex, DWORD dwItemData)
1591: { return (int)::SendMessage(m_hWnd, CB_SETITEMDATA, nIndex, (LONG)dwItemData); }
1592: inline int CComboBox::GetLBText(int nIndex, LPSTR lpText) const
1593: { return (int)::SendMessage(m_hWnd, CB_GETLBTEXT, nIndex, (LONG)lpText); }
1594: inline int CComboBox::GetLBTextLen(int nIndex) const
1595: { return (int)::SendMessage(m_hWnd, CB_GETLBTEXTLEN, nIndex, 0); }
1596: inline void CComboBox::GetLBText(int nIndex, CString& rString) const
1597: { GetLBText(nIndex, rString.GetBufferSetLength(GetLBTextLen(nIndex))); }
1598: inline void CComboBox::ShowDropDown(BOOL bShowIt /* = TRUE */)
1599: { ::SendMessage(m_hWnd, CB_SHOWDROPDOWN, bShowIt, 0); }
1600: inline int CComboBox::AddString(LPCSTR lpString)
1601: { return (int)::SendMessage(m_hWnd, CB_ADDSTRING, 0, (LONG)lpString); }
1602: inline int CComboBox::DeleteString(UINT nIndex)
1603: { return (int)::SendMessage(m_hWnd, CB_DELETESTRING, nIndex, 0);}
1604: inline int CComboBox::InsertString(int nIndex, LPCSTR lpString)
1605: { return (int)::SendMessage(m_hWnd, CB_INSERTSTRING, nIndex, (LONG)lpString); }
1606: inline void CComboBox::ResetContent()
1607: { ::SendMessage(m_hWnd, CB_RESETCONTENT, 0, 0); }
1608: inline int CComboBox::Dir(UINT attr, LPCSTR lpWildCard)
1609: { return (int)::SendMessage(m_hWnd, CB_DIR, attr, (LONG)lpWildCard); }
1610: inline int CComboBox::FindString(int nStartAfter, LPCSTR lpString) const
1611: { return (int)::SendMessage(m_hWnd, CB_FINDSTRING, nStartAfter,
1612: (LONG)lpString); }
1613: inline int CComboBox::SelectString(int nStartAfter, LPCSTR lpString)
1614: { return (int)::SendMessage(m_hWnd, CB_SELECTSTRING,
1615: nStartAfter, (LONG)lpString); }
1616: inline void CComboBox::Clear()
1617: { ::SendMessage(m_hWnd, WM_CLEAR, 0, 0); }
1618: inline void CComboBox::Copy()
1619: { ::SendMessage(m_hWnd, WM_COPY, 0, 0); }
1620: inline void CComboBox::Cut()
1621: { ::SendMessage(m_hWnd, WM_CUT, 0, 0); }
1622: inline void CComboBox::Paste()
1623: { ::SendMessage(m_hWnd, WM_PASTE, 0, 0); }
1624: #if (WINVER >= 0x030a)
1625: inline int CComboBox::SetItemHeight(int nIndex, UINT cyItemHeight)
1626: { return (int)::SendMessage(m_hWnd, CB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0)); }
1627: inline int CComboBox::GetItemHeight(int nIndex) const
1628: { return (int)::SendMessage(m_hWnd, CB_GETITEMHEIGHT, nIndex, 0L); }
1629: inline int CComboBox::FindStringExact(int nIndexStart, LPCSTR lpszFind) const
1630: { return (int)::SendMessage(m_hWnd, CB_FINDSTRINGEXACT, nIndexStart, (LONG)lpszFind); }
1631: inline int CComboBox::SetExtendedUI(BOOL bExtended /* = TRUE */ )
1632: { return (int)::SendMessage(m_hWnd, CB_SETEXTENDEDUI, bExtended, 0L); }
1633: inline BOOL CComboBox::GetExtendedUI() const
1634: { return (BOOL)::SendMessage(m_hWnd, CB_GETEXTENDEDUI, 0, 0L); }
1635: inline void CComboBox::GetDroppedControlRect(LPRECT lprect) const
1636: { ::SendMessage(m_hWnd, CB_GETDROPPEDCONTROLRECT, 0, (DWORD)lprect); }
1637: inline BOOL CComboBox::GetDroppedState() const
1638: { return (BOOL)::SendMessage(m_hWnd, CB_GETDROPPEDSTATE, 0, 0L); }
1639: #endif /* WINVER >= 0x030a */
1640:
1641: inline CEdit::CEdit()
1642: { }
1643: inline BOOL CEdit::CanUndo() const
1644: { return (BOOL)::SendMessage(m_hWnd, EM_CANUNDO, 0, 0); }
1645: inline int CEdit::GetLineCount() const
1646: { return (int)::SendMessage(m_hWnd, EM_GETLINECOUNT, 0, 0); }
1647: inline BOOL CEdit::GetModify() const
1648: { return (BOOL)::SendMessage(m_hWnd, EM_GETMODIFY, 0, 0); }
1649: inline void CEdit::SetModify(BOOL bModified /* = TRUE */)
1650: { ::SendMessage(m_hWnd, EM_SETMODIFY, bModified, 0); }
1651: inline void CEdit::GetRect(LPRECT lpRect) const
1652: { ::SendMessage(m_hWnd, EM_GETRECT, 0, (LONG)lpRect); }
1653: inline DWORD CEdit::GetSel() const
1654: { return ::SendMessage(m_hWnd, EM_GETSEL, 0, 0); }
1655: inline HANDLE CEdit::GetHandle() const
1656: { return (HANDLE)::SendMessage(m_hWnd, EM_GETHANDLE, 0, 0); }
1657: inline void CEdit::SetHandle(HANDLE hBuffer)
1658: { ::SendMessage(m_hWnd, EM_SETHANDLE, (UINT)hBuffer, 0); }
1659: inline int CEdit::GetLine(int nIndex, LPSTR lpBuffer) const
1660: { return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LONG)lpBuffer); }
1661: inline int CEdit::GetLine(int nIndex, LPSTR lpBuffer, int nMaxLength) const
1662: {
1663: *(LPINT)lpBuffer = nMaxLength;
1664: return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex,
1665: (LONG)lpBuffer);
1666: }
1667: inline void CEdit::EmptyUndoBuffer()
1668: { ::SendMessage(m_hWnd, EM_EMPTYUNDOBUFFER, 0, 0); }
1669: inline BOOL CEdit::FmtLines(BOOL bAddEOL)
1670: { return (BOOL)::SendMessage(m_hWnd, EM_FMTLINES, bAddEOL, 0); }
1671: inline void CEdit::LimitText(int nChars /* = 0 */)
1672: { ::SendMessage(m_hWnd, EM_LIMITTEXT, nChars, 0); }
1673: inline int CEdit::LineFromChar(int nIndex /* = -1 */) const
1674: { return (int)::SendMessage(m_hWnd, EM_LINEFROMCHAR, nIndex, 0); }
1675: inline int CEdit::LineIndex(int nLine /* = -1 */) const
1676: { return (int)::SendMessage(m_hWnd, EM_LINEINDEX, nLine, 0); }
1677: inline int CEdit::LineLength(int nLine /* = -1 */) const
1678: { return (int)::SendMessage(m_hWnd, EM_LINELENGTH, nLine, 0); }
1679: inline void CEdit::LineScroll(int nLines, int nChars /* = 0 */)
1680: #ifdef _NTWIN
1681: { ::SendMessage(m_hWnd, EM_LINESCROLL, nChars, nLines); }
1682: #else
1683: { ::SendMessage(m_hWnd, EM_LINESCROLL, 0, MAKELONG(nLines, nChars)); }
1684: #endif
1685: inline void CEdit::ReplaceSel(LPCSTR lpNewText)
1686: { ::SendMessage(m_hWnd, EM_REPLACESEL, 0, (LONG)lpNewText); }
1687: inline void CEdit::SetPasswordChar(char ch /* = '\0' */)
1688: { ::SendMessage(m_hWnd, EM_SETPASSWORDCHAR, ch, 0); }
1689: inline void CEdit::SetRect(LPRECT lpRect)
1690: { ::SendMessage(m_hWnd, EM_SETRECT, 0, (LONG)lpRect); }
1691: inline void CEdit::SetRectNP(LPRECT lpRect)
1692: { ::SendMessage(m_hWnd, EM_SETRECTNP, 0, (LONG)lpRect); }
1693: inline void CEdit::SetSel(DWORD dwSelection)
1694: #ifdef _NTWIN
1695: { ::SendMessage(m_hWnd, EM_SETSEL, LOWORD(dwSelection), HIWORD(dwSelection)); }
1696: #else
1697: { ::SendMessage(m_hWnd, EM_SETSEL, 0, (LONG)dwSelection); }
1698: #endif
1699: inline void CEdit::SetSel(int nStartChar, int nEndChar)
1700: #ifdef _NTWIN
1701: { ::SendMessage(m_hWnd, EM_SETSEL, nStartChar, nEndChar); }
1702: #else
1703: { ::SendMessage(m_hWnd, EM_SETSEL, 0, MAKELONG(nStartChar, nEndChar)); }
1704: #endif
1705: inline BOOL CEdit::SetTabStops(int nTabStops, LPINT rgTabStops)
1706: { return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, nTabStops,
1707: (LONG)rgTabStops); }
1708: inline void CEdit::SetTabStops()
1709: { VERIFY(::SendMessage(m_hWnd, EM_SETTABSTOPS, 0, 0)); }
1710: inline BOOL CEdit::SetTabStops(int cxEachStop)
1711: { return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS,
1712: 1, (LONG)(LPINT)&cxEachStop); }
1713: inline BOOL CEdit::Undo()
1714: { return (BOOL)::SendMessage(m_hWnd, EM_UNDO, 0, 0); }
1715: inline void CEdit::Clear()
1716: { ::SendMessage(m_hWnd, WM_CLEAR, 0, 0); }
1717: inline void CEdit::Copy()
1718: { ::SendMessage(m_hWnd, WM_COPY, 0, 0); }
1719: inline void CEdit::Cut()
1720: { ::SendMessage(m_hWnd, WM_CUT, 0, 0); }
1721: inline void CEdit::Paste()
1722: { ::SendMessage(m_hWnd, WM_PASTE, 0, 0); }
1723: #if (WINVER >= 0x030a)
1724: inline BOOL CEdit::SetReadOnly(BOOL bReadOnly /* = TRUE */ )
1725: { return (BOOL)::SendMessage(m_hWnd, EM_SETREADONLY, bReadOnly, 0L); }
1726: inline int CEdit::GetFirstVisibleLine() const
1727: { return (int)::SendMessage(m_hWnd, EM_GETFIRSTVISIBLELINE, 0, 0L); }
1728: inline char CEdit::GetPasswordChar() const
1729: { return (char)::SendMessage(m_hWnd, EM_GETPASSWORDCHAR, 0, 0L); }
1730: #endif /* WINVER >= 0x030a */
1731:
1732: inline CScrollBar::CScrollBar()
1733: { }
1734: inline int CScrollBar::GetScrollPos() const
1735: { return ::GetScrollPos(m_hWnd, SB_CTL); }
1736: inline int CScrollBar::SetScrollPos(int nPos, BOOL bRedraw /* = TRUE */)
1737: { return ::SetScrollPos(m_hWnd, SB_CTL, nPos, bRedraw); }
1738: inline void CScrollBar::GetScrollRange(LPINT lpMinPos, LPINT lpMaxPos) const
1739: { ::GetScrollRange(m_hWnd, SB_CTL, lpMinPos, lpMaxPos); }
1740: inline void CScrollBar::SetScrollRange(int nMinPos, int nMaxPos, BOOL bRedraw /* = TRUE */)
1741: { ::SetScrollRange(m_hWnd, SB_CTL, nMinPos, nMaxPos, bRedraw); }
1742: inline void CScrollBar::ShowScrollBar(BOOL bShow /* = TRUE */)
1743: { ::ShowScrollBar(m_hWnd, SB_CTL, bShow); }
1744: #if (WINVER >= 0x030a)
1745: inline BOOL CScrollBar::EnableScrollBar(UINT nArrowFlags /* = ESB_ENABLE_BOTH */ )
1746: { return ::EnableScrollBar(m_hWnd, SB_CTL, nArrowFlags); }
1747: #endif /* WINVER >= 0x030a */
1748:
1749: inline CBitmapButton::CBitmapButton()
1750: { }
1751: inline CBitmapButton::CBitmapButton(LPCSTR lpBitmapResource,
1752: LPCSTR lpBitmapResourceSel /* = NULL */,
1753: LPCSTR lpBitmapResourceFocus /* = NULL */)
1754: { VERIFY(LoadBitmaps(lpBitmapResource, lpBitmapResourceSel,
1755: lpBitmapResourceFocus)); }
1756:
1757:
1758: // MDI inline functions
1759: inline void CMDIFrameWnd::MDIActivate(CWnd* pWndActivate)
1760: { ::SendMessage(m_hWndMDIClient, WM_MDIACTIVATE,
1761: (UINT)pWndActivate->m_hWnd, 0); }
1762: inline CMDIChildWnd* CMDIFrameWnd::MDIGetActive(BOOL* pbMaximized /* = NULL */) const
1763: #ifdef _NTWIN
1764: { HWND hWnd = (HWND)::SendMessage(m_hWndMDIClient, WM_MDIGETACTIVE, 0, 0);
1765: if (pbMaximized != NULL)
1766: *pbMaximized = !!(::GetWindowLong(hWnd, GWL_STYLE) & WS_MAXIMIZE);
1767: return (CMDIChildWnd*)CWnd::FromHandle(hWnd); }
1768: #else
1769: { LONG l;
1770: l = ::SendMessage(m_hWndMDIClient, WM_MDIGETACTIVE, 0, 0);
1771: if (pbMaximized != NULL)
1772: *pbMaximized = HIWORD(l);
1773: return (CMDIChildWnd*)CWnd::FromHandle((HWND)LOWORD(l)); }
1774: #endif
1775: inline void CMDIFrameWnd::MDIIconArrange()
1776: { ::SendMessage(m_hWndMDIClient, WM_MDIICONARRANGE, 0, 0); }
1777: inline void CMDIFrameWnd::MDIMaximize(CWnd* pWnd)
1778: { ::SendMessage(m_hWndMDIClient, WM_MDIMAXIMIZE, (UINT)pWnd->m_hWnd, 0); }
1779: inline void CMDIFrameWnd::MDINext()
1780: { ::SendMessage(m_hWndMDIClient, WM_MDINEXT, 0, 0); }
1781: inline void CMDIFrameWnd::MDIRestore(CWnd* pWnd)
1782: { ::SendMessage(m_hWndMDIClient, WM_MDIRESTORE, (UINT)pWnd->m_hWnd, 0); }
1783: inline CMenu* CMDIFrameWnd::MDISetMenu(CMenu* pFrameMenu, CMenu* pWindowMenu)
1784: #ifdef _NTWIN
1785: { return CMenu::FromHandle((HMENU)::SendMessage(
1786: m_hWndMDIClient, WM_MDISETMENU,
1787: (WPARAM)pFrameMenu->GetSafeHmenu(),
1788: (LPARAM)pWindowMenu->GetSafeHmenu())); }
1789: #else
1790: { return CMenu::FromHandle((HMENU)::SendMessage(
1791: m_hWndMDIClient, WM_MDISETMENU, 0,
1792: MAKELONG(pFrameMenu->GetSafeHmenu(),
1793: pWindowMenu->GetSafeHmenu()))); }
1794: #endif
1795: inline void CMDIFrameWnd::MDITile()
1796: { ::SendMessage(m_hWndMDIClient, WM_MDITILE, 0, 0); }
1797: inline void CMDIFrameWnd::MDICascade()
1798: { ::SendMessage(m_hWndMDIClient, WM_MDICASCADE, 0, 0); }
1799:
1800: #if (WINVER >= 0x030a)
1801: inline void CMDIFrameWnd::MDICascade(int nType)
1802: { ::SendMessage(m_hWndMDIClient, WM_MDICASCADE, nType, 0); }
1803: inline void CMDIFrameWnd::MDITile(int nType)
1804: { ::SendMessage(m_hWndMDIClient, WM_MDITILE, nType, 0); }
1805: #endif /* WINVER >= 0x030a */
1806:
1807: inline CMDIChildWnd::CMDIChildWnd()
1808: { }
1809: inline void CMDIChildWnd::MDIDestroy()
1810: { GetParent()->SendMessage(WM_MDIDESTROY, (UINT)m_hWnd); }
1811: inline void CMDIChildWnd::MDIActivate()
1812: { GetParent()->SendMessage(WM_MDIACTIVATE, (UINT)m_hWnd); }
1813: inline void CMDIChildWnd::MDIMaximize()
1814: { GetParent()->SendMessage(WM_MDIMAXIMIZE, (UINT)m_hWnd); }
1815: inline void CMDIChildWnd::MDIRestore()
1816: { GetParent()->SendMessage(WM_MDIRESTORE, (UINT)m_hWnd); }
1817:
1818: // CWinApp inline functions
1819: inline HCURSOR CWinApp::LoadCursor(LPCSTR lpCursorName)
1820: { return ::LoadCursor(AfxGetResourceHandle(), lpCursorName); }
1821: inline HCURSOR CWinApp::LoadCursor(UINT nIDCursor)
1822: { return ::LoadCursor(AfxGetResourceHandle(),
1823: MAKEINTRESOURCE(nIDCursor)); }
1824: inline HCURSOR CWinApp::LoadStandardCursor(LPCSTR lpCursorName)
1825: { return ::LoadCursor(NULL, lpCursorName); }
1826: inline HCURSOR CWinApp::LoadOEMCursor(UINT nIDCursor)
1827: { return ::LoadCursor(NULL, MAKEINTRESOURCE(nIDCursor)); }
1828: inline HICON CWinApp::LoadIcon(LPCSTR lpIconName)
1829: { return ::LoadIcon(AfxGetResourceHandle(), lpIconName); }
1830: inline HICON CWinApp::LoadIcon(UINT nIDIcon)
1831: { return ::LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(nIDIcon)); }
1832: inline HICON CWinApp::LoadStandardIcon(LPCSTR lpIconName)
1833: { return ::LoadIcon(NULL, lpIconName); }
1834: inline HICON CWinApp::LoadOEMIcon(UINT nIDIcon)
1835: { return ::LoadIcon(NULL, MAKEINTRESOURCE(nIDIcon)); }
1836:
1837: #undef THIS_FILE
1838: #define THIS_FILE __FILE__
1839: #endif //__AFXWIN_INL__
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.