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