afxwin2.inl 57 KB

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