home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 17.ddi / MFC / INCLUDE / AFXWIN.IN_ / AFXWIN.IN
Encoding:
Text File  |  1993-02-08  |  77.2 KB  |  1,571 lines

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