Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1055 lines
63 KiB

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