home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / MFCINC.PAK / AFXWIN2.INL < prev    next >
Encoding:
Text File  |  1997-05-06  |  57.3 KB  |  1,042 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1995 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 related
  7. // electronic 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 (part 2)
  12.  
  13. #ifdef _AFXWIN_INLINE
  14.  
  15. // CWnd
  16. _AFXWIN_INLINE CWnd::operator HWND() const
  17.     { return this == NULL ? NULL : m_hWnd; }
  18. _AFXWIN_INLINE HWND CWnd::GetSafeHwnd() const
  19.     { return this == NULL ? NULL : m_hWnd; }
  20. #ifdef _AFX_NO_OCC_SUPPORT
  21. _AFXWIN_INLINE DWORD CWnd::GetStyle() const
  22.     { ASSERT(::IsWindow(m_hWnd)); return (DWORD)GetWindowLong(m_hWnd, GWL_STYLE); }
  23. _AFXWIN_INLINE DWORD CWnd::GetExStyle() const
  24.     { ASSERT(::IsWindow(m_hWnd)); return (DWORD)GetWindowLong(m_hWnd, GWL_EXSTYLE); }
  25. _AFXWIN_INLINE BOOL CWnd::ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags)
  26.     { ASSERT(::IsWindow(m_hWnd)); return ModifyStyle(m_hWnd, dwRemove, dwAdd, nFlags); }
  27. _AFXWIN_INLINE BOOL CWnd::ModifyStyleEx(DWORD dwRemove, DWORD dwAdd, UINT nFlags)
  28.     { ASSERT(::IsWindow(m_hWnd)); return ModifyStyleEx(m_hWnd, dwRemove, dwAdd, nFlags); }
  29. #endif //_AFX_NO_OCC_SUPPORT
  30. _AFXWIN_INLINE CWnd* CWnd::GetOwner() const
  31.     { return m_hWndOwner != NULL ? CWnd::FromHandle(m_hWndOwner) : GetParent(); }
  32. _AFXWIN_INLINE void CWnd::SetOwner(CWnd* pOwnerWnd)
  33.     { m_hWndOwner = pOwnerWnd != NULL ? pOwnerWnd->m_hWnd : NULL; }
  34. _AFXWIN_INLINE LRESULT CWnd::SendMessage(UINT message, WPARAM wParam, LPARAM lParam)
  35.     { ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, message, wParam, lParam); }
  36. _AFXWIN_INLINE BOOL CWnd::PostMessage(UINT message, WPARAM wParam, LPARAM lParam)
  37.     { ASSERT(::IsWindow(m_hWnd)); return ::PostMessage(m_hWnd, message, wParam, lParam); }
  38. #ifdef _AFX_NO_OCC_SUPPORT
  39. _AFXWIN_INLINE void CWnd::SetWindowText(LPCTSTR lpszString)
  40.     { ASSERT(::IsWindow(m_hWnd)); ::SetWindowText(m_hWnd, lpszString); }
  41. _AFXWIN_INLINE int CWnd::GetWindowText(LPTSTR lpszString, int nMaxCount) const
  42.     { ASSERT(::IsWindow(m_hWnd)); return ::GetWindowText(m_hWnd, lpszString, nMaxCount); }
  43. _AFXWIN_INLINE int CWnd::GetWindowTextLength() const
  44.     { ASSERT(::IsWindow(m_hWnd)); return ::GetWindowTextLength(m_hWnd); }
  45. #endif //_AFX_NO_OCC_SUPPORT
  46. _AFXWIN_INLINE void CWnd::SetFont(CFont* pFont, BOOL bRedraw)
  47.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_SETFONT, (WPARAM)pFont->GetSafeHandle(), bRedraw); }
  48. _AFXWIN_INLINE CFont* CWnd::GetFont() const
  49.     { ASSERT(::IsWindow(m_hWnd)); return CFont::FromHandle(
  50.         (HFONT)::SendMessage(m_hWnd, WM_GETFONT, 0, 0)); }
  51. _AFXWIN_INLINE CMenu* CWnd::GetMenu() const
  52.     { ASSERT(::IsWindow(m_hWnd)); return CMenu::FromHandle(::GetMenu(m_hWnd)); }
  53. _AFXWIN_INLINE BOOL CWnd::SetMenu(CMenu* pMenu)
  54.     { ASSERT(::IsWindow(m_hWnd)); return ::SetMenu(m_hWnd, pMenu->GetSafeHmenu()); }
  55. _AFXWIN_INLINE void CWnd::DrawMenuBar()
  56.     { ASSERT(::IsWindow(m_hWnd)); ::DrawMenuBar(m_hWnd); }
  57. _AFXWIN_INLINE CMenu* CWnd::GetSystemMenu(BOOL bRevert) const
  58.     { ASSERT(::IsWindow(m_hWnd)); return CMenu::FromHandle(::GetSystemMenu(m_hWnd, bRevert)); }
  59. _AFXWIN_INLINE BOOL CWnd::HiliteMenuItem(CMenu* pMenu, UINT nIDHiliteItem, UINT nHilite)
  60.     { ASSERT(::IsWindow(m_hWnd)); return ::HiliteMenuItem(m_hWnd, pMenu->m_hMenu, nIDHiliteItem, nHilite); }
  61. #ifdef _AFX_NO_OCC_SUPPORT
  62. _AFXWIN_INLINE int CWnd::GetDlgCtrlID() const
  63.     { ASSERT(::IsWindow(m_hWnd)); return ::GetDlgCtrlID(m_hWnd); }
  64. _AFXWIN_INLINE int CWnd::SetDlgCtrlID(int nID)
  65.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SetWindowLong(m_hWnd, GWL_ID, nID); }
  66. #endif //_AFX_NO_OCC_SUPPORT
  67. _AFXWIN_INLINE BOOL CWnd::IsIconic() const
  68.     { ASSERT(::IsWindow(m_hWnd)); return ::IsIconic(m_hWnd); }
  69. _AFXWIN_INLINE BOOL CWnd::IsZoomed() const
  70.     { ASSERT(::IsWindow(m_hWnd)); return ::IsZoomed(m_hWnd); }
  71. #ifdef _AFX_NO_OCC_SUPPORT
  72. _AFXWIN_INLINE void CWnd::MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint)
  73.     { ASSERT(::IsWindow(m_hWnd)); ::MoveWindow(m_hWnd, x, y, nWidth, nHeight, bRepaint); }
  74. #endif //_AFX_NO_OCC_SUPPORT
  75. _AFXWIN_INLINE void CWnd::MoveWindow(LPCRECT lpRect, BOOL bRepaint)
  76.     { MoveWindow(lpRect->left, lpRect->top, lpRect->right - lpRect->left,
  77.         lpRect->bottom - lpRect->top, bRepaint); }
  78. #ifdef _AFX_NO_OCC_SUPPORT
  79. _AFXWIN_INLINE BOOL CWnd::SetWindowPos(const CWnd* pWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
  80.     { ASSERT(::IsWindow(m_hWnd)); return ::SetWindowPos(m_hWnd, pWndInsertAfter->GetSafeHwnd(),
  81.         x, y, cx, cy, nFlags); }
  82. #endif //_AFX_NO_OCC_SUPPORT
  83. #ifndef _MAC
  84. _AFXWIN_INLINE UINT CWnd::ArrangeIconicWindows()
  85.     { ASSERT(::IsWindow(m_hWnd)); return ::ArrangeIconicWindows(m_hWnd); }
  86. #endif
  87. _AFXWIN_INLINE void CWnd::BringWindowToTop()
  88.     { ASSERT(::IsWindow(m_hWnd)); ::BringWindowToTop(m_hWnd); }
  89. _AFXWIN_INLINE void CWnd::GetWindowRect(LPRECT lpRect) const
  90.     { ASSERT(::IsWindow(m_hWnd)); ::GetWindowRect(m_hWnd, lpRect); }
  91. _AFXWIN_INLINE void CWnd::GetClientRect(LPRECT lpRect) const
  92.     { ASSERT(::IsWindow(m_hWnd)); ::GetClientRect(m_hWnd, lpRect); }
  93. _AFXWIN_INLINE void CWnd::MapWindowPoints(CWnd* pwndTo, LPPOINT lpPoint, UINT nCount) const
  94.     { ASSERT(::IsWindow(m_hWnd)); ::MapWindowPoints(m_hWnd, pwndTo->GetSafeHwnd(), lpPoint, nCount); }
  95. _AFXWIN_INLINE void CWnd::MapWindowPoints(CWnd* pwndTo, LPRECT lpRect) const
  96.     { ASSERT(::IsWindow(m_hWnd)); ::MapWindowPoints(m_hWnd, pwndTo->GetSafeHwnd(), (LPPOINT)lpRect, 2); }
  97. _AFXWIN_INLINE void CWnd::ClientToScreen(LPPOINT lpPoint) const
  98.     { ASSERT(::IsWindow(m_hWnd)); ::ClientToScreen(m_hWnd, lpPoint); }
  99. _AFXWIN_INLINE void CWnd::ClientToScreen(LPRECT lpRect) const
  100.     { ASSERT(::IsWindow(m_hWnd)); ::ClientToScreen(m_hWnd, (LPPOINT)lpRect);
  101.         ::ClientToScreen(m_hWnd, ((LPPOINT)lpRect)+1); }
  102. _AFXWIN_INLINE void CWnd::ScreenToClient(LPPOINT lpPoint) const
  103.     { ASSERT(::IsWindow(m_hWnd)); ::ScreenToClient(m_hWnd, lpPoint); }
  104. _AFXWIN_INLINE void CWnd::ScreenToClient(LPRECT lpRect) const
  105.     { ASSERT(::IsWindow(m_hWnd)); ::ScreenToClient(m_hWnd, (LPPOINT)lpRect);
  106.         ::ScreenToClient(m_hWnd, ((LPPOINT)lpRect)+1); }
  107. _AFXWIN_INLINE CDC* CWnd::BeginPaint(LPPAINTSTRUCT lpPaint)
  108.     { ASSERT(::IsWindow(m_hWnd)); return CDC::FromHandle(::BeginPaint(m_hWnd, lpPaint)); }
  109. _AFXWIN_INLINE void CWnd::EndPaint(LPPAINTSTRUCT lpPaint)
  110.     { ASSERT(::IsWindow(m_hWnd)); ::EndPaint(m_hWnd, lpPaint); }
  111. _AFXWIN_INLINE CDC* CWnd::GetDC()
  112.     { ASSERT(::IsWindow(m_hWnd)); return CDC::FromHandle(::GetDC(m_hWnd)); }
  113. _AFXWIN_INLINE CDC* CWnd::GetWindowDC()
  114.     { ASSERT(::IsWindow(m_hWnd)); return CDC::FromHandle(::GetWindowDC(m_hWnd)); }
  115. _AFXWIN_INLINE int CWnd::ReleaseDC(CDC* pDC)
  116.     { ASSERT(::IsWindow(m_hWnd)); return ::ReleaseDC(m_hWnd, pDC->m_hDC); }
  117. _AFXWIN_INLINE void CWnd::UpdateWindow()
  118.     { ASSERT(::IsWindow(m_hWnd)); ::UpdateWindow(m_hWnd); }
  119. _AFXWIN_INLINE void CWnd::SetRedraw(BOOL bRedraw)
  120.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_SETREDRAW, bRedraw, 0); }
  121. _AFXWIN_INLINE BOOL CWnd::GetUpdateRect(LPRECT lpRect, BOOL bErase)
  122.     { ASSERT(::IsWindow(m_hWnd)); return ::GetUpdateRect(m_hWnd, lpRect, bErase); }
  123. _AFXWIN_INLINE int CWnd::GetUpdateRgn(CRgn* pRgn, BOOL bErase)
  124.     { ASSERT(::IsWindow(m_hWnd)); return ::GetUpdateRgn(m_hWnd, (HRGN)pRgn->GetSafeHandle(), bErase); }
  125. _AFXWIN_INLINE void CWnd::Invalidate(BOOL bErase)
  126.     { ASSERT(::IsWindow(m_hWnd)); ::InvalidateRect(m_hWnd, NULL, bErase); }
  127. _AFXWIN_INLINE void CWnd::InvalidateRect(LPCRECT lpRect, BOOL bErase)
  128.     { ASSERT(::IsWindow(m_hWnd)); ::InvalidateRect(m_hWnd, lpRect, bErase); }
  129. _AFXWIN_INLINE void CWnd::InvalidateRgn(CRgn* pRgn, BOOL bErase)
  130.     { ASSERT(::IsWindow(m_hWnd)); ::InvalidateRgn(m_hWnd, (HRGN)pRgn->GetSafeHandle(), bErase); }
  131. _AFXWIN_INLINE void CWnd::ValidateRect(LPCRECT lpRect)
  132.     { ASSERT(::IsWindow(m_hWnd)); ::ValidateRect(m_hWnd, lpRect); }
  133. _AFXWIN_INLINE void CWnd::ValidateRgn(CRgn* pRgn)
  134.     { ASSERT(::IsWindow(m_hWnd)); ::ValidateRgn(m_hWnd, (HRGN)pRgn->GetSafeHandle()); }
  135. #ifdef _AFX_NO_OCC_SUPPORT
  136. _AFXWIN_INLINE BOOL CWnd::ShowWindow(int nCmdShow)
  137.     { ASSERT(::IsWindow(m_hWnd)); return ::ShowWindow(m_hWnd, nCmdShow); }
  138. #endif //_AFX_NO_OCC_SUPPORT
  139. _AFXWIN_INLINE BOOL CWnd::IsWindowVisible() const
  140.     { ASSERT(::IsWindow(m_hWnd)); return ::IsWindowVisible(m_hWnd); }
  141. _AFXWIN_INLINE void CWnd::ShowOwnedPopups(BOOL bShow)
  142.     { ASSERT(::IsWindow(m_hWnd)); ::ShowOwnedPopups(m_hWnd, bShow); }
  143. _AFXWIN_INLINE void CWnd::SendMessageToDescendants(
  144.     UINT message, WPARAM wParam, LPARAM lParam, BOOL bDeep, BOOL bOnlyPerm)
  145.     { ASSERT(::IsWindow(m_hWnd)); CWnd::SendMessageToDescendants(m_hWnd, message, wParam, lParam, bDeep,
  146.         bOnlyPerm); }
  147. _AFXWIN_INLINE CWnd* CWnd::GetDescendantWindow(int nID, BOOL bOnlyPerm) const
  148.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::GetDescendantWindow(m_hWnd, nID, bOnlyPerm); }
  149. #ifdef _AFX_NO_OCC_SUPPORT
  150. _AFXWIN_INLINE BOOL CWnd::IsDialogMessage(LPMSG lpMsg)
  151.     { ASSERT(::IsWindow(m_hWnd)); return ::IsDialogMessage(m_hWnd, lpMsg); }
  152. #endif
  153.  
  154. _AFXWIN_INLINE CDC* CWnd::GetDCEx(CRgn* prgnClip, DWORD flags)
  155.     { ASSERT(::IsWindow(m_hWnd)); return CDC::FromHandle(::GetDCEx(m_hWnd, (HRGN)prgnClip->GetSafeHandle(), flags)); }
  156. #ifndef _MAC
  157. _AFXWIN_INLINE BOOL CWnd::LockWindowUpdate()
  158.     { ASSERT(::IsWindow(m_hWnd)); return ::LockWindowUpdate(m_hWnd); }
  159. _AFXWIN_INLINE void CWnd::UnlockWindowUpdate()
  160.     { ASSERT(::IsWindow(m_hWnd)); ::LockWindowUpdate(NULL); }
  161. #endif
  162. _AFXWIN_INLINE BOOL CWnd::RedrawWindow(LPCRECT lpRectUpdate, CRgn* prgnUpdate,
  163.     UINT flags)
  164.     { ASSERT(::IsWindow(m_hWnd)); return ::RedrawWindow(m_hWnd, lpRectUpdate, (HRGN)prgnUpdate->GetSafeHandle(), flags); }
  165. _AFXWIN_INLINE BOOL CWnd::EnableScrollBar(int nSBFlags, UINT nArrowFlags)
  166.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::EnableScrollBar(m_hWnd, nSBFlags, nArrowFlags); }
  167.  
  168. _AFXWIN_INLINE UINT CWnd::SetTimer(UINT nIDEvent, UINT nElapse,
  169.         void (CALLBACK* lpfnTimer)(HWND, UINT, UINT, DWORD))
  170.     { ASSERT(::IsWindow(m_hWnd)); return ::SetTimer(m_hWnd, nIDEvent, nElapse,
  171.         (TIMERPROC)lpfnTimer); }
  172. _AFXWIN_INLINE BOOL CWnd::KillTimer(int nIDEvent)
  173.     { ASSERT(::IsWindow(m_hWnd)); return ::KillTimer(m_hWnd, nIDEvent); }
  174. #ifdef _AFX_NO_OCC_SUPPORT
  175. _AFXWIN_INLINE BOOL CWnd::IsWindowEnabled() const
  176.     { ASSERT(::IsWindow(m_hWnd)); return ::IsWindowEnabled(m_hWnd); }
  177. _AFXWIN_INLINE BOOL CWnd::EnableWindow(BOOL bEnable)
  178.     { ASSERT(::IsWindow(m_hWnd)); return ::EnableWindow(m_hWnd, bEnable); }
  179. #endif //_AFX_NO_OCC_SUPPORT
  180. _AFXWIN_INLINE CWnd* PASCAL CWnd::GetActiveWindow()
  181.     { return CWnd::FromHandle(::GetActiveWindow()); }
  182. _AFXWIN_INLINE CWnd* CWnd::SetActiveWindow()
  183.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::SetActiveWindow(m_hWnd)); }
  184. _AFXWIN_INLINE CWnd* PASCAL CWnd::GetCapture()
  185.     { return CWnd::FromHandle(::GetCapture()); }
  186. _AFXWIN_INLINE CWnd* CWnd::SetCapture()
  187.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::SetCapture(m_hWnd)); }
  188. _AFXWIN_INLINE CWnd* PASCAL CWnd::GetFocus()
  189.     { return CWnd::FromHandle(::GetFocus()); }
  190. #ifdef _AFX_NO_OCC_SUPPORT
  191. _AFXWIN_INLINE CWnd* CWnd::SetFocus()
  192.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::SetFocus(m_hWnd)); }
  193. #endif //_AFX_NO_OCC_SUPPORT
  194. _AFXWIN_INLINE CWnd* PASCAL CWnd::GetDesktopWindow()
  195.     { return CWnd::FromHandle(::GetDesktopWindow()); }
  196. #ifdef _AFX_NO_OCC_SUPPORT
  197. _AFXWIN_INLINE void CWnd::CheckDlgButton(int nIDButton, UINT nCheck)
  198.     { ASSERT(::IsWindow(m_hWnd)); ::CheckDlgButton(m_hWnd, nIDButton, nCheck); }
  199. _AFXWIN_INLINE void CWnd::CheckRadioButton(int nIDFirstButton, int nIDLastButton,
  200.         int nIDCheckButton)
  201.     { ASSERT(::IsWindow(m_hWnd)); ::CheckRadioButton(m_hWnd, nIDFirstButton, nIDLastButton, nIDCheckButton); }
  202. #endif //_AFX_NO_OCC_SUPPORT
  203. #ifndef _MAC
  204. _AFXWIN_INLINE int CWnd::DlgDirList(LPTSTR lpPathSpec, int nIDListBox,
  205.         int nIDStaticPath, UINT nFileType)
  206.     { ASSERT(::IsWindow(m_hWnd)); return ::DlgDirList(m_hWnd, lpPathSpec, nIDListBox,
  207.             nIDStaticPath, nFileType); }
  208. _AFXWIN_INLINE int CWnd::DlgDirListComboBox(LPTSTR lpPathSpec, int nIDComboBox,
  209.         int nIDStaticPath, UINT nFileType)
  210.     { ASSERT(::IsWindow(m_hWnd)); return ::DlgDirListComboBox(m_hWnd, lpPathSpec,
  211.             nIDComboBox, nIDStaticPath, nFileType); }
  212. _AFXWIN_INLINE BOOL CWnd::DlgDirSelect(LPTSTR lpString, int nIDListBox)
  213.     { ASSERT(::IsWindow(m_hWnd)); return ::DlgDirSelectEx(m_hWnd, lpString, _MAX_PATH, nIDListBox); }
  214. _AFXWIN_INLINE BOOL CWnd::DlgDirSelectComboBox(LPTSTR lpString, int nIDComboBox)
  215.     { ASSERT(::IsWindow(m_hWnd)); return ::DlgDirSelectComboBoxEx(m_hWnd, lpString, _MAX_PATH, nIDComboBox);}
  216. #endif
  217. #ifdef _AFX_NO_OCC_SUPPORT
  218. _AFXWIN_INLINE CWnd* CWnd::GetDlgItem(int nID) const
  219.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetDlgItem(m_hWnd, nID)); }
  220. _AFXWIN_INLINE void CWnd::GetDlgItem(int nID, HWND* phWnd) const
  221.     { ASSERT(::IsWindow(m_hWnd)); ASSERT(phWnd != NULL); *phWnd = ::GetDlgItem(m_hWnd, nID); }
  222. _AFXWIN_INLINE UINT CWnd::GetDlgItemInt(int nID, BOOL* lpTrans,
  223.         BOOL bSigned) const
  224.     { ASSERT(::IsWindow(m_hWnd)); return ::GetDlgItemInt(m_hWnd, nID, lpTrans, bSigned);}
  225. _AFXWIN_INLINE int CWnd::GetDlgItemText(int nID, LPTSTR lpStr, int nMaxCount) const
  226.     { ASSERT(::IsWindow(m_hWnd)); return ::GetDlgItemText(m_hWnd, nID, lpStr, nMaxCount);}
  227. #endif //_AFX_NO_OCC_SUPPORT
  228. _AFXWIN_INLINE CWnd* CWnd::GetNextDlgGroupItem(CWnd* pWndCtl, BOOL bPrevious) const
  229.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetNextDlgGroupItem(m_hWnd,
  230.             pWndCtl->GetSafeHwnd(), bPrevious)); }
  231. _AFXWIN_INLINE CWnd* CWnd::GetNextDlgTabItem(CWnd* pWndCtl, BOOL bPrevious) const
  232.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetNextDlgTabItem(m_hWnd,
  233.             pWndCtl->GetSafeHwnd(), bPrevious)); }
  234. #ifdef _AFX_NO_OCC_SUPPORT
  235. _AFXWIN_INLINE UINT CWnd::IsDlgButtonChecked(int nIDButton) const
  236.     { ASSERT(::IsWindow(m_hWnd)); return ::IsDlgButtonChecked(m_hWnd, nIDButton); }
  237. _AFXWIN_INLINE LPARAM CWnd::SendDlgItemMessage(int nID, UINT message, WPARAM wParam, LPARAM lParam)
  238.     { ASSERT(::IsWindow(m_hWnd)); return ::SendDlgItemMessage(m_hWnd, nID, message, wParam, lParam); }
  239. _AFXWIN_INLINE void CWnd::SetDlgItemInt(int nID, UINT nValue, BOOL bSigned)
  240.     { ASSERT(::IsWindow(m_hWnd)); ::SetDlgItemInt(m_hWnd, nID, nValue, bSigned); }
  241. _AFXWIN_INLINE void CWnd::SetDlgItemText(int nID, LPCTSTR lpszString)
  242.     { ASSERT(::IsWindow(m_hWnd)); ::SetDlgItemText(m_hWnd, nID, lpszString); }
  243. _AFXWIN_INLINE int CWnd::ScrollWindowEx(int dx, int dy,
  244.     LPCRECT lpRectScroll, LPCRECT lpRectClip,
  245.     CRgn* prgnUpdate, LPRECT lpRectUpdate, UINT flags)
  246.     { ASSERT(::IsWindow(m_hWnd)); return ::ScrollWindowEx(m_hWnd, dx, dy, lpRectScroll, lpRectClip,
  247.             (HRGN)prgnUpdate->GetSafeHandle(), lpRectUpdate, flags); }
  248. #endif //_AFX_NO_OCC_SUPPORT
  249.  
  250. _AFXWIN_INLINE void CWnd::ShowScrollBar(UINT nBar, BOOL bShow)
  251.     { ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, nBar, bShow); }
  252. _AFXWIN_INLINE CWnd* CWnd::ChildWindowFromPoint(POINT point) const
  253.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::ChildWindowFromPoint(m_hWnd, point)); }
  254. #ifndef _MAC
  255. _AFXWIN_INLINE CWnd* CWnd::ChildWindowFromPoint(POINT point, UINT nFlags) const
  256.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::ChildWindowFromPointEx(m_hWnd, point, nFlags)); }
  257. #endif
  258. _AFXWIN_INLINE CWnd* PASCAL CWnd::FindWindow(LPCTSTR lpszClassName, LPCTSTR lpszWindowName)
  259.     { return CWnd::FromHandle(::FindWindow(lpszClassName, lpszWindowName)); }
  260. _AFXWIN_INLINE CWnd* CWnd::GetNextWindow(UINT nFlag) const
  261.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetNextWindow(m_hWnd, nFlag)); }
  262. _AFXWIN_INLINE CWnd* CWnd::GetTopWindow() const
  263.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetTopWindow(m_hWnd)); }
  264. _AFXWIN_INLINE CWnd* CWnd::GetWindow(UINT nCmd) const
  265.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetWindow(m_hWnd, nCmd)); }
  266. _AFXWIN_INLINE CWnd* CWnd::GetLastActivePopup() const
  267.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetLastActivePopup(m_hWnd)); }
  268. _AFXWIN_INLINE BOOL CWnd::IsChild(const CWnd* pWnd) const
  269.     { ASSERT(::IsWindow(m_hWnd)); return ::IsChild(m_hWnd, pWnd->GetSafeHwnd()); }
  270. _AFXWIN_INLINE CWnd* CWnd::GetParent() const
  271.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetParent(m_hWnd)); }
  272. _AFXWIN_INLINE CWnd* CWnd::SetParent(CWnd* pWndNewParent)
  273.     { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::SetParent(m_hWnd,
  274.             pWndNewParent->GetSafeHwnd())); }
  275. _AFXWIN_INLINE CWnd* PASCAL CWnd::WindowFromPoint(POINT point)
  276.     { return CWnd::FromHandle(::WindowFromPoint(point)); }
  277. _AFXWIN_INLINE BOOL CWnd::FlashWindow(BOOL bInvert)
  278.     { ASSERT(::IsWindow(m_hWnd)); return ::FlashWindow(m_hWnd, bInvert); }
  279. _AFXWIN_INLINE BOOL CWnd::ChangeClipboardChain(HWND hWndNext)
  280.     { ASSERT(::IsWindow(m_hWnd)); return ::ChangeClipboardChain(m_hWnd, hWndNext); }
  281. _AFXWIN_INLINE HWND CWnd::SetClipboardViewer()
  282.     { ASSERT(::IsWindow(m_hWnd)); return ::SetClipboardViewer(m_hWnd); }
  283. _AFXWIN_INLINE BOOL CWnd::OpenClipboard()
  284.     { ASSERT(::IsWindow(m_hWnd)); return ::OpenClipboard(m_hWnd); }
  285. _AFXWIN_INLINE CWnd* PASCAL CWnd::GetOpenClipboardWindow()
  286.     { return CWnd::FromHandle(::GetOpenClipboardWindow()); }
  287. _AFXWIN_INLINE CWnd* PASCAL CWnd::GetClipboardOwner()
  288.     { return CWnd::FromHandle(::GetClipboardOwner()); }
  289. _AFXWIN_INLINE CWnd* PASCAL CWnd::GetClipboardViewer()
  290.     { return CWnd::FromHandle(::GetClipboardViewer()); }
  291. _AFXWIN_INLINE void CWnd::CreateCaret(CBitmap* pBitmap)
  292.     { ASSERT(::IsWindow(m_hWnd)); ::CreateCaret(m_hWnd, (HBITMAP)pBitmap->GetSafeHandle(), 0, 0); }
  293. _AFXWIN_INLINE void CWnd::CreateSolidCaret(int nWidth, int nHeight)
  294.     { ASSERT(::IsWindow(m_hWnd)); ::CreateCaret(m_hWnd, (HBITMAP)0, nWidth, nHeight); }
  295. _AFXWIN_INLINE void CWnd::CreateGrayCaret(int nWidth, int nHeight)
  296.     { ASSERT(::IsWindow(m_hWnd)); ::CreateCaret(m_hWnd, (HBITMAP)1, nWidth, nHeight); }
  297. _AFXWIN_INLINE CPoint PASCAL CWnd::GetCaretPos()
  298.     { CPoint point; ::GetCaretPos((LPPOINT)&point); return point; }
  299. _AFXWIN_INLINE void PASCAL CWnd::SetCaretPos(POINT point)
  300.     { ::SetCaretPos(point.x, point.y); }
  301. _AFXWIN_INLINE void CWnd::HideCaret()
  302.     { ASSERT(::IsWindow(m_hWnd)); ::HideCaret(m_hWnd); }
  303. _AFXWIN_INLINE void CWnd::ShowCaret()
  304.     { ASSERT(::IsWindow(m_hWnd)); ::ShowCaret(m_hWnd); }
  305. _AFXWIN_INLINE BOOL CWnd::SetForegroundWindow()
  306.     { ASSERT(::IsWindow(m_hWnd)); return ::SetForegroundWindow(m_hWnd); }
  307. _AFXWIN_INLINE CWnd* PASCAL CWnd::GetForegroundWindow()
  308.     { return CWnd::FromHandle(::GetForegroundWindow()); }
  309.  
  310. #ifndef _MAC
  311. _AFXWIN_INLINE BOOL CWnd::SendNotifyMessage(UINT message, WPARAM wParam, LPARAM lParam)
  312.     { ASSERT(::IsWindow(m_hWnd)); return ::SendNotifyMessage(m_hWnd, message, wParam, lParam); }
  313. #endif
  314.  
  315. // Win4
  316. _AFXWIN_INLINE HICON CWnd::SetIcon(HICON hIcon, BOOL bBigIcon)
  317.     { ASSERT(::IsWindow(m_hWnd)); return (HICON)::SendMessage(m_hWnd, WM_SETICON, bBigIcon, (LPARAM)hIcon); }
  318. _AFXWIN_INLINE HICON CWnd::GetIcon(BOOL bBigIcon) const
  319.     { ASSERT(::IsWindow(m_hWnd)); return (HICON)::SendMessage(m_hWnd, WM_GETICON, bBigIcon, 0); }
  320. _AFXWIN_INLINE void CWnd::Print(CDC* pDC, DWORD dwFlags) const
  321.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_PRINT, (WPARAM)pDC->GetSafeHdc(), dwFlags); }
  322. _AFXWIN_INLINE void CWnd::PrintClient(CDC* pDC, DWORD dwFlags) const
  323.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_PRINTCLIENT, (WPARAM)pDC->GetSafeHdc(), dwFlags); }
  324. #ifndef _MAC
  325. _AFXWIN_INLINE BOOL CWnd::SetWindowContextHelpId(DWORD dwContextHelpId)
  326.     { ASSERT(::IsWindow(m_hWnd)); return ::SetWindowContextHelpId(m_hWnd, dwContextHelpId); }
  327. _AFXWIN_INLINE DWORD CWnd::GetWindowContextHelpId() const
  328.     { ASSERT(::IsWindow(m_hWnd)); return ::GetWindowContextHelpId(m_hWnd); }
  329. #endif
  330.  
  331.  
  332. // Default message map implementations
  333. _AFXWIN_INLINE void CWnd::OnActivateApp(BOOL, HTASK)
  334.     { Default(); }
  335. _AFXWIN_INLINE void CWnd::OnActivate(UINT, CWnd*, BOOL)
  336.     { Default(); }
  337. _AFXWIN_INLINE void CWnd::OnCancelMode()
  338.     { Default(); }
  339. _AFXWIN_INLINE void CWnd::OnChildActivate()
  340.     { Default(); }
  341. _AFXWIN_INLINE void CWnd::OnClose()
  342.     { Default(); }
  343. _AFXWIN_INLINE void CWnd::OnContextMenu(CWnd*, CPoint)
  344.     { Default(); }
  345. _AFXWIN_INLINE int CWnd::OnCreate(LPCREATESTRUCT)
  346.     { return (int)Default(); }
  347. _AFXWIN_INLINE void CWnd::OnDestroy()
  348.     { Default(); }
  349. _AFXWIN_INLINE void CWnd::OnEnable(BOOL)
  350.     { Default(); }
  351. _AFXWIN_INLINE void CWnd::OnEndSession(BOOL)
  352.     { Default(); }
  353. _AFXWIN_INLINE BOOL CWnd::OnEraseBkgnd(CDC*)
  354.     { return (BOOL)Default(); }
  355. _AFXWIN_INLINE void CWnd::OnGetMinMaxInfo(MINMAXINFO*)
  356.     { Default(); }
  357. _AFXWIN_INLINE void CWnd::OnIconEraseBkgnd(CDC*)
  358.     { Default(); }
  359. _AFXWIN_INLINE void CWnd::OnKillFocus(CWnd*)
  360.     { Default(); }
  361. _AFXWIN_INLINE LRESULT CWnd::OnMenuChar(UINT, UINT, CMenu*)
  362.     { return Default(); }
  363. _AFXWIN_INLINE void CWnd::OnMenuSelect(UINT, UINT, HMENU)
  364.     { Default(); }
  365. _AFXWIN_INLINE void CWnd::OnMove(int, int)
  366.     { Default(); }
  367. _AFXWIN_INLINE void CWnd::OnPaint()
  368.     { Default(); }
  369. _AFXWIN_INLINE HCURSOR CWnd::OnQueryDragIcon()
  370.     { return (HCURSOR)Default(); }
  371. _AFXWIN_INLINE BOOL CWnd::OnQueryEndSession()
  372.     { return (BOOL)Default(); }
  373. _AFXWIN_INLINE BOOL CWnd::OnQueryNewPalette()
  374.     { return (BOOL)Default(); }
  375. _AFXWIN_INLINE BOOL CWnd::OnQueryOpen()
  376.     { return (BOOL)Default(); }
  377. _AFXWIN_INLINE BOOL CWnd::OnSetCursor(CWnd*, UINT, UINT)
  378.     { return (BOOL)Default(); }
  379. _AFXWIN_INLINE void CWnd::OnSetFocus(CWnd*)
  380.     { Default(); }
  381. _AFXWIN_INLINE void CWnd::OnShowWindow(BOOL, UINT)
  382.     { Default(); }
  383. _AFXWIN_INLINE void CWnd::OnSize(UINT, int, int)
  384.     { Default(); }
  385. _AFXWIN_INLINE void CWnd::OnTCard(UINT, DWORD)
  386.     { Default(); }
  387. _AFXWIN_INLINE void CWnd::OnWindowPosChanging(WINDOWPOS*)
  388.     { Default(); }
  389. _AFXWIN_INLINE void CWnd::OnWindowPosChanged(WINDOWPOS*)
  390.     { Default(); }
  391. _AFXWIN_INLINE void CWnd::OnDropFiles(HDROP)
  392.     { Default(); }
  393. _AFXWIN_INLINE void CWnd::OnPaletteIsChanging(CWnd*)
  394.     { Default(); }
  395. _AFXWIN_INLINE BOOL CWnd::OnNcActivate(BOOL)
  396.     { return (BOOL)Default(); }
  397. _AFXWIN_INLINE void CWnd::OnNcCalcSize(BOOL, NCCALCSIZE_PARAMS*)
  398.     { Default(); }
  399. _AFXWIN_INLINE BOOL CWnd::OnNcCreate(LPCREATESTRUCT)
  400.     { return (BOOL)Default(); }
  401. _AFXWIN_INLINE UINT CWnd::OnNcHitTest(CPoint)
  402.     { return (UINT)Default(); }
  403. _AFXWIN_INLINE void CWnd::OnNcLButtonDblClk(UINT, CPoint)
  404.     { Default(); }
  405. _AFXWIN_INLINE void CWnd::OnNcLButtonDown(UINT, CPoint)
  406.     { Default(); }
  407. _AFXWIN_INLINE void CWnd::OnNcLButtonUp(UINT, CPoint)
  408.     { Default(); }
  409. _AFXWIN_INLINE void CWnd::OnNcMButtonDblClk(UINT, CPoint)
  410.     { Default(); }
  411. _AFXWIN_INLINE void CWnd::OnNcMButtonDown(UINT, CPoint)
  412.     { Default(); }
  413. _AFXWIN_INLINE void CWnd::OnNcMButtonUp(UINT, CPoint)
  414.     { Default(); }
  415. _AFXWIN_INLINE void CWnd::OnNcMouseMove(UINT, CPoint)
  416.     { Default(); }
  417. _AFXWIN_INLINE void CWnd::OnNcPaint()
  418.     { Default(); }
  419. _AFXWIN_INLINE void CWnd::OnNcRButtonDblClk(UINT, CPoint)
  420.     { Default(); }
  421. _AFXWIN_INLINE void CWnd::OnNcRButtonDown(UINT, CPoint)
  422.     { Default(); }
  423. _AFXWIN_INLINE void CWnd::OnNcRButtonUp(UINT, CPoint)
  424.     { Default(); }
  425. _AFXWIN_INLINE void CWnd::OnSysChar(UINT, UINT, UINT)
  426.     { Default(); }
  427. _AFXWIN_INLINE void CWnd::OnSysCommand(UINT, LPARAM)
  428.     { Default(); }
  429. _AFXWIN_INLINE void CWnd::OnSysDeadChar(UINT, UINT, UINT)
  430.     { Default(); }
  431. _AFXWIN_INLINE void CWnd::OnSysKeyDown(UINT, UINT, UINT)
  432.     { Default(); }
  433. _AFXWIN_INLINE void CWnd::OnSysKeyUp(UINT, UINT, UINT)
  434.     { Default(); }
  435. _AFXWIN_INLINE void CWnd::OnCompacting(UINT)
  436.     { Default(); }
  437. _AFXWIN_INLINE void CWnd::OnFontChange()
  438.     { Default(); }
  439. _AFXWIN_INLINE void CWnd::OnPaletteChanged(CWnd*)
  440.     { Default(); }
  441. _AFXWIN_INLINE void CWnd::OnSpoolerStatus(UINT, UINT)
  442.     { Default(); }
  443. _AFXWIN_INLINE void CWnd::OnTimeChange()
  444.     { Default(); }
  445. _AFXWIN_INLINE void CWnd::OnChar(UINT, UINT, UINT)
  446.     { Default(); }
  447. _AFXWIN_INLINE void CWnd::OnDeadChar(UINT, UINT, UINT)
  448.     { Default(); }
  449. _AFXWIN_INLINE void CWnd::OnKeyDown(UINT, UINT, UINT)
  450.     { Default(); }
  451. _AFXWIN_INLINE void CWnd::OnKeyUp(UINT, UINT, UINT)
  452.     { Default(); }
  453. _AFXWIN_INLINE void CWnd::OnLButtonDblClk(UINT, CPoint)
  454.     { Default(); }
  455. _AFXWIN_INLINE void CWnd::OnLButtonDown(UINT, CPoint)
  456.     { Default(); }
  457. _AFXWIN_INLINE void CWnd::OnLButtonUp(UINT, CPoint)
  458.     { Default(); }
  459. _AFXWIN_INLINE void CWnd::OnMButtonDblClk(UINT, CPoint)
  460.     { Default(); }
  461. _AFXWIN_INLINE void CWnd::OnMButtonDown(UINT, CPoint)
  462.     { Default(); }
  463. _AFXWIN_INLINE void CWnd::OnMButtonUp(UINT, CPoint)
  464.     { Default(); }
  465. _AFXWIN_INLINE int CWnd::OnMouseActivate(CWnd*, UINT, UINT)
  466.     { return (int)Default(); }
  467. _AFXWIN_INLINE void CWnd::OnMouseMove(UINT, CPoint)
  468.     { Default(); }
  469. _AFXWIN_INLINE void CWnd::OnRButtonDblClk(UINT, CPoint)
  470.     { Default(); }
  471. _AFXWIN_INLINE void CWnd::OnRButtonDown(UINT, CPoint)
  472.     { Default(); }
  473. _AFXWIN_INLINE void CWnd::OnRButtonUp(UINT, CPoint)
  474.     { Default(); }
  475. _AFXWIN_INLINE void CWnd::OnTimer(UINT)
  476.     { Default(); }
  477. _AFXWIN_INLINE void CWnd::OnInitMenu(CMenu*)
  478.     { Default(); }
  479. _AFXWIN_INLINE void CWnd::OnInitMenuPopup(CMenu*, UINT, BOOL)
  480.     { Default(); }
  481. _AFXWIN_INLINE void CWnd::OnAskCbFormatName(UINT, LPTSTR)
  482.     { Default(); }
  483. _AFXWIN_INLINE void CWnd::OnChangeCbChain(HWND, HWND)
  484.     { Default(); }
  485. _AFXWIN_INLINE void CWnd::OnDestroyClipboard()
  486.     { Default(); }
  487. _AFXWIN_INLINE void CWnd::OnDrawClipboard()
  488.     { Default(); }
  489. _AFXWIN_INLINE void CWnd::OnHScrollClipboard(CWnd*, UINT, UINT)
  490.     { Default(); }
  491. _AFXWIN_INLINE void CWnd::OnPaintClipboard(CWnd*, HGLOBAL)
  492.     { Default(); }
  493. _AFXWIN_INLINE void CWnd::OnRenderAllFormats()
  494.     { Default(); }
  495. _AFXWIN_INLINE void CWnd::OnRenderFormat(UINT)
  496.     { Default(); }
  497. _AFXWIN_INLINE void CWnd::OnSizeClipboard(CWnd*, HGLOBAL)
  498.     { Default(); }
  499. _AFXWIN_INLINE void CWnd::OnVScrollClipboard(CWnd*, UINT, UINT)
  500.     { Default(); }
  501. _AFXWIN_INLINE UINT CWnd::OnGetDlgCode()
  502.     { return (UINT)Default(); }
  503. _AFXWIN_INLINE void CWnd::OnMDIActivate(BOOL, CWnd*, CWnd*)
  504.     { Default(); }
  505. _AFXWIN_INLINE void CWnd::OnEnterMenuLoop(BOOL)
  506.     { Default(); }
  507. _AFXWIN_INLINE void CWnd::OnExitMenuLoop(BOOL)
  508.     { Default(); }
  509. // Win4 support
  510. _AFXWIN_INLINE void CWnd::OnStyleChanged(int, LPSTYLESTRUCT)
  511.     { Default(); }
  512. _AFXWIN_INLINE void CWnd::OnStyleChanging(int, LPSTYLESTRUCT)
  513.     { Default(); }
  514. _AFXWIN_INLINE void CWnd::OnSizing(UINT, LPRECT)
  515.     { Default(); }
  516. _AFXWIN_INLINE void CWnd::OnMoving(UINT, LPRECT)
  517.     { Default(); }
  518. _AFXWIN_INLINE void CWnd::OnCaptureChanged(CWnd*)
  519.     { Default(); }
  520. _AFXWIN_INLINE BOOL CWnd::OnDeviceChange(UINT, DWORD)
  521.     { return (BOOL)Default(); }
  522.  
  523. // CWnd dialog data support
  524. _AFXWIN_INLINE void CWnd::DoDataExchange(CDataExchange*)
  525.     { } // default does nothing
  526.  
  527. // CWnd modality support
  528. _AFXWIN_INLINE void CWnd::BeginModalState()
  529.     { ::EnableWindow(m_hWnd, FALSE); }
  530. _AFXWIN_INLINE void CWnd::EndModalState()
  531.     { ::EnableWindow(m_hWnd, TRUE); }
  532.  
  533. // CFrameWnd
  534. _AFXWIN_INLINE void CFrameWnd::DelayUpdateFrameTitle()
  535.     { m_nIdleFlags |= idleTitle; }
  536. _AFXWIN_INLINE void CFrameWnd::DelayRecalcLayout(BOOL bNotify)
  537.     { m_nIdleFlags |= (idleLayout | (bNotify ? idleNotify : 0)); };
  538. _AFXWIN_INLINE BOOL CFrameWnd::InModalState() const
  539.     { return m_cModalStack != 0; }
  540. _AFXWIN_INLINE void CFrameWnd::AddControlBar(CControlBar *pBar)
  541.     { m_listControlBars.AddTail(pBar); }
  542.  
  543. // CDialog
  544. _AFXWIN_INLINE BOOL CDialog::Create(UINT nIDTemplate, CWnd* pParentWnd)
  545.     { return Create(MAKEINTRESOURCE(nIDTemplate), pParentWnd); }
  546. _AFXWIN_INLINE void CDialog::MapDialogRect(LPRECT lpRect) const
  547.     { ASSERT(::IsWindow(m_hWnd)); ::MapDialogRect(m_hWnd, lpRect); }
  548. _AFXWIN_INLINE void CDialog::SetHelpID(UINT nIDR)
  549.     { m_nIDHelp = nIDR; }
  550. _AFXWIN_INLINE void CDialog::NextDlgCtrl() const
  551.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_NEXTDLGCTL, 0, 0); }
  552. _AFXWIN_INLINE void CDialog::PrevDlgCtrl() const
  553.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_NEXTDLGCTL, 1, 0); }
  554. _AFXWIN_INLINE void CDialog::GotoDlgCtrl(CWnd* pWndCtrl)
  555.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_NEXTDLGCTL, (WPARAM)pWndCtrl->m_hWnd, 1L); }
  556. _AFXWIN_INLINE void CDialog::SetDefID(UINT nID)
  557.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, DM_SETDEFID, nID, 0); }
  558. _AFXWIN_INLINE DWORD CDialog::GetDefID() const
  559.     { ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, DM_GETDEFID, 0, 0); }
  560.  
  561. // Window control functions
  562. _AFXWIN_INLINE CStatic::CStatic()
  563.     { }
  564. _AFXWIN_INLINE HICON CStatic::SetIcon(HICON hIcon)
  565.     { ASSERT(::IsWindow(m_hWnd)); return (HICON)::SendMessage(m_hWnd, STM_SETICON, (WPARAM)hIcon, 0L); }
  566. _AFXWIN_INLINE HICON CStatic::GetIcon() const
  567.     { ASSERT(::IsWindow(m_hWnd)); return (HICON)::SendMessage(m_hWnd, STM_GETICON, 0, 0L); }
  568. #if (WINVER >= 0x400)
  569. _AFXWIN_INLINE HENHMETAFILE CStatic::SetEnhMetaFile(HENHMETAFILE hMetaFile)
  570.     { ASSERT(::IsWindow(m_hWnd)); return (HENHMETAFILE)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_ENHMETAFILE, (LPARAM)hMetaFile); }
  571. _AFXWIN_INLINE HENHMETAFILE CStatic::GetEnhMetaFile() const
  572.     { ASSERT(::IsWindow(m_hWnd)); return (HENHMETAFILE)::SendMessage(m_hWnd, STM_GETIMAGE, IMAGE_ENHMETAFILE, 0L); }
  573. _AFXWIN_INLINE HBITMAP CStatic::SetBitmap(HBITMAP hBitmap)
  574.     { ASSERT(::IsWindow(m_hWnd)); return (HBITMAP)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap); }
  575. _AFXWIN_INLINE HBITMAP CStatic::GetBitmap() const
  576.     { ASSERT(::IsWindow(m_hWnd)); return (HBITMAP)::SendMessage(m_hWnd, STM_GETIMAGE, IMAGE_BITMAP, 0L); }
  577. _AFXWIN_INLINE HCURSOR CStatic::SetCursor(HCURSOR hCursor)
  578.     { ASSERT(::IsWindow(m_hWnd)); return (HCURSOR)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_CURSOR, (LPARAM)hCursor); }
  579. _AFXWIN_INLINE HCURSOR CStatic::GetCursor()
  580.     { ASSERT(::IsWindow(m_hWnd)); return (HCURSOR)::SendMessage(m_hWnd, STM_GETIMAGE, IMAGE_CURSOR, 0L); }
  581. #endif
  582.  
  583. _AFXWIN_INLINE CButton::CButton()
  584.     { }
  585. _AFXWIN_INLINE UINT CButton::GetState() const
  586.     { ASSERT(::IsWindow(m_hWnd)); return (UINT)::SendMessage(m_hWnd, BM_GETSTATE, 0, 0); }
  587. _AFXWIN_INLINE void CButton::SetState(BOOL bHighlight)
  588.     { ::SendMessage(m_hWnd, BM_SETSTATE, bHighlight, 0); }
  589. _AFXWIN_INLINE int CButton::GetCheck() const
  590.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, BM_GETCHECK, 0, 0); }
  591. _AFXWIN_INLINE void CButton::SetCheck(int nCheck)
  592.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, BM_SETCHECK, nCheck, 0); }
  593. _AFXWIN_INLINE UINT CButton::GetButtonStyle() const
  594.     { ASSERT(::IsWindow(m_hWnd)); return (UINT)GetWindowLong(m_hWnd, GWL_STYLE) & 0xff; }
  595. _AFXWIN_INLINE void CButton::SetButtonStyle(UINT nStyle, BOOL bRedraw)
  596.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, BM_SETSTYLE, nStyle, (LPARAM)bRedraw); }
  597. // Win4
  598. #if (WINVER >= 0x400)
  599. _AFXWIN_INLINE HICON CButton::SetIcon(HICON hIcon)
  600.     { ASSERT(::IsWindow(m_hWnd)); return (HICON)::SendMessage(m_hWnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); }
  601. _AFXWIN_INLINE HICON CButton::GetIcon() const
  602.     { ASSERT(::IsWindow(m_hWnd)); return (HICON)::SendMessage(m_hWnd, BM_GETIMAGE, IMAGE_ICON, 0L); }
  603. _AFXWIN_INLINE HBITMAP CButton::SetBitmap(HBITMAP hBitmap)
  604.     { ASSERT(::IsWindow(m_hWnd)); return (HBITMAP)::SendMessage(m_hWnd, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap); }
  605. _AFXWIN_INLINE HBITMAP CButton::GetBitmap() const
  606.     { ASSERT(::IsWindow(m_hWnd)); return (HBITMAP)::SendMessage(m_hWnd, BM_GETIMAGE, IMAGE_BITMAP, 0L); }
  607. _AFXWIN_INLINE HCURSOR CButton::SetCursor(HCURSOR hCursor)
  608.     { ASSERT(::IsWindow(m_hWnd)); return (HCURSOR)::SendMessage(m_hWnd, BM_SETIMAGE, IMAGE_CURSOR, (LPARAM)hCursor); }
  609. _AFXWIN_INLINE HCURSOR CButton::GetCursor()
  610.     { ASSERT(::IsWindow(m_hWnd)); return (HCURSOR)::SendMessage(m_hWnd, BM_GETIMAGE, IMAGE_CURSOR, 0L); }
  611. #endif
  612.  
  613. _AFXWIN_INLINE CListBox::CListBox()
  614.     { }
  615. _AFXWIN_INLINE int CListBox::GetCount() const
  616.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETCOUNT, 0, 0); }
  617. _AFXWIN_INLINE int CListBox::GetCurSel() const
  618.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETCURSEL, 0, 0); }
  619. _AFXWIN_INLINE int CListBox::SetCurSel(int nSelect)
  620.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SETCURSEL, nSelect, 0); }
  621. _AFXWIN_INLINE int CListBox::GetHorizontalExtent() const
  622.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETHORIZONTALEXTENT,
  623.         0, 0); }
  624. _AFXWIN_INLINE void CListBox::SetHorizontalExtent(int cxExtent)
  625.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, LB_SETHORIZONTALEXTENT, cxExtent, 0); }
  626. _AFXWIN_INLINE int CListBox::GetSelCount() const
  627.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETSELCOUNT, 0, 0); }
  628. _AFXWIN_INLINE int CListBox::GetSelItems(int nMaxItems, LPINT rgIndex) const
  629.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETSELITEMS, nMaxItems, (LPARAM)rgIndex); }
  630. _AFXWIN_INLINE int CListBox::GetTopIndex() const
  631.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETTOPINDEX, 0, 0); }
  632. _AFXWIN_INLINE int CListBox::SetTopIndex(int nIndex)
  633.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SETTOPINDEX, nIndex, 0);}
  634. _AFXWIN_INLINE DWORD CListBox::GetItemData(int nIndex) const
  635.     { ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, LB_GETITEMDATA, nIndex, 0); }
  636. _AFXWIN_INLINE int CListBox::SetItemData(int nIndex, DWORD dwItemData)
  637.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SETITEMDATA, nIndex, (LPARAM)dwItemData); }
  638. _AFXWIN_INLINE void* CListBox::GetItemDataPtr(int nIndex) const
  639.     { ASSERT(::IsWindow(m_hWnd)); return (LPVOID)::SendMessage(m_hWnd, LB_GETITEMDATA, nIndex, 0); }
  640. _AFXWIN_INLINE int CListBox::SetItemDataPtr(int nIndex, void* pData)
  641.     { ASSERT(::IsWindow(m_hWnd)); return SetItemData(nIndex, (DWORD)(LPVOID)pData); }
  642. _AFXWIN_INLINE int CListBox::GetItemRect(int nIndex, LPRECT lpRect) const
  643.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETITEMRECT, nIndex, (LPARAM)lpRect); }
  644. _AFXWIN_INLINE int CListBox::GetSel(int nIndex) const
  645.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETSEL, nIndex, 0); }
  646. _AFXWIN_INLINE int CListBox::SetSel(int nIndex, BOOL bSelect)
  647.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SETSEL, bSelect, nIndex); }
  648. _AFXWIN_INLINE int CListBox::GetText(int nIndex, LPTSTR lpszBuffer) const
  649.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETTEXT, nIndex, (LPARAM)lpszBuffer); }
  650. _AFXWIN_INLINE int CListBox::GetTextLen(int nIndex) const
  651.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETTEXTLEN, nIndex, 0); }
  652. _AFXWIN_INLINE void CListBox::SetColumnWidth(int cxWidth)
  653.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, LB_SETCOLUMNWIDTH, cxWidth, 0); }
  654. _AFXWIN_INLINE BOOL CListBox::SetTabStops(int nTabStops, LPINT rgTabStops)
  655.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, LB_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops); }
  656. _AFXWIN_INLINE void CListBox::SetTabStops()
  657.     { ASSERT(::IsWindow(m_hWnd)); VERIFY(::SendMessage(m_hWnd, LB_SETTABSTOPS, 0, 0)); }
  658. _AFXWIN_INLINE BOOL CListBox::SetTabStops(const int& cxEachStop)
  659.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, LB_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop); }
  660. _AFXWIN_INLINE int CListBox::SetItemHeight(int nIndex, UINT cyItemHeight)
  661.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0)); }
  662. _AFXWIN_INLINE int CListBox::GetItemHeight(int nIndex) const
  663.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETITEMHEIGHT, nIndex, 0L); }
  664. _AFXWIN_INLINE int CListBox::FindStringExact(int nIndexStart, LPCTSTR lpszFind) const
  665.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_FINDSTRINGEXACT, nIndexStart, (LPARAM)lpszFind); }
  666. _AFXWIN_INLINE int CListBox::GetCaretIndex() const
  667.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETCARETINDEX, 0, 0L); }
  668. _AFXWIN_INLINE int CListBox::SetCaretIndex(int nIndex, BOOL bScroll)
  669.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SETCARETINDEX, nIndex, MAKELONG(bScroll, 0)); }
  670. _AFXWIN_INLINE int CListBox::AddString(LPCTSTR lpszItem)
  671.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_ADDSTRING, 0, (LPARAM)lpszItem); }
  672. _AFXWIN_INLINE int CListBox::DeleteString(UINT nIndex)
  673.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_DELETESTRING, nIndex, 0); }
  674. _AFXWIN_INLINE int CListBox::InsertString(int nIndex, LPCTSTR lpszItem)
  675.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_INSERTSTRING, nIndex, (LPARAM)lpszItem); }
  676. _AFXWIN_INLINE void CListBox::ResetContent()
  677.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, LB_RESETCONTENT, 0, 0); }
  678. _AFXWIN_INLINE int CListBox::Dir(UINT attr, LPCTSTR lpszWildCard)
  679.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_DIR, attr, (LPARAM)lpszWildCard); }
  680. _AFXWIN_INLINE int CListBox::FindString(int nStartAfter, LPCTSTR lpszItem) const
  681.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_FINDSTRING,
  682.         nStartAfter, (LPARAM)lpszItem); }
  683. _AFXWIN_INLINE int CListBox::SelectString(int nStartAfter, LPCTSTR lpszItem)
  684.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SELECTSTRING,
  685.         nStartAfter, (LPARAM)lpszItem); }
  686. _AFXWIN_INLINE int CListBox::SelItemRange(BOOL bSelect, int nFirstItem, int nLastItem)
  687.     { ASSERT(::IsWindow(m_hWnd)); return bSelect ?
  688.         (int)::SendMessage(m_hWnd, LB_SELITEMRANGEEX, nFirstItem, nLastItem) :
  689.         (int)::SendMessage(m_hWnd, LB_SELITEMRANGEEX, nLastItem, nFirstItem); }
  690. _AFXWIN_INLINE void CListBox::SetAnchorIndex(int nIndex)
  691.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, LB_SETANCHORINDEX, nIndex, 0); }
  692. _AFXWIN_INLINE int CListBox::GetAnchorIndex() const
  693.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETANCHORINDEX, 0, 0); }
  694. _AFXWIN_INLINE LCID CListBox::GetLocale() const
  695.     { ASSERT(::IsWindow(m_hWnd)); return (LCID)::SendMessage(m_hWnd, LB_GETLOCALE, 0, 0); }
  696. _AFXWIN_INLINE LCID CListBox::SetLocale(LCID nNewLocale)
  697.     { ASSERT(::IsWindow(m_hWnd)); return (LCID)::SendMessage(m_hWnd, LB_SETLOCALE, (WPARAM)nNewLocale, 0); }
  698. #if (WINVER >= 0x400)
  699. _AFXWIN_INLINE int CListBox::InitStorage(int nItems, UINT nBytes)
  700.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_INITSTORAGE, (WPARAM)nItems, nBytes); }
  701. #endif
  702.  
  703. _AFXWIN_INLINE CCheckListBox::CCheckListBox()
  704.     { m_cyText = 0; m_nStyle = 0; }
  705. _AFXWIN_INLINE UINT CCheckListBox::GetCheckStyle()
  706.     { return m_nStyle; }
  707.  
  708. _AFXWIN_INLINE CComboBox::CComboBox()
  709.     { }
  710. _AFXWIN_INLINE int CComboBox::GetCount() const
  711.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_GETCOUNT, 0, 0); }
  712. _AFXWIN_INLINE int CComboBox::GetCurSel() const
  713.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_GETCURSEL, 0, 0); }
  714. _AFXWIN_INLINE int CComboBox::SetCurSel(int nSelect)
  715.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_SETCURSEL, nSelect, 0); }
  716. _AFXWIN_INLINE DWORD CComboBox::GetEditSel() const
  717.     { ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, CB_GETEDITSEL, 0, 0); }
  718. _AFXWIN_INLINE BOOL CComboBox::LimitText(int nMaxChars)
  719.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, CB_LIMITTEXT, nMaxChars, 0); }
  720. _AFXWIN_INLINE BOOL CComboBox::SetEditSel(int nStartChar, int nEndChar)
  721.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, CB_SETEDITSEL, 0, MAKELONG(nStartChar, nEndChar)); }
  722. _AFXWIN_INLINE DWORD CComboBox::GetItemData(int nIndex) const
  723.     { ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, CB_GETITEMDATA, nIndex, 0); }
  724. _AFXWIN_INLINE int CComboBox::SetItemData(int nIndex, DWORD dwItemData)
  725.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_SETITEMDATA, nIndex, (LPARAM)dwItemData); }
  726. _AFXWIN_INLINE void* CComboBox::GetItemDataPtr(int nIndex) const
  727.     { ASSERT(::IsWindow(m_hWnd)); return (LPVOID)GetItemData(nIndex); }
  728. _AFXWIN_INLINE int CComboBox::SetItemDataPtr(int nIndex, void* pData)
  729.     { ASSERT(::IsWindow(m_hWnd)); return SetItemData(nIndex, (DWORD)(LPVOID)pData); }
  730. _AFXWIN_INLINE int CComboBox::GetLBText(int nIndex, LPTSTR lpszText) const
  731.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_GETLBTEXT, nIndex, (LPARAM)lpszText); }
  732. _AFXWIN_INLINE int CComboBox::GetLBTextLen(int nIndex) const
  733.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_GETLBTEXTLEN, nIndex, 0); }
  734. _AFXWIN_INLINE void CComboBox::ShowDropDown(BOOL bShowIt)
  735.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, CB_SHOWDROPDOWN, bShowIt, 0); }
  736. _AFXWIN_INLINE int CComboBox::AddString(LPCTSTR lpszString)
  737.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_ADDSTRING, 0, (LPARAM)lpszString); }
  738. _AFXWIN_INLINE int CComboBox::DeleteString(UINT nIndex)
  739.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_DELETESTRING, nIndex, 0);}
  740. _AFXWIN_INLINE int CComboBox::InsertString(int nIndex, LPCTSTR lpszString)
  741.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_INSERTSTRING, nIndex, (LPARAM)lpszString); }
  742. _AFXWIN_INLINE void CComboBox::ResetContent()
  743.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, CB_RESETCONTENT, 0, 0); }
  744. _AFXWIN_INLINE int CComboBox::Dir(UINT attr, LPCTSTR lpszWildCard)
  745.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_DIR, attr, (LPARAM)lpszWildCard); }
  746. _AFXWIN_INLINE int CComboBox::FindString(int nStartAfter, LPCTSTR lpszString) const
  747.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_FINDSTRING, nStartAfter,
  748.         (LPARAM)lpszString); }
  749. _AFXWIN_INLINE int CComboBox::SelectString(int nStartAfter, LPCTSTR lpszString)
  750.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_SELECTSTRING,
  751.         nStartAfter, (LPARAM)lpszString); }
  752. _AFXWIN_INLINE void CComboBox::Clear()
  753.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_CLEAR, 0, 0); }
  754. _AFXWIN_INLINE void CComboBox::Copy()
  755.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_COPY, 0, 0); }
  756. _AFXWIN_INLINE void CComboBox::Cut()
  757.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_CUT, 0, 0); }
  758. _AFXWIN_INLINE void CComboBox::Paste()
  759.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_PASTE, 0, 0); }
  760. _AFXWIN_INLINE int CComboBox::SetItemHeight(int nIndex, UINT cyItemHeight)
  761.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0)); }
  762. _AFXWIN_INLINE int CComboBox::GetItemHeight(int nIndex) const
  763.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_GETITEMHEIGHT, nIndex, 0L); }
  764. _AFXWIN_INLINE int CComboBox::FindStringExact(int nIndexStart, LPCTSTR lpszFind) const
  765.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_FINDSTRINGEXACT, nIndexStart, (LPARAM)lpszFind); }
  766. _AFXWIN_INLINE int CComboBox::SetExtendedUI(BOOL bExtended )
  767.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_SETEXTENDEDUI, bExtended, 0L); }
  768. _AFXWIN_INLINE BOOL CComboBox::GetExtendedUI() const
  769.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, CB_GETEXTENDEDUI, 0, 0L); }
  770. _AFXWIN_INLINE void CComboBox::GetDroppedControlRect(LPRECT lprect) const
  771.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, CB_GETDROPPEDCONTROLRECT, 0, (DWORD)lprect); }
  772. _AFXWIN_INLINE BOOL CComboBox::GetDroppedState() const
  773.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, CB_GETDROPPEDSTATE, 0, 0L); }
  774. _AFXWIN_INLINE LCID CComboBox::GetLocale() const
  775.     { ASSERT(::IsWindow(m_hWnd)); return (LCID)::SendMessage(m_hWnd, CB_GETLOCALE, 0, 0); }
  776. _AFXWIN_INLINE LCID CComboBox::SetLocale(LCID nNewLocale)
  777.     { ASSERT(::IsWindow(m_hWnd)); return (LCID)::SendMessage(m_hWnd, CB_SETLOCALE, (WPARAM)nNewLocale, 0); }
  778. #if (WINVER >= 0x400)
  779. _AFXWIN_INLINE int CComboBox::GetTopIndex() const
  780.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_GETTOPINDEX, 0, 0); }
  781. _AFXWIN_INLINE int CComboBox::SetTopIndex(int nIndex)
  782.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_SETTOPINDEX, nIndex, 0); }
  783. _AFXWIN_INLINE int CComboBox::InitStorage(int nItems, UINT nBytes)
  784.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_INITSTORAGE, (WPARAM)nItems, nBytes); }
  785. _AFXWIN_INLINE void CComboBox::SetHorizontalExtent(UINT nExtent)
  786.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, CB_SETHORIZONTALEXTENT, nExtent, 0); }
  787. _AFXWIN_INLINE UINT CComboBox::GetHorizontalExtent() const
  788.     { ASSERT(::IsWindow(m_hWnd)); return (UINT)::SendMessage(m_hWnd, CB_GETHORIZONTALEXTENT, 0, 0); }
  789. _AFXWIN_INLINE int CComboBox::SetDroppedWidth(UINT nWidth)
  790.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_SETDROPPEDWIDTH, nWidth, 0); }
  791. _AFXWIN_INLINE int CComboBox::GetDroppedWidth() const
  792.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_GETDROPPEDWIDTH, 0, 0); }
  793. #endif
  794. _AFXWIN_INLINE CEdit::CEdit()
  795.     { }
  796. _AFXWIN_INLINE BOOL CEdit::CanUndo() const
  797.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_CANUNDO, 0, 0); }
  798. _AFXWIN_INLINE int CEdit::GetLineCount() const
  799.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_GETLINECOUNT, 0, 0); }
  800. _AFXWIN_INLINE BOOL CEdit::GetModify() const
  801.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_GETMODIFY, 0, 0); }
  802. _AFXWIN_INLINE void CEdit::SetModify(BOOL bModified)
  803.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETMODIFY, bModified, 0); }
  804. _AFXWIN_INLINE void CEdit::GetRect(LPRECT lpRect) const
  805.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_GETRECT, 0, (LPARAM)lpRect); }
  806. _AFXWIN_INLINE void CEdit::GetSel(int& nStartChar, int& nEndChar) const
  807.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_GETSEL, (WPARAM)&nStartChar,(LPARAM)&nEndChar); }
  808. _AFXWIN_INLINE DWORD CEdit::GetSel() const
  809.     { ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, EM_GETSEL, 0, 0); }
  810. _AFXWIN_INLINE HLOCAL CEdit::GetHandle() const
  811.     { ASSERT(::IsWindow(m_hWnd)); return (HLOCAL)::SendMessage(m_hWnd, EM_GETHANDLE, 0, 0); }
  812. _AFXWIN_INLINE void CEdit::SetHandle(HLOCAL hBuffer)
  813.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETHANDLE, (WPARAM)hBuffer, 0); }
  814. _AFXWIN_INLINE int CEdit::GetLine(int nIndex, LPTSTR lpszBuffer) const
  815.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer); }
  816. _AFXWIN_INLINE int CEdit::GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const
  817.     {
  818.         ASSERT(::IsWindow(m_hWnd));
  819.         *(LPWORD)lpszBuffer = (WORD)nMaxLength;
  820.         return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer);
  821.     }
  822. _AFXWIN_INLINE void CEdit::EmptyUndoBuffer()
  823.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_EMPTYUNDOBUFFER, 0, 0); }
  824. _AFXWIN_INLINE BOOL CEdit::FmtLines(BOOL bAddEOL)
  825.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_FMTLINES, bAddEOL, 0); }
  826. _AFXWIN_INLINE void CEdit::LimitText(int nChars)
  827.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_LIMITTEXT, nChars, 0); }
  828. _AFXWIN_INLINE int CEdit::LineFromChar(int nIndex) const
  829.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_LINEFROMCHAR, nIndex, 0); }
  830. _AFXWIN_INLINE int CEdit::LineIndex(int nLine) const
  831.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_LINEINDEX, nLine, 0); }
  832. _AFXWIN_INLINE int CEdit::LineLength(int nLine) const
  833.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_LINELENGTH, nLine, 0); }
  834. _AFXWIN_INLINE void CEdit::LineScroll(int nLines, int nChars)
  835.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_LINESCROLL, nChars, nLines); }
  836. _AFXWIN_INLINE void CEdit::ReplaceSel(LPCTSTR lpszNewText)
  837.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_REPLACESEL, 0, (LPARAM)lpszNewText); }
  838. _AFXWIN_INLINE void CEdit::SetPasswordChar(TCHAR ch)
  839.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETPASSWORDCHAR, ch, 0); }
  840. _AFXWIN_INLINE void CEdit::SetRect(LPCRECT lpRect)
  841.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETRECT, 0, (LPARAM)lpRect); }
  842. _AFXWIN_INLINE void CEdit::SetRectNP(LPCRECT lpRect)
  843.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETRECTNP, 0, (LPARAM)lpRect); }
  844. _AFXWIN_INLINE void CEdit::SetSel(DWORD dwSelection, BOOL bNoScroll)
  845.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETSEL,
  846.         LOWORD(dwSelection), HIWORD(dwSelection));
  847.       if (!bNoScroll)
  848.         ::SendMessage(m_hWnd, EM_SCROLLCARET, 0, 0); }
  849. _AFXWIN_INLINE void CEdit::SetSel(int nStartChar, int nEndChar, BOOL bNoScroll)
  850.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETSEL, nStartChar, nEndChar);
  851.       if (!bNoScroll)
  852.         ::SendMessage(m_hWnd, EM_SCROLLCARET, 0, 0); }
  853. #ifndef _MAC
  854. _AFXWIN_INLINE BOOL CEdit::SetTabStops(int nTabStops, LPINT rgTabStops)
  855.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, nTabStops,
  856.         (LPARAM)rgTabStops); }
  857. _AFXWIN_INLINE void CEdit::SetTabStops()
  858.     { ASSERT(::IsWindow(m_hWnd)); VERIFY(::SendMessage(m_hWnd, EM_SETTABSTOPS, 0, 0)); }
  859. _AFXWIN_INLINE BOOL CEdit::SetTabStops(const int& cxEachStop)
  860.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS,
  861.         1, (LPARAM)(LPINT)&cxEachStop); }
  862. #endif
  863. _AFXWIN_INLINE BOOL CEdit::Undo()
  864.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_UNDO, 0, 0); }
  865. _AFXWIN_INLINE void CEdit::Clear()
  866.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_CLEAR, 0, 0); }
  867. _AFXWIN_INLINE void CEdit::Copy()
  868.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_COPY, 0, 0); }
  869. _AFXWIN_INLINE void CEdit::Cut()
  870.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_CUT, 0, 0); }
  871. _AFXWIN_INLINE void CEdit::Paste()
  872.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_PASTE, 0, 0); }
  873. _AFXWIN_INLINE BOOL CEdit::SetReadOnly(BOOL bReadOnly )
  874.     { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_SETREADONLY, bReadOnly, 0L); }
  875. _AFXWIN_INLINE int CEdit::GetFirstVisibleLine() const
  876.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_GETFIRSTVISIBLELINE, 0, 0L); }
  877. _AFXWIN_INLINE TCHAR CEdit::GetPasswordChar() const
  878.     { ASSERT(::IsWindow(m_hWnd)); return (TCHAR)::SendMessage(m_hWnd, EM_GETPASSWORDCHAR, 0, 0L); }
  879. #if (WINVER >= 0x400)
  880. _AFXWIN_INLINE void CEdit::SetMargins(UINT nLeft, UINT nRight)
  881.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETMARGINS, EC_LEFTMARGIN|EC_RIGHTMARGIN, MAKELONG(nLeft, nRight)); }
  882. _AFXWIN_INLINE DWORD CEdit::GetMargins() const
  883.     { ASSERT(::IsWindow(m_hWnd)); return (DWORD)::SendMessage(m_hWnd, EM_GETMARGINS, 0, 0); }
  884. _AFXWIN_INLINE void CEdit::SetLimitText(UINT nMax)
  885.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETLIMITTEXT, nMax, 0); }
  886. _AFXWIN_INLINE UINT CEdit::GetLimitText() const
  887.     { ASSERT(::IsWindow(m_hWnd)); return (UINT)::SendMessage(m_hWnd, EM_GETLIMITTEXT, 0, 0); }
  888. _AFXWIN_INLINE CPoint CEdit::PosFromChar(UINT nChar) const
  889.     { ASSERT(::IsWindow(m_hWnd)); return CPoint( (DWORD)::SendMessage(m_hWnd, EM_POSFROMCHAR, nChar, 0)); }
  890. _AFXWIN_INLINE int CEdit::CharFromPos(CPoint pt) const
  891.     { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_CHARFROMPOS, 0, MAKELPARAM(pt.x, pt.y)); }
  892. #endif
  893.  
  894. _AFXWIN_INLINE CScrollBar::CScrollBar()
  895.     { }
  896. _AFXWIN_INLINE int CScrollBar::GetScrollPos() const
  897.     { ASSERT(::IsWindow(m_hWnd)); return ::GetScrollPos(m_hWnd, SB_CTL); }
  898. _AFXWIN_INLINE int CScrollBar::SetScrollPos(int nPos, BOOL bRedraw)
  899.     { ASSERT(::IsWindow(m_hWnd)); return ::SetScrollPos(m_hWnd, SB_CTL, nPos, bRedraw); }
  900. _AFXWIN_INLINE void CScrollBar::GetScrollRange(LPINT lpMinPos, LPINT lpMaxPos) const
  901.     { ASSERT(::IsWindow(m_hWnd)); ::GetScrollRange(m_hWnd, SB_CTL, lpMinPos, lpMaxPos); }
  902. _AFXWIN_INLINE void CScrollBar::SetScrollRange(int nMinPos, int nMaxPos, BOOL bRedraw)
  903.     { ASSERT(::IsWindow(m_hWnd)); ::SetScrollRange(m_hWnd, SB_CTL, nMinPos, nMaxPos, bRedraw); }
  904. _AFXWIN_INLINE void CScrollBar::ShowScrollBar(BOOL bShow)
  905.     { ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, SB_CTL, bShow); }
  906. _AFXWIN_INLINE BOOL CScrollBar::EnableScrollBar(UINT nArrowFlags)
  907.     { ASSERT(::IsWindow(m_hWnd)); return ::EnableScrollBar(m_hWnd, SB_CTL, nArrowFlags); }
  908. _AFXWIN_INLINE BOOL CScrollBar::SetScrollInfo(LPSCROLLINFO lpScrollInfo, BOOL bRedraw)
  909.     { return CWnd::SetScrollInfo(SB_CTL, lpScrollInfo, bRedraw); }
  910. _AFXWIN_INLINE BOOL CScrollBar::GetScrollInfo(LPSCROLLINFO lpScrollInfo, UINT nMask)
  911.     { return CWnd::GetScrollInfo(SB_CTL, lpScrollInfo, nMask); }
  912. _AFXWIN_INLINE int CScrollBar::GetScrollLimit()
  913.     { return CWnd::GetScrollLimit(SB_CTL); }
  914.  
  915.  
  916. // MDI functions
  917. _AFXWIN_INLINE void CMDIFrameWnd::MDIActivate(CWnd* pWndActivate)
  918.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDIACTIVATE,
  919.         (WPARAM)pWndActivate->m_hWnd, 0); }
  920. _AFXWIN_INLINE void CMDIFrameWnd::MDIIconArrange()
  921.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDIICONARRANGE, 0, 0); }
  922. _AFXWIN_INLINE void CMDIFrameWnd::MDIMaximize(CWnd* pWnd)
  923.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDIMAXIMIZE, (WPARAM)pWnd->m_hWnd, 0); }
  924. _AFXWIN_INLINE void CMDIFrameWnd::MDINext()
  925.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDINEXT, 0, 0); }
  926. _AFXWIN_INLINE void CMDIFrameWnd::MDIRestore(CWnd* pWnd)
  927.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDIRESTORE, (WPARAM)pWnd->m_hWnd, 0); }
  928. _AFXWIN_INLINE CMenu* CMDIFrameWnd::MDISetMenu(CMenu* pFrameMenu, CMenu* pWindowMenu)
  929.     { ASSERT(::IsWindow(m_hWnd)); return CMenu::FromHandle((HMENU)::SendMessage(
  930.         m_hWndMDIClient, WM_MDISETMENU, (WPARAM)pFrameMenu->GetSafeHmenu(),
  931.         (LPARAM)pWindowMenu->GetSafeHmenu())); }
  932. _AFXWIN_INLINE void CMDIFrameWnd::MDITile()
  933.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDITILE, 0, 0); }
  934. _AFXWIN_INLINE void CMDIFrameWnd::MDICascade()
  935.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDICASCADE, 0, 0); }
  936.  
  937. _AFXWIN_INLINE void CMDIFrameWnd::MDICascade(int nType)
  938.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDICASCADE, nType, 0); }
  939. _AFXWIN_INLINE void CMDIFrameWnd::MDITile(int nType)
  940.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDITILE, nType, 0); }
  941. _AFXWIN_INLINE void CMDIChildWnd::MDIDestroy()
  942.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(GetParent()->m_hWnd, WM_MDIDESTROY, (WPARAM)m_hWnd, 0L); }
  943. _AFXWIN_INLINE void CMDIChildWnd::MDIActivate()
  944.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(GetParent()->m_hWnd, WM_MDIACTIVATE, (WPARAM)m_hWnd, 0L); }
  945. _AFXWIN_INLINE void CMDIChildWnd::MDIMaximize()
  946.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(GetParent()->m_hWnd, WM_MDIMAXIMIZE, (WPARAM)m_hWnd, 0L); }
  947. _AFXWIN_INLINE void CMDIChildWnd::MDIRestore()
  948.     { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(GetParent()->m_hWnd, WM_MDIRESTORE, (WPARAM)m_hWnd, 0L); }
  949.  
  950. // CView
  951. _AFXWIN_INLINE CDocument* CView::GetDocument() const
  952.     { ASSERT(this != NULL); return m_pDocument; }
  953. _AFXWIN_INLINE CSize CScrollView::GetTotalSize() const
  954.     { ASSERT(this != NULL); return m_totalLog; }
  955.  
  956. // CDocument
  957. _AFXWIN_INLINE const CString& CDocument::GetTitle() const
  958.     { ASSERT(this != NULL); return m_strTitle; }
  959. _AFXWIN_INLINE const CString& CDocument::GetPathName() const
  960.     { ASSERT(this != NULL); return m_strPathName; }
  961. _AFXWIN_INLINE CDocTemplate* CDocument::GetDocTemplate() const
  962.     { ASSERT(this != NULL); return m_pDocTemplate; }
  963. _AFXWIN_INLINE BOOL CDocument::IsModified()
  964.     { ASSERT(this != NULL); return m_bModified; }
  965. _AFXWIN_INLINE void CDocument::SetModifiedFlag(BOOL bModified)
  966.     { ASSERT(this != NULL); m_bModified = bModified; }
  967.  
  968. // CWinThread
  969. _AFXWIN_INLINE CWinThread::operator HANDLE() const
  970.     { return this == NULL ? NULL : m_hThread; }
  971. _AFXWIN_INLINE BOOL CWinThread::SetThreadPriority(int nPriority)
  972.     { ASSERT(m_hThread != NULL); return ::SetThreadPriority(m_hThread, nPriority); }
  973. _AFXWIN_INLINE int CWinThread::GetThreadPriority()
  974.     { ASSERT(m_hThread != NULL); return ::GetThreadPriority(m_hThread); }
  975. _AFXWIN_INLINE DWORD CWinThread::ResumeThread()
  976.     { ASSERT(m_hThread != NULL); return ::ResumeThread(m_hThread); }
  977. _AFXWIN_INLINE DWORD CWinThread::SuspendThread()
  978.     { ASSERT(m_hThread != NULL); return ::SuspendThread(m_hThread); }
  979.  
  980. // CWinApp
  981. #ifdef _MAC
  982. #if !defined(_USRDLL)
  983. _AFXWIN_INLINE BOOL CWinApp::Enable3dControls()
  984.     { return FALSE; }
  985. #ifndef _AFXDLL
  986. _AFXWIN_INLINE BOOL CWinApp::Enable3dControlsStatic()
  987.     { return FALSE; }
  988. #endif
  989. #endif
  990. #endif
  991. _AFXWIN_INLINE HCURSOR CWinApp::LoadCursor(LPCTSTR lpszResourceName) const
  992.     { return ::LoadCursor(AfxFindResourceHandle(lpszResourceName,
  993.         RT_GROUP_CURSOR), lpszResourceName); }
  994. _AFXWIN_INLINE HCURSOR CWinApp::LoadCursor(UINT nIDResource) const
  995.     { return ::LoadCursor(AfxFindResourceHandle(MAKEINTRESOURCE(nIDResource),
  996.         RT_GROUP_CURSOR), MAKEINTRESOURCE(nIDResource)); }
  997. _AFXWIN_INLINE HCURSOR CWinApp::LoadStandardCursor(LPCTSTR lpszCursorName) const
  998.     { return ::LoadCursor(NULL, lpszCursorName); }
  999. _AFXWIN_INLINE HCURSOR CWinApp::LoadOEMCursor(UINT nIDCursor) const
  1000.     { return ::LoadCursor(NULL, MAKEINTRESOURCE(nIDCursor)); }
  1001. _AFXWIN_INLINE HICON CWinApp::LoadIcon(LPCTSTR lpszResourceName) const
  1002.     { return ::LoadIcon(AfxFindResourceHandle(lpszResourceName,
  1003.         RT_GROUP_ICON), lpszResourceName); }
  1004. _AFXWIN_INLINE HICON CWinApp::LoadIcon(UINT nIDResource) const
  1005.     { return ::LoadIcon(AfxFindResourceHandle(MAKEINTRESOURCE(nIDResource),
  1006.         RT_GROUP_ICON), MAKEINTRESOURCE(nIDResource)); }
  1007. _AFXWIN_INLINE HICON CWinApp::LoadStandardIcon(LPCTSTR lpszIconName) const
  1008.     { return ::LoadIcon(NULL, lpszIconName); }
  1009. _AFXWIN_INLINE HICON CWinApp::LoadOEMIcon(UINT nIDIcon) const
  1010.     { return ::LoadIcon(NULL, MAKEINTRESOURCE(nIDIcon)); }
  1011. #ifdef _MAC
  1012. _AFXWIN_INLINE void CWinApp::EnableShellOpen()
  1013.     { }
  1014. _AFXWIN_INLINE void CWinApp::RegisterShellFileTypes(BOOL)
  1015.     { }
  1016. _AFXWIN_INLINE void CWinApp::RegisterShellFileTypesCompat()
  1017.     { }
  1018. _AFXWIN_INLINE void CDocManager::RegisterShellFileTypes(BOOL)
  1019.     { }
  1020. #endif
  1021.  
  1022. _AFXWIN_INLINE CWaitCursor::CWaitCursor()
  1023.     { AfxGetApp()->BeginWaitCursor(); }
  1024. _AFXWIN_INLINE CWaitCursor::~CWaitCursor()
  1025.     { AfxGetApp()->EndWaitCursor(); }
  1026. _AFXWIN_INLINE void CWaitCursor::Restore()
  1027.     { AfxGetApp()->RestoreWaitCursor(); }
  1028.  
  1029. /////////////////////////////////////////////////////////////////////////////
  1030. // Obsolete and non-portable
  1031.  
  1032. #ifndef _MAC
  1033. _AFXWIN_INLINE void CWnd::CloseWindow()
  1034.     { ASSERT(::IsWindow(m_hWnd)); ::CloseWindow(m_hWnd); }
  1035. _AFXWIN_INLINE BOOL CWnd::OpenIcon()
  1036.     { ASSERT(::IsWindow(m_hWnd)); return ::OpenIcon(m_hWnd); }
  1037. #endif
  1038.  
  1039. /////////////////////////////////////////////////////////////////////////////
  1040.  
  1041. #endif //_AFXWIN_INLINE
  1042.