Source code of Windows XP (NT5)
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.

758 lines
53 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 AFXCMN.H
  11. #ifdef _AFXCMN_INLINE
  12. _AFXCMN_INLINE CDragListBox::CDragListBox()
  13. { m_nLast = -1;}
  14. _AFXCMN_INLINE int CDragListBox::ItemFromPt(CPoint pt, BOOL bAutoScroll) const
  15. {ASSERT(::IsWindow(m_hWnd)); return ::LBItemFromPt(m_hWnd, pt, bAutoScroll); }
  16. /////////////////////////////////////////////////////////////////////////////
  17. _AFXCMN_INLINE CToolBarCtrl::CToolBarCtrl()
  18. { }
  19. _AFXCMN_INLINE BOOL CToolBarCtrl::EnableButton(int nID, BOOL bEnable)
  20. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ENABLEBUTTON, nID, MAKELPARAM(bEnable, 0)); }
  21. _AFXCMN_INLINE BOOL CToolBarCtrl::CheckButton(int nID, BOOL bCheck)
  22. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_CHECKBUTTON, nID, MAKELPARAM(bCheck, 0)); }
  23. _AFXCMN_INLINE BOOL CToolBarCtrl::PressButton(int nID, BOOL bPress)
  24. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_PRESSBUTTON, nID, MAKELPARAM(bPress, 0)); }
  25. _AFXCMN_INLINE BOOL CToolBarCtrl::HideButton(int nID, BOOL bHide)
  26. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_HIDEBUTTON, nID, MAKELPARAM(bHide, 0)); }
  27. _AFXCMN_INLINE BOOL CToolBarCtrl::Indeterminate(int nID, BOOL bIndeterminate)
  28. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_INDETERMINATE, nID, MAKELPARAM(bIndeterminate, 0)); }
  29. _AFXCMN_INLINE BOOL CToolBarCtrl::IsButtonEnabled(int nID) const
  30. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONENABLED, nID, 0); }
  31. _AFXCMN_INLINE BOOL CToolBarCtrl::IsButtonChecked(int nID) const
  32. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONCHECKED, nID, 0); }
  33. _AFXCMN_INLINE BOOL CToolBarCtrl::IsButtonPressed(int nID) const
  34. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONPRESSED, nID, 0); }
  35. _AFXCMN_INLINE BOOL CToolBarCtrl::IsButtonHidden(int nID) const
  36. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONHIDDEN, nID, 0); }
  37. _AFXCMN_INLINE BOOL CToolBarCtrl::IsButtonIndeterminate(int nID) const
  38. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONINDETERMINATE, nID, 0); }
  39. _AFXCMN_INLINE BOOL CToolBarCtrl::SetState(int nID, UINT nState)
  40. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETSTATE, nID, MAKELPARAM(nState, 0)); }
  41. _AFXCMN_INLINE int CToolBarCtrl::GetState(int nID) const
  42. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_GETSTATE, nID, 0L); }
  43. _AFXCMN_INLINE BOOL CToolBarCtrl::AddButtons(int nNumButtons, LPTBBUTTON lpButtons)
  44. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ADDBUTTONS, nNumButtons, (LPARAM)lpButtons); }
  45. _AFXCMN_INLINE BOOL CToolBarCtrl::InsertButton(int nIndex, LPTBBUTTON lpButton)
  46. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_INSERTBUTTON, nIndex, (LPARAM)lpButton); }
  47. _AFXCMN_INLINE BOOL CToolBarCtrl::DeleteButton(int nIndex)
  48. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_DELETEBUTTON, nIndex, 0); }
  49. _AFXCMN_INLINE BOOL CToolBarCtrl::GetButton(int nIndex, LPTBBUTTON lpButton) const
  50. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETBUTTON, nIndex, (LPARAM)lpButton); }
  51. _AFXCMN_INLINE int CToolBarCtrl::GetButtonCount() const
  52. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_BUTTONCOUNT, 0, 0L); }
  53. _AFXCMN_INLINE UINT CToolBarCtrl::CommandToIndex(UINT nID) const
  54. { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, TB_COMMANDTOINDEX, nID, 0L); }
  55. _AFXCMN_INLINE void CToolBarCtrl::Customize()
  56. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_CUSTOMIZE, 0, 0L); }
  57. // lpszStrings are separated by zeroes, last one is marked by two zeroes
  58. _AFXCMN_INLINE int CToolBarCtrl::AddStrings(LPCTSTR lpszStrings)
  59. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_ADDSTRING, 0, (LPARAM)lpszStrings); }
  60. _AFXCMN_INLINE BOOL CToolBarCtrl::GetItemRect(int nIndex, LPRECT lpRect) const
  61. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETITEMRECT, nIndex, (LPARAM)lpRect); }
  62. _AFXCMN_INLINE void CToolBarCtrl::SetButtonStructSize(int nSize)
  63. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_BUTTONSTRUCTSIZE, nSize, 0L); }
  64. _AFXCMN_INLINE BOOL CToolBarCtrl::SetButtonSize(CSize size)
  65. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETBUTTONSIZE, 0, MAKELPARAM(size.cx, size.cy)); }
  66. _AFXCMN_INLINE BOOL CToolBarCtrl::SetBitmapSize(CSize size)
  67. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETBITMAPSIZE, 0, MAKELPARAM(size.cx, size.cy)); }
  68. _AFXCMN_INLINE void CToolBarCtrl::AutoSize()
  69. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_AUTOSIZE, 0, 0L); }
  70. _AFXCMN_INLINE CToolTipCtrl* CToolBarCtrl::GetToolTips() const
  71. { ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, TB_GETTOOLTIPS, 0, 0L)); }
  72. #if _MFC_VER >= 0x0600
  73. _AFXCMN_INLINE void CToolBarCtrl::SetToolTips(CToolTipCtrl* pTip)
  74. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETTOOLTIPS, (WPARAM)pTip->GetSafeHwnd(), 0L); }
  75. _AFXCMN_INLINE void CToolBarCtrl::SetOwner(CWnd* pWnd)
  76. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETPARENT, (WPARAM)pWnd->GetSafeHwnd(), 0L); }
  77. #else
  78. _AFXCMN_INLINE void CToolBarCtrl::SetToolTips(CToolTipCtrl* pTip)
  79. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETTOOLTIPS, (WPARAM)pTip->m_hWnd, 0L); }
  80. _AFXCMN_INLINE void CToolBarCtrl::SetOwner(CWnd* pWnd)
  81. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETPARENT, (WPARAM)pWnd->m_hWnd, 0L); }
  82. #endif
  83. _AFXCMN_INLINE void CToolBarCtrl::SetRows(int nRows, BOOL bLarger, LPRECT lpRect)
  84. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETROWS, MAKEWPARAM(nRows, bLarger), (LPARAM)lpRect); }
  85. _AFXCMN_INLINE int CToolBarCtrl::GetRows() const
  86. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_GETROWS, 0, 0L); }
  87. _AFXCMN_INLINE BOOL CToolBarCtrl::SetCmdID(int nIndex, UINT nID)
  88. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETCMDID, nIndex, nID); }
  89. _AFXCMN_INLINE UINT CToolBarCtrl::GetBitmapFlags() const
  90. { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, TB_GETBITMAPFLAGS, 0, 0L); }
  91. #if _MFC_VER >= 0x0600
  92. _AFXCMN_INLINE int CToolBarCtrl::HitTest(LPPOINT ppt) const
  93. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_HITTEST, 0, (LPARAM)ppt); }
  94. _AFXCMN_INLINE DWORD CToolBarCtrl::GetExtendedStyle() const
  95. { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_GETEXTENDEDSTYLE, 0, 0L); }
  96. _AFXCMN_INLINE DWORD CToolBarCtrl::SetExtendedStyle(DWORD dwExStyle)
  97. { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TB_SETEXTENDEDSTYLE, 0, dwExStyle); }
  98. _AFXCMN_INLINE COLORREF CToolBarCtrl::GetInsertMarkColor() const
  99. { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TB_GETINSERTMARKCOLOR, 0, 0); }
  100. _AFXCMN_INLINE COLORREF CToolBarCtrl::SetInsertMarkColor(COLORREF clrNew)
  101. { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TB_SETINSERTMARKCOLOR, 0, (LPARAM) clrNew); }
  102. #endif
  103. /////////////////////////////////////////////////////////////////////////////
  104. _AFXCMN_INLINE CStatusBarCtrl::CStatusBarCtrl()
  105. { }
  106. _AFXCMN_INLINE BOOL CStatusBarCtrl::SetText(LPCTSTR lpszText, int nPane, int nType)
  107. { ASSERT(::IsWindow(m_hWnd)); ASSERT(nPane < 256); return (BOOL) ::SendMessage(m_hWnd, SB_SETTEXT, (nPane|nType), (LPARAM)lpszText); }
  108. _AFXCMN_INLINE BOOL CStatusBarCtrl::SetParts(int nParts, int* pWidths)
  109. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, SB_SETPARTS, nParts, (LPARAM)pWidths); }
  110. _AFXCMN_INLINE int CStatusBarCtrl::GetParts(int nParts, int* pParts) const
  111. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, SB_GETPARTS, nParts, (LPARAM)pParts); }
  112. _AFXCMN_INLINE BOOL CStatusBarCtrl::GetBorders(int* pBorders) const
  113. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, SB_GETBORDERS, 0, (LPARAM)pBorders); }
  114. _AFXCMN_INLINE void CStatusBarCtrl::SetMinHeight(int nMin)
  115. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, SB_SETMINHEIGHT, nMin, 0L); }
  116. _AFXCMN_INLINE BOOL CStatusBarCtrl::SetSimple(BOOL bSimple)
  117. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, SB_SIMPLE, bSimple, 0L); }
  118. _AFXCMN_INLINE BOOL CStatusBarCtrl::GetRect(int nPane, LPRECT lpRect) const
  119. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, SB_GETRECT, nPane, (LPARAM)lpRect); }
  120. /////////////////////////////////////////////////////////////////////////////
  121. _AFXCMN_INLINE CListCtrl::CListCtrl()
  122. { }
  123. _AFXCMN_INLINE COLORREF CListCtrl::GetBkColor() const
  124. { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, LVM_GETBKCOLOR, 0, 0L); }
  125. _AFXCMN_INLINE BOOL CListCtrl::SetBkColor(COLORREF cr)
  126. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETBKCOLOR, 0, cr); }
  127. _AFXCMN_INLINE CImageList* CListCtrl::GetImageList(int nImageListType) const
  128. { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, LVM_GETIMAGELIST, nImageListType, 0L)); }
  129. _AFXCMN_INLINE CImageList* CListCtrl::SetImageList(CImageList* pImageList, int nImageList)
  130. { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, LVM_SETIMAGELIST, nImageList, (LPARAM)pImageList->GetSafeHandle())); }
  131. _AFXCMN_INLINE int CListCtrl::GetItemCount() const
  132. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETITEMCOUNT, 0, 0L); }
  133. _AFXCMN_INLINE BOOL CListCtrl::GetItem(LVITEM* pItem) const
  134. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_GETITEM, 0, (LPARAM)pItem); }
  135. _AFXCMN_INLINE BOOL CListCtrl::SetItem(const LVITEM* pItem)
  136. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETITEM, 0, (LPARAM)pItem); }
  137. #if _MFC_VER < 0x0600
  138. _AFXCMN_INLINE BOOL CListCtrl::SetItemState(int nItem, UINT nState, UINT nStateMask)
  139. { ASSERT(::IsWindow(m_hWnd)); return SetItem(nItem, 0, LVIF_STATE, NULL, 0, nState, nStateMask, 0); }
  140. _AFXCMN_INLINE BOOL CListCtrl::SetItemText(int nItem, int nSubItem, LPCTSTR lpszText)
  141. { ASSERT(::IsWindow(m_hWnd)); return SetItem(nItem, nSubItem, LVIF_TEXT, lpszText, 0, 0, 0, 0); }
  142. #endif
  143. _AFXCMN_INLINE BOOL CListCtrl::SetItemData(int nItem, DWORD_PTR dwData)
  144. { ASSERT(::IsWindow(m_hWnd)); return SetItem(nItem, 0, LVIF_PARAM, NULL, 0, 0, 0, (LPARAM)dwData); }
  145. _AFXCMN_INLINE int CListCtrl::InsertItem(const LVITEM* pItem)
  146. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_INSERTITEM, 0, (LPARAM)pItem); }
  147. _AFXCMN_INLINE int CListCtrl::InsertItem(int nItem, LPCTSTR lpszItem)
  148. { ASSERT(::IsWindow(m_hWnd)); return InsertItem(LVIF_TEXT, nItem, lpszItem, 0, 0, 0, 0); }
  149. _AFXCMN_INLINE int CListCtrl::InsertItem(int nItem, LPCTSTR lpszItem, int nImage)
  150. { ASSERT(::IsWindow(m_hWnd)); return InsertItem(LVIF_TEXT|LVIF_IMAGE, nItem, lpszItem, 0, 0, nImage, 0); }
  151. _AFXCMN_INLINE BOOL CListCtrl::DeleteItem(int nItem)
  152. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_DELETEITEM, nItem, 0L); }
  153. _AFXCMN_INLINE BOOL CListCtrl::DeleteAllItems()
  154. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_DELETEALLITEMS, 0, 0L); }
  155. _AFXCMN_INLINE UINT CListCtrl::GetCallbackMask() const
  156. { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, LVM_GETCALLBACKMASK, 0, 0); }
  157. _AFXCMN_INLINE BOOL CListCtrl::SetCallbackMask(UINT nMask)
  158. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETCALLBACKMASK, nMask, 0); }
  159. _AFXCMN_INLINE int CListCtrl::GetNextItem(int nItem, int nFlags) const
  160. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETNEXTITEM, nItem, MAKELPARAM(nFlags, 0)); }
  161. #if _MFC_VER >= 0x0600
  162. _AFXCMN_INLINE POSITION CListCtrl::GetFirstSelectedItemPosition() const
  163. { ASSERT(::IsWindow(m_hWnd)); return (POSITION)(DWORD_PTR)(1+GetNextItem(-1, LVIS_SELECTED)); }
  164. _AFXCMN_INLINE int CListCtrl::GetNextSelectedItem(POSITION& pos) const
  165. { ASSERT(::IsWindow(m_hWnd)); DWORD_PTR nOldPos = (DWORD_PTR)pos-1; pos = (POSITION)(DWORD_PTR)(1+GetNextItem((UINT)nOldPos, LVIS_SELECTED)); return (UINT)nOldPos; }
  166. #endif
  167. _AFXCMN_INLINE int CListCtrl::FindItem(LVFINDINFO* pFindInfo, int nStart) const
  168. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_FINDITEM, nStart, (LPARAM)pFindInfo); }
  169. _AFXCMN_INLINE int CListCtrl::HitTest(LVHITTESTINFO* pHitTestInfo) const
  170. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_HITTEST, 0, (LPARAM)pHitTestInfo); }
  171. _AFXCMN_INLINE BOOL CListCtrl::SetItemPosition(int nItem, POINT pt)
  172. #if _MFC_VER >= 0x0600
  173. { ASSERT(::IsWindow(m_hWnd)); ASSERT((GetStyle() & LVS_OWNERDATA)==0); return (BOOL) ::SendMessage(m_hWnd, LVM_SETITEMPOSITION32, nItem, (LPARAM)&pt); }
  174. #else
  175. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETITEMPOSITION32, nItem, (LPARAM)&pt); }
  176. #endif
  177. _AFXCMN_INLINE BOOL CListCtrl::GetItemPosition(int nItem, LPPOINT lpPoint) const
  178. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_GETITEMPOSITION, nItem, (LPARAM)lpPoint); }
  179. _AFXCMN_INLINE int CListCtrl::GetStringWidth(LPCTSTR lpsz) const
  180. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETSTRINGWIDTH, 0, (LPARAM)lpsz); }
  181. _AFXCMN_INLINE BOOL CListCtrl::EnsureVisible(int nItem, BOOL bPartialOK)
  182. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_ENSUREVISIBLE, nItem, MAKELPARAM(bPartialOK, 0)); }
  183. _AFXCMN_INLINE BOOL CListCtrl::Scroll(CSize size)
  184. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SCROLL, size.cx, size.cy); }
  185. _AFXCMN_INLINE BOOL CListCtrl::RedrawItems(int nFirst, int nLast)
  186. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_REDRAWITEMS, nFirst, nLast); }
  187. _AFXCMN_INLINE BOOL CListCtrl::Arrange(UINT nCode)
  188. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_ARRANGE, nCode, 0L); }
  189. _AFXCMN_INLINE CEdit* CListCtrl::EditLabel(int nItem)
  190. { ASSERT(::IsWindow(m_hWnd)); return (CEdit*)CWnd::FromHandle( (HWND)::SendMessage(m_hWnd, LVM_EDITLABEL, nItem, 0L)); }
  191. _AFXCMN_INLINE CEdit* CListCtrl::GetEditControl() const
  192. { ASSERT(::IsWindow(m_hWnd)); return (CEdit*)CWnd::FromHandle( (HWND)::SendMessage(m_hWnd, LVM_GETEDITCONTROL, 0, 0L)); }
  193. _AFXCMN_INLINE BOOL CListCtrl::GetColumn(int nCol, LVCOLUMN* pColumn) const
  194. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_GETCOLUMN, nCol, (LPARAM)pColumn); }
  195. _AFXCMN_INLINE BOOL CListCtrl::SetColumn(int nCol, const LVCOLUMN* pColumn)
  196. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETCOLUMN, nCol, (LPARAM)pColumn); }
  197. _AFXCMN_INLINE int CListCtrl::InsertColumn(int nCol, const LVCOLUMN* pColumn)
  198. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_INSERTCOLUMN, nCol, (LPARAM)pColumn); }
  199. _AFXCMN_INLINE BOOL CListCtrl::DeleteColumn(int nCol)
  200. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_DELETECOLUMN, nCol, 0); }
  201. _AFXCMN_INLINE int CListCtrl::GetColumnWidth(int nCol) const
  202. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETCOLUMNWIDTH, nCol, 0); }
  203. _AFXCMN_INLINE BOOL CListCtrl::SetColumnWidth(int nCol, int cx)
  204. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETCOLUMNWIDTH, nCol, MAKELPARAM(cx, 0)); }
  205. _AFXCMN_INLINE BOOL CListCtrl::GetViewRect(LPRECT lpRect) const
  206. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_GETVIEWRECT, 0, (LPARAM)lpRect); }
  207. _AFXCMN_INLINE COLORREF CListCtrl::GetTextColor() const
  208. { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, LVM_GETTEXTCOLOR, 0, 0L); }
  209. _AFXCMN_INLINE BOOL CListCtrl::SetTextColor(COLORREF cr)
  210. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETTEXTCOLOR, 0, cr); }
  211. _AFXCMN_INLINE COLORREF CListCtrl::GetTextBkColor() const
  212. { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, LVM_GETTEXTBKCOLOR, 0, 0L); }
  213. _AFXCMN_INLINE BOOL CListCtrl::SetTextBkColor(COLORREF cr)
  214. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETTEXTBKCOLOR, 0, cr); }
  215. _AFXCMN_INLINE int CListCtrl::GetTopIndex() const
  216. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETTOPINDEX, 0, 0); }
  217. _AFXCMN_INLINE int CListCtrl::GetCountPerPage() const
  218. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETCOUNTPERPAGE, 0, 0); }
  219. _AFXCMN_INLINE BOOL CListCtrl::GetOrigin(LPPOINT lpPoint) const
  220. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_GETORIGIN, 0, (LPARAM)lpPoint); }
  221. _AFXCMN_INLINE BOOL CListCtrl::Update(int nItem)
  222. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_UPDATE, nItem, 0L); }
  223. _AFXCMN_INLINE BOOL CListCtrl::SetItemState(int nItem, LVITEM* pItem)
  224. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETITEMSTATE, nItem, (LPARAM)pItem); }
  225. _AFXCMN_INLINE UINT CListCtrl::GetItemState(int nItem, UINT nMask) const
  226. { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, LVM_GETITEMSTATE, nItem, nMask); }
  227. _AFXCMN_INLINE void CListCtrl::SetItemCount(int nItems)
  228. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, LVM_SETITEMCOUNT, nItems, 0); }
  229. _AFXCMN_INLINE BOOL CListCtrl::SortItems(PFNLVCOMPARE pfnCompare, DWORD_PTR dwData)
  230. #if _MFC_VER >= 0x0600
  231. { ASSERT(::IsWindow(m_hWnd)); ASSERT((GetStyle() & LVS_OWNERDATA)==0); return (BOOL) ::SendMessage(m_hWnd, LVM_SORTITEMS, dwData, (LPARAM)pfnCompare); }
  232. #else
  233. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SORTITEMS, dwData, (LPARAM)pfnCompare); }
  234. #endif
  235. _AFXCMN_INLINE UINT CListCtrl::GetSelectedCount() const
  236. { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, LVM_GETSELECTEDCOUNT, 0, 0L); }
  237. /////////////////////////////////////////////////////////////////////////////
  238. _AFXCMN_INLINE CTreeCtrl::CTreeCtrl()
  239. { }
  240. _AFXCMN_INLINE HTREEITEM CTreeCtrl::InsertItem(LPTVINSERTSTRUCT lpInsertStruct)
  241. { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_INSERTITEM, 0, (LPARAM)lpInsertStruct); }
  242. _AFXCMN_INLINE HTREEITEM CTreeCtrl::InsertItem(LPCTSTR lpszItem, int nImage,
  243. int nSelectedImage, HTREEITEM hParent, HTREEITEM hInsertAfter)
  244. { ASSERT(::IsWindow(m_hWnd)); return InsertItem(TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE, lpszItem, nImage, nSelectedImage, 0, 0, 0, hParent, hInsertAfter); }
  245. _AFXCMN_INLINE HTREEITEM CTreeCtrl::InsertItem(LPCTSTR lpszItem, HTREEITEM hParent, HTREEITEM hInsertAfter)
  246. { ASSERT(::IsWindow(m_hWnd)); return InsertItem(TVIF_TEXT, lpszItem, 0, 0, 0, 0, 0, hParent, hInsertAfter); }
  247. _AFXCMN_INLINE BOOL CTreeCtrl::DeleteItem(HTREEITEM hItem)
  248. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_DELETEITEM, 0, (LPARAM)hItem); }
  249. #pragma warning(disable: 4310)
  250. _AFXCMN_INLINE BOOL CTreeCtrl::DeleteAllItems()
  251. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT); }
  252. #pragma warning(default: 4310)
  253. _AFXCMN_INLINE BOOL CTreeCtrl::Expand(HTREEITEM hItem, UINT nCode)
  254. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_EXPAND, nCode, (LPARAM)hItem); }
  255. _AFXCMN_INLINE UINT CTreeCtrl::GetCount() const
  256. { ASSERT(::IsWindow(m_hWnd)); return (UINT)::SendMessage(m_hWnd, TVM_GETCOUNT, 0, 0); }
  257. _AFXCMN_INLINE UINT CTreeCtrl::GetIndent() const
  258. { ASSERT(::IsWindow(m_hWnd)); return (UINT)::SendMessage(m_hWnd, TVM_GETINDENT, 0, 0); }
  259. _AFXCMN_INLINE void CTreeCtrl::SetIndent(UINT nIndent)
  260. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TVM_SETINDENT, nIndent, 0); }
  261. _AFXCMN_INLINE CImageList* CTreeCtrl::GetImageList(UINT nImageList) const
  262. { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST)::SendMessage(m_hWnd, TVM_GETIMAGELIST, (UINT)nImageList, 0)); }
  263. _AFXCMN_INLINE CImageList* CTreeCtrl::SetImageList(CImageList* pImageList, int nImageListType)
  264. { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST)::SendMessage(m_hWnd, TVM_SETIMAGELIST, (UINT)nImageListType, (LPARAM)pImageList->GetSafeHandle())); }
  265. _AFXCMN_INLINE HTREEITEM CTreeCtrl::GetNextItem(HTREEITEM hItem, UINT nCode) const
  266. { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, nCode, (LPARAM)hItem); }
  267. _AFXCMN_INLINE HTREEITEM CTreeCtrl::GetChildItem(HTREEITEM hItem) const
  268. { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)hItem); }
  269. _AFXCMN_INLINE HTREEITEM CTreeCtrl::GetNextSiblingItem(HTREEITEM hItem) const
  270. { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hItem); }
  271. _AFXCMN_INLINE HTREEITEM CTreeCtrl::GetPrevSiblingItem(HTREEITEM hItem) const
  272. { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUS, (LPARAM)hItem); }
  273. _AFXCMN_INLINE HTREEITEM CTreeCtrl::GetParentItem(HTREEITEM hItem) const
  274. { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hItem); }
  275. _AFXCMN_INLINE HTREEITEM CTreeCtrl::GetFirstVisibleItem() const
  276. { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_FIRSTVISIBLE, 0); }
  277. _AFXCMN_INLINE HTREEITEM CTreeCtrl::GetNextVisibleItem(HTREEITEM hItem) const
  278. { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTVISIBLE, (LPARAM)hItem); }
  279. _AFXCMN_INLINE HTREEITEM CTreeCtrl::GetPrevVisibleItem(HTREEITEM hItem) const
  280. { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUSVISIBLE, (LPARAM)hItem); }
  281. _AFXCMN_INLINE HTREEITEM CTreeCtrl::GetSelectedItem() const
  282. { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_CARET, 0); }
  283. _AFXCMN_INLINE HTREEITEM CTreeCtrl::GetDropHilightItem() const
  284. { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_DROPHILITE, 0); }
  285. _AFXCMN_INLINE HTREEITEM CTreeCtrl::GetRootItem() const
  286. { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_ROOT, 0); }
  287. _AFXCMN_INLINE BOOL CTreeCtrl::Select(HTREEITEM hItem, UINT nCode)
  288. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_SELECTITEM, nCode, (LPARAM)hItem); }
  289. _AFXCMN_INLINE BOOL CTreeCtrl::SelectItem(HTREEITEM hItem)
  290. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hItem); }
  291. _AFXCMN_INLINE BOOL CTreeCtrl::SelectDropTarget(HTREEITEM hItem)
  292. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TVM_SELECTITEM, TVGN_DROPHILITE, (LPARAM)hItem); }
  293. _AFXCMN_INLINE BOOL CTreeCtrl::SelectSetFirstVisible(HTREEITEM hItem)
  294. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TVM_SELECTITEM, TVGN_FIRSTVISIBLE, (LPARAM)hItem); }
  295. _AFXCMN_INLINE BOOL CTreeCtrl::GetItem(TVITEM* pItem) const
  296. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)pItem); }
  297. _AFXCMN_INLINE BOOL CTreeCtrl::SetItem(TVITEM* pItem)
  298. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_SETITEM, 0, (LPARAM)pItem); }
  299. _AFXCMN_INLINE BOOL CTreeCtrl::SetItemText(HTREEITEM hItem, LPCTSTR lpszItem)
  300. { ASSERT(::IsWindow(m_hWnd)); return SetItem(hItem, TVIF_TEXT, lpszItem, 0, 0, 0, 0, NULL); }
  301. _AFXCMN_INLINE BOOL CTreeCtrl::SetItemImage(HTREEITEM hItem, int nImage, int nSelectedImage)
  302. { ASSERT(::IsWindow(m_hWnd)); return SetItem(hItem, TVIF_IMAGE|TVIF_SELECTEDIMAGE, NULL, nImage, nSelectedImage, 0, 0, NULL); }
  303. _AFXCMN_INLINE BOOL CTreeCtrl::SetItemState(HTREEITEM hItem, UINT nState, UINT nStateMask)
  304. { ASSERT(::IsWindow(m_hWnd)); return SetItem(hItem, TVIF_STATE, NULL, 0, 0, nState, nStateMask, NULL); }
  305. _AFXCMN_INLINE BOOL CTreeCtrl::SetItemData(HTREEITEM hItem, DWORD_PTR dwData)
  306. { ASSERT(::IsWindow(m_hWnd)); return SetItem(hItem, TVIF_PARAM, NULL, 0, 0, 0, 0, (LPARAM)dwData); }
  307. _AFXCMN_INLINE CEdit* CTreeCtrl::EditLabel(HTREEITEM hItem)
  308. { ASSERT(::IsWindow(m_hWnd)); return (CEdit*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, TVM_EDITLABEL, 0, (LPARAM)hItem)); }
  309. _AFXCMN_INLINE HTREEITEM CTreeCtrl::HitTest(TVHITTESTINFO* pHitTestInfo) const
  310. { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_HITTEST, 0, (LPARAM)pHitTestInfo); }
  311. _AFXCMN_INLINE CEdit* CTreeCtrl::GetEditControl() const
  312. { ASSERT(::IsWindow(m_hWnd)); return (CEdit*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, TVM_GETEDITCONTROL, 0, 0)); }
  313. _AFXCMN_INLINE UINT CTreeCtrl::GetVisibleCount() const
  314. { ASSERT(::IsWindow(m_hWnd)); return (UINT)::SendMessage(m_hWnd, TVM_GETVISIBLECOUNT, 0, 0); }
  315. _AFXCMN_INLINE BOOL CTreeCtrl::SortChildren(HTREEITEM hItem)
  316. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_SORTCHILDREN, 0, (LPARAM)hItem); }
  317. _AFXCMN_INLINE BOOL CTreeCtrl::EnsureVisible(HTREEITEM hItem)
  318. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_ENSUREVISIBLE, 0, (LPARAM)hItem); }
  319. _AFXCMN_INLINE BOOL CTreeCtrl::SortChildrenCB(LPTVSORTCB pSort)
  320. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_SORTCHILDRENCB, 0, (LPARAM)pSort); }
  321. #if _MFC_VER >= 0x0600
  322. _AFXCMN_INLINE CToolTipCtrl* CTreeCtrl::GetToolTips() const
  323. { ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, TVM_GETTOOLTIPS, 0, 0L)); }
  324. _AFXCMN_INLINE CToolTipCtrl* CTreeCtrl::SetToolTips(CToolTipCtrl* pWndTip)
  325. { ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, TVM_SETTOOLTIPS, (WPARAM)pWndTip->GetSafeHwnd(), 0L)); }
  326. _AFXCMN_INLINE COLORREF CTreeCtrl::GetBkColor() const
  327. { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TVM_GETBKCOLOR, 0, 0L); }
  328. _AFXCMN_INLINE COLORREF CTreeCtrl::SetBkColor(COLORREF clr)
  329. { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TVM_SETBKCOLOR, 0, (LPARAM)clr); }
  330. _AFXCMN_INLINE SHORT CTreeCtrl::GetItemHeight() const
  331. { ASSERT(::IsWindow(m_hWnd)); return (SHORT) ::SendMessage(m_hWnd, TVM_GETITEMHEIGHT, 0, 0L); }
  332. _AFXCMN_INLINE SHORT CTreeCtrl::SetItemHeight(SHORT cyHeight)
  333. { ASSERT(::IsWindow(m_hWnd)); return (SHORT) ::SendMessage(m_hWnd, TVM_SETITEMHEIGHT, cyHeight, 0L); }
  334. _AFXCMN_INLINE COLORREF CTreeCtrl::GetTextColor() const
  335. { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TVM_GETTEXTCOLOR, 0, 0L); }
  336. _AFXCMN_INLINE COLORREF CTreeCtrl::SetTextColor(COLORREF clr)
  337. { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TVM_SETTEXTCOLOR, 0, (LPARAM)clr); }
  338. _AFXCMN_INLINE BOOL CTreeCtrl::SetInsertMark(HTREEITEM hItem, BOOL fAfter)
  339. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TVM_SETINSERTMARK, fAfter, (LPARAM)hItem); }
  340. _AFXCMN_INLINE COLORREF CTreeCtrl::GetInsertMarkColor() const
  341. { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TVM_GETINSERTMARKCOLOR, 0, 0L); }
  342. _AFXCMN_INLINE COLORREF CTreeCtrl::SetInsertMarkColor(COLORREF clrNew)
  343. { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, TVM_SETINSERTMARKCOLOR, 0, (LPARAM)clrNew); }
  344. #endif
  345. /////////////////////////////////////////////////////////////////////////////
  346. _AFXCMN_INLINE CHotKeyCtrl::CHotKeyCtrl()
  347. { }
  348. _AFXCMN_INLINE void CHotKeyCtrl::SetHotKey(WORD wVirtualKeyCode, WORD wModifiers)
  349. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, HKM_SETHOTKEY, MAKEWORD(wVirtualKeyCode, wModifiers), 0L); }
  350. _AFXCMN_INLINE DWORD CHotKeyCtrl::GetHotKey() const
  351. { ASSERT(::IsWindow(m_hWnd)); return DWORD(::SendMessage(m_hWnd, HKM_GETHOTKEY, 0, 0L)); }
  352. _AFXCMN_INLINE void CHotKeyCtrl::SetRules(WORD wInvalidComb, WORD wModifiers)
  353. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, HKM_SETRULES, wInvalidComb, MAKELPARAM(wModifiers, 0)); }
  354. /////////////////////////////////////////////////////////////////////////////
  355. _AFXCMN_INLINE void CToolTipCtrl::Activate(BOOL bActivate)
  356. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TTM_ACTIVATE, bActivate, 0L); }
  357. _AFXCMN_INLINE void CToolTipCtrl::SetToolInfo(LPTOOLINFO lpToolInfo)
  358. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TTM_SETTOOLINFO, 0, (LPARAM)lpToolInfo); }
  359. _AFXCMN_INLINE void CToolTipCtrl::RelayEvent(LPMSG lpMsg)
  360. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TTM_RELAYEVENT, 0, (LPARAM)lpMsg); }
  361. #if _MFC_VER < 0x0600
  362. _AFXCMN_INLINE void CToolTipCtrl::SetDelayTime(UINT nDelay)
  363. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TTM_SETDELAYTIME, 0, nDelay); }
  364. #endif
  365. _AFXCMN_INLINE int CToolTipCtrl::GetToolCount() const
  366. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TTM_GETTOOLCOUNT, 0, 0L); }
  367. /////////////////////////////////////////////////////////////////////////////
  368. _AFXCMN_INLINE CSpinButtonCtrl::CSpinButtonCtrl()
  369. { }
  370. _AFXCMN_INLINE UINT CSpinButtonCtrl::GetAccel(int nAccel, UDACCEL* pAccel) const
  371. { ASSERT(::IsWindow(m_hWnd)); return (UINT) LOWORD(::SendMessage(m_hWnd, UDM_GETACCEL, nAccel, (LPARAM)pAccel)); }
  372. _AFXCMN_INLINE UINT CSpinButtonCtrl::GetBase() const
  373. { ASSERT(::IsWindow(m_hWnd)); return (UINT) LOWORD(::SendMessage(m_hWnd, UDM_GETBASE, 0, 0l)); }
  374. _AFXCMN_INLINE CWnd* CSpinButtonCtrl::GetBuddy() const
  375. { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle((HWND) ::SendMessage(m_hWnd, UDM_GETBUDDY, 0, 0l)); }
  376. _AFXCMN_INLINE int CSpinButtonCtrl::GetPos() const
  377. { ASSERT(::IsWindow(m_hWnd)); return (int) (::SendMessage(m_hWnd, UDM_GETPOS, 0, 0l)); }
  378. _AFXCMN_INLINE DWORD CSpinButtonCtrl::GetRange() const
  379. { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, UDM_GETRANGE, 0, 0l); }
  380. _AFXCMN_INLINE BOOL CSpinButtonCtrl::SetAccel(int nAccel, UDACCEL* pAccel)
  381. { ASSERT(::IsWindow(m_hWnd)); return (BOOL) LOWORD(::SendMessage(m_hWnd, UDM_SETACCEL, nAccel, (LPARAM)pAccel)); }
  382. _AFXCMN_INLINE int CSpinButtonCtrl::SetBase(int nBase)
  383. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, UDM_SETBASE, nBase, 0L); }
  384. _AFXCMN_INLINE CWnd* CSpinButtonCtrl::SetBuddy(CWnd* pWndBuddy)
  385. #if _MFC_VER >= 0x0600
  386. { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle((HWND) ::SendMessage(m_hWnd, UDM_SETBUDDY, (WPARAM)pWndBuddy->GetSafeHwnd(), 0L)); }
  387. #else
  388. { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle((HWND) ::SendMessage(m_hWnd, UDM_SETBUDDY, (WPARAM)pWndBuddy->m_hWnd, 0L)); }
  389. #endif
  390. _AFXCMN_INLINE int CSpinButtonCtrl::SetPos(int nPos)
  391. { ASSERT(::IsWindow(m_hWnd)); return (int) (short) LOWORD(::SendMessage(m_hWnd, UDM_SETPOS, 0, MAKELPARAM(nPos, 0))); }
  392. _AFXCMN_INLINE void CSpinButtonCtrl::SetRange(int nLower, int nUpper)
  393. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, UDM_SETRANGE, 0, MAKELPARAM(nUpper, nLower)); }
  394. /////////////////////////////////////////////////////////////////////////////
  395. _AFXCMN_INLINE CSliderCtrl::CSliderCtrl()
  396. { }
  397. _AFXCMN_INLINE int CSliderCtrl::GetLineSize() const
  398. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETLINESIZE, 0, 0l); }
  399. _AFXCMN_INLINE int CSliderCtrl::SetLineSize(int nSize)
  400. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_SETLINESIZE, 0, nSize); }
  401. _AFXCMN_INLINE int CSliderCtrl::GetPageSize() const
  402. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETPAGESIZE, 0, 0l); }
  403. _AFXCMN_INLINE int CSliderCtrl::SetPageSize(int nSize)
  404. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_SETPAGESIZE, 0, nSize); }
  405. _AFXCMN_INLINE int CSliderCtrl::GetRangeMax() const
  406. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETRANGEMAX, 0, 0l); }
  407. _AFXCMN_INLINE int CSliderCtrl::GetRangeMin() const
  408. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETRANGEMIN, 0, 0l); }
  409. _AFXCMN_INLINE void CSliderCtrl::SetRangeMin(int nMin, BOOL bRedraw)
  410. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_SETRANGEMIN, bRedraw, nMin); }
  411. _AFXCMN_INLINE void CSliderCtrl::SetRangeMax(int nMax, BOOL bRedraw)
  412. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_SETRANGEMAX, bRedraw, nMax); }
  413. _AFXCMN_INLINE void CSliderCtrl::ClearSel(BOOL bRedraw)
  414. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_CLEARSEL, bRedraw, 0l); }
  415. _AFXCMN_INLINE void CSliderCtrl::GetChannelRect(LPRECT lprc) const
  416. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_GETCHANNELRECT, 0, (LPARAM)lprc); }
  417. _AFXCMN_INLINE void CSliderCtrl::GetThumbRect(LPRECT lprc) const
  418. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_GETTHUMBRECT, 0, (LPARAM)lprc); }
  419. _AFXCMN_INLINE int CSliderCtrl::GetPos() const
  420. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETPOS, 0, 0l); }
  421. _AFXCMN_INLINE void CSliderCtrl::SetPos(int nPos)
  422. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_SETPOS, TRUE, nPos); }
  423. _AFXCMN_INLINE void CSliderCtrl::VerifyPos()
  424. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_SETPOS, FALSE, 0L); }
  425. _AFXCMN_INLINE void CSliderCtrl::ClearTics(BOOL bRedraw)
  426. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_CLEARTICS, bRedraw, 0l); }
  427. _AFXCMN_INLINE UINT CSliderCtrl::GetNumTics() const
  428. { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, TBM_GETNUMTICS, 0, 0l); }
  429. _AFXCMN_INLINE DWORD* CSliderCtrl::GetTicArray() const
  430. { ASSERT(::IsWindow(m_hWnd)); return (DWORD*) ::SendMessage(m_hWnd, TBM_GETPTICS, 0, 0l); }
  431. _AFXCMN_INLINE int CSliderCtrl::GetTic(int nTic) const
  432. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETTIC, nTic, 0L); }
  433. _AFXCMN_INLINE int CSliderCtrl::GetTicPos(int nTic) const
  434. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETTICPOS, nTic, 0L); }
  435. _AFXCMN_INLINE BOOL CSliderCtrl::SetTic(int nTic)
  436. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TBM_SETTIC, 0, nTic); }
  437. _AFXCMN_INLINE void CSliderCtrl::SetTicFreq(int nFreq)
  438. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_SETTICFREQ, nFreq, 0L); }
  439. #if _MFC_VER >= 0x0600
  440. _AFXCMN_INLINE CWnd* CSliderCtrl::GetBuddy(BOOL fLocation) const
  441. { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle((HWND) ::SendMessage(m_hWnd, TBM_GETBUDDY, fLocation, 0l)); }
  442. _AFXCMN_INLINE CWnd* CSliderCtrl::SetBuddy(CWnd* pWndBuddy, BOOL fLocation)
  443. { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle((HWND) ::SendMessage(m_hWnd, TBM_SETBUDDY, fLocation, (LPARAM)pWndBuddy->GetSafeHwnd())); }
  444. _AFXCMN_INLINE CToolTipCtrl* CSliderCtrl::GetToolTips() const
  445. { ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, TBM_GETTOOLTIPS, 0, 0L)); }
  446. _AFXCMN_INLINE void CSliderCtrl::SetToolTips(CToolTipCtrl* pTip)
  447. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_SETTOOLTIPS, (WPARAM)pTip->GetSafeHwnd(), 0L); }
  448. _AFXCMN_INLINE int CSliderCtrl::SetTipSide(int nLocation)
  449. { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TBM_SETTIPSIDE, nLocation, 0L); }
  450. #endif
  451. /////////////////////////////////////////////////////////////////////////////
  452. _AFXCMN_INLINE CProgressCtrl::CProgressCtrl()
  453. { }
  454. #if _MFC_VER >= 0x0600
  455. _AFXCMN_INLINE void CProgressCtrl::SetRange(short nLower, short nUpper)
  456. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, PBM_SETRANGE, 0, MAKELPARAM(nLower, nUpper)); }
  457. _AFXCMN_INLINE void CProgressCtrl::SetRange32(int nLower, int nUpper)
  458. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, PBM_SETRANGE32, (WPARAM) nLower, (LPARAM) nUpper); }
  459. _AFXCMN_INLINE int CProgressCtrl::GetPos()
  460. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, PBM_GETPOS, 0, 0); }
  461. #else
  462. _AFXCMN_INLINE void CProgressCtrl::SetRange(int nLower, int nUpper)
  463. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, PBM_SETRANGE, 0, MAKELPARAM(nLower, nUpper)); }
  464. _AFXCMN_INLINE int CProgressCtrl::SetPos(int nPos)
  465. { ASSERT(::IsWindow(m_hWnd)); return (int) LOWORD(::SendMessage(m_hWnd, PBM_SETPOS, nPos, 0L)); }
  466. #endif
  467. _AFXCMN_INLINE int CProgressCtrl::OffsetPos(int nPos)
  468. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, PBM_DELTAPOS, nPos, 0L); }
  469. _AFXCMN_INLINE int CProgressCtrl::SetStep(int nStep)
  470. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, PBM_SETSTEP, nStep, 0L); }
  471. _AFXCMN_INLINE int CProgressCtrl::StepIt()
  472. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, PBM_STEPIT, 0, 0L); }
  473. /////////////////////////////////////////////////////////////////////////////
  474. _AFXCMN_INLINE CHeaderCtrl::CHeaderCtrl()
  475. { }
  476. _AFXCMN_INLINE int CHeaderCtrl::GetItemCount() const
  477. { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, HDM_GETITEMCOUNT, 0, 0L); }
  478. _AFXCMN_INLINE int CHeaderCtrl::InsertItem(int nPos, HDITEM* phdi)
  479. { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, HDM_INSERTITEM, nPos, (LPARAM)phdi); }
  480. _AFXCMN_INLINE BOOL CHeaderCtrl::DeleteItem(int nPos)
  481. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, HDM_DELETEITEM, nPos, 0L); }
  482. _AFXCMN_INLINE BOOL CHeaderCtrl::GetItem(int nPos, HDITEM* pHeaderItem) const
  483. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, HDM_GETITEM, nPos, (LPARAM)pHeaderItem); }
  484. _AFXCMN_INLINE BOOL CHeaderCtrl::SetItem(int nPos, HDITEM* pHeaderItem)
  485. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, HDM_SETITEM, nPos, (LPARAM)pHeaderItem); }
  486. _AFXCMN_INLINE BOOL CHeaderCtrl::Layout(HDLAYOUT* pHeaderLayout)
  487. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, HDM_LAYOUT, 0, (LPARAM)pHeaderLayout); }
  488. /////////////////////////////////////////////////////////////////////////////
  489. _AFXCMN_INLINE CImageList::operator HIMAGELIST() const
  490. { return m_hImageList;}
  491. _AFXCMN_INLINE HIMAGELIST CImageList::GetSafeHandle() const
  492. { return (this == NULL) ? NULL : m_hImageList; }
  493. _AFXCMN_INLINE int CImageList::GetImageCount() const
  494. { ASSERT(m_hImageList != NULL); return ImageList_GetImageCount(m_hImageList); }
  495. _AFXCMN_INLINE int CImageList::Add(CBitmap* pbmImage, CBitmap* pbmMask)
  496. { ASSERT(m_hImageList != NULL); return ImageList_Add(m_hImageList, (HBITMAP)pbmImage->GetSafeHandle(), (HBITMAP)pbmMask->GetSafeHandle()); }
  497. _AFXCMN_INLINE int CImageList::Add(CBitmap* pbmImage, COLORREF crMask)
  498. { ASSERT(m_hImageList != NULL); return ImageList_AddMasked(m_hImageList, (HBITMAP)pbmImage->GetSafeHandle(), crMask); }
  499. _AFXCMN_INLINE BOOL CImageList::Remove(int nImage)
  500. { ASSERT(m_hImageList != NULL); return ImageList_Remove(m_hImageList, nImage); }
  501. _AFXCMN_INLINE BOOL CImageList::Replace(int nImage, CBitmap* pbmImage, CBitmap* pbmMask)
  502. { ASSERT(m_hImageList != NULL); return ImageList_Replace(m_hImageList, nImage, (HBITMAP)pbmImage->GetSafeHandle(), (HBITMAP)pbmMask->GetSafeHandle()); }
  503. _AFXCMN_INLINE int CImageList::Add(HICON hIcon)
  504. { ASSERT(m_hImageList != NULL); return ImageList_AddIcon(m_hImageList, hIcon); }
  505. _AFXCMN_INLINE int CImageList::Replace(int nImage, HICON hIcon)
  506. { ASSERT(m_hImageList != NULL); return ImageList_ReplaceIcon(m_hImageList, nImage, hIcon); }
  507. _AFXCMN_INLINE HICON CImageList::ExtractIcon(int nImage)
  508. { ASSERT(m_hImageList != NULL); return ImageList_ExtractIcon(NULL, m_hImageList, nImage); }
  509. _AFXCMN_INLINE BOOL CImageList::Draw(CDC* pDC, int nImage, POINT pt, UINT nStyle)
  510. { ASSERT(m_hImageList != NULL); ASSERT(pDC != NULL); return ImageList_Draw(m_hImageList, nImage, pDC->GetSafeHdc(), pt.x, pt.y, nStyle); }
  511. _AFXCMN_INLINE COLORREF CImageList::SetBkColor(COLORREF cr)
  512. { ASSERT(m_hImageList != NULL); return ImageList_SetBkColor(m_hImageList, cr); }
  513. _AFXCMN_INLINE COLORREF CImageList::GetBkColor() const
  514. { ASSERT(m_hImageList != NULL); return ImageList_GetBkColor(m_hImageList); }
  515. _AFXCMN_INLINE BOOL CImageList::SetOverlayImage(int nImage, int nOverlay)
  516. { ASSERT(m_hImageList != NULL); return ImageList_SetOverlayImage(m_hImageList, nImage, nOverlay); }
  517. _AFXCMN_INLINE BOOL CImageList::GetImageInfo(int nImage, IMAGEINFO* pImageInfo) const
  518. { ASSERT(m_hImageList != NULL); return ImageList_GetImageInfo(m_hImageList, nImage, pImageInfo); }
  519. _AFXCMN_INLINE BOOL CImageList::BeginDrag(int nImage, CPoint ptHotSpot)
  520. { ASSERT(m_hImageList != NULL); return ImageList_BeginDrag(m_hImageList, nImage, ptHotSpot.x, ptHotSpot.y); }
  521. _AFXCMN_INLINE void PASCAL CImageList::EndDrag()
  522. { ImageList_EndDrag(); }
  523. _AFXCMN_INLINE BOOL PASCAL CImageList::DragMove(CPoint pt)
  524. { return ImageList_DragMove(pt.x, pt.y); }
  525. _AFXCMN_INLINE BOOL CImageList::SetDragCursorImage(int nDrag, CPoint ptHotSpot)
  526. { ASSERT(m_hImageList != NULL); return ImageList_SetDragCursorImage(m_hImageList, nDrag, ptHotSpot.x, ptHotSpot.y); }
  527. _AFXCMN_INLINE BOOL PASCAL CImageList::DragShowNolock(BOOL bShow)
  528. {return ImageList_DragShowNolock(bShow);}
  529. _AFXCMN_INLINE CImageList* PASCAL CImageList::GetDragImage(LPPOINT lpPoint, LPPOINT lpPointHotSpot)
  530. {return CImageList::FromHandle(ImageList_GetDragImage(lpPoint, lpPointHotSpot));}
  531. _AFXCMN_INLINE BOOL PASCAL CImageList::DragEnter(CWnd* pWndLock, CPoint point)
  532. { return ImageList_DragEnter(pWndLock->GetSafeHwnd(), point.x, point.y); }
  533. _AFXCMN_INLINE BOOL PASCAL CImageList::DragLeave(CWnd* pWndLock)
  534. { return ImageList_DragLeave(pWndLock->GetSafeHwnd()); }
  535. /////////////////////////////////////////////////////////////////////////////
  536. _AFXCMN_INLINE CTabCtrl::CTabCtrl()
  537. { }
  538. _AFXCMN_INLINE CImageList* CTabCtrl::GetImageList() const
  539. { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST)::SendMessage(m_hWnd, TCM_GETIMAGELIST, 0, 0L)); }
  540. _AFXCMN_INLINE CImageList* CTabCtrl::SetImageList(CImageList* pImageList)
  541. { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST)::SendMessage(m_hWnd, TCM_SETIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle())); }
  542. _AFXCMN_INLINE int CTabCtrl::GetItemCount() const
  543. { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_GETITEMCOUNT, 0, 0L); }
  544. _AFXCMN_INLINE BOOL CTabCtrl::GetItem(int nItem, TCITEM* pTabCtrlItem) const
  545. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_GETITEM, nItem, (LPARAM)pTabCtrlItem); }
  546. _AFXCMN_INLINE BOOL CTabCtrl::SetItem(int nItem, TCITEM* pTabCtrlItem)
  547. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_SETITEM, nItem, (LPARAM)pTabCtrlItem); }
  548. #if _MFC_VER >= 0x0600
  549. _AFXCMN_INLINE BOOL CTabCtrl::SetItemExtra(int nBytes)
  550. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_SETITEMEXTRA, (WPARAM) nBytes, 0); }
  551. _AFXCMN_INLINE void CTabCtrl::SetCurFocus(int nItem)
  552. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TCM_SETCURFOCUS, (WPARAM) nItem, 0); }
  553. _AFXCMN_INLINE BOOL CTabCtrl::InsertItem(int nItem, LPCTSTR lpszItem)
  554. { ASSERT(::IsWindow(m_hWnd)); return CTabCtrl::InsertItem(TCIF_TEXT, nItem, lpszItem, 0, 0); }
  555. _AFXCMN_INLINE BOOL CTabCtrl::InsertItem(int nItem, LPCTSTR lpszItem, int nImage)
  556. { ASSERT(::IsWindow(m_hWnd)); return CTabCtrl::InsertItem(TCIF_TEXT|TCIF_IMAGE, nItem, lpszItem, nImage, 0); }
  557. #endif
  558. _AFXCMN_INLINE BOOL CTabCtrl::InsertItem(int nItem, TCITEM* pTabCtrlItem)
  559. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)pTabCtrlItem); }
  560. _AFXCMN_INLINE BOOL CTabCtrl::DeleteItem(int nItem)
  561. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_DELETEITEM, nItem, 0L); }
  562. _AFXCMN_INLINE BOOL CTabCtrl::DeleteAllItems()
  563. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_DELETEALLITEMS, 0, 0L); }
  564. _AFXCMN_INLINE BOOL CTabCtrl::GetItemRect(int nItem, LPRECT lpRect) const
  565. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_GETITEMRECT, nItem, (LPARAM)lpRect); }
  566. _AFXCMN_INLINE int CTabCtrl::GetCurSel() const
  567. { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_GETCURSEL, 0, 0L); }
  568. _AFXCMN_INLINE int CTabCtrl::SetCurSel(int nItem)
  569. { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_SETCURSEL, nItem, 0L); }
  570. _AFXCMN_INLINE int CTabCtrl::HitTest(TCHITTESTINFO* pHitTestInfo) const
  571. { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_HITTEST, 0, (LPARAM) pHitTestInfo); }
  572. _AFXCMN_INLINE void CTabCtrl::AdjustRect(BOOL bLarger, LPRECT lpRect)
  573. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TCM_ADJUSTRECT, bLarger, (LPARAM)lpRect); }
  574. _AFXCMN_INLINE CSize CTabCtrl::SetItemSize(CSize size)
  575. { ASSERT(::IsWindow(m_hWnd)); return (CSize)DWORD(::SendMessage(m_hWnd, TCM_SETITEMSIZE, 0, MAKELPARAM(size.cx,size.cy))); }
  576. _AFXCMN_INLINE void CTabCtrl::RemoveImage(int nImage)
  577. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TCM_REMOVEIMAGE, nImage, 0L); }
  578. _AFXCMN_INLINE void CTabCtrl::SetPadding(CSize size)
  579. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TCM_SETPADDING, 0, MAKELPARAM(size.cx, size.cy)); }
  580. _AFXCMN_INLINE int CTabCtrl::GetRowCount() const
  581. { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_GETROWCOUNT, 0, 0L); }
  582. #if _MFC_VER >= 0x0600
  583. _AFXCMN_INLINE CToolTipCtrl* CTabCtrl::GetToolTips() const
  584. { ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, TCM_GETTOOLTIPS, 0, 0L)); }
  585. _AFXCMN_INLINE void CTabCtrl::SetToolTips(CToolTipCtrl* pWndTip)
  586. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TCM_SETTOOLTIPS, (WPARAM)pWndTip->GetSafeHwnd(), 0L); }
  587. _AFXCMN_INLINE int CTabCtrl::GetCurFocus() const
  588. { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_GETCURFOCUS, 0, 0L); }
  589. _AFXCMN_INLINE int CTabCtrl::SetMinTabWidth(int cx)
  590. { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_SETMINTABWIDTH, 0, (LPARAM)cx); }
  591. _AFXCMN_INLINE void CTabCtrl::DeselectAll(BOOL fExcludeFocus)
  592. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TCM_DESELECTALL, fExcludeFocus, 0); }
  593. _AFXCMN_INLINE BOOL CTabCtrl::HighlightItem(int idItem, BOOL fHighlight /*= TRUE*/)
  594. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_HIGHLIGHTITEM, idItem, MAKELPARAM(fHighlight, 0)); }
  595. _AFXCMN_INLINE DWORD CTabCtrl::GetExtendedStyle()
  596. { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TCM_GETEXTENDEDSTYLE, 0, 0); }
  597. _AFXCMN_INLINE DWORD CTabCtrl::SetExtendedStyle(DWORD dwNewStyle, DWORD dwExMask /*= 0*/)
  598. { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, TCM_SETEXTENDEDSTYLE, dwExMask, dwNewStyle); }
  599. #else
  600. _AFXCMN_INLINE CToolTipCtrl* CTabCtrl::GetTooltips() const
  601. { ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, TCM_GETTOOLTIPS, 0, 0L)); }
  602. _AFXCMN_INLINE void CTabCtrl::SetTooltips(CToolTipCtrl* pWndTip)
  603. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TCM_SETTOOLTIPS, (WPARAM)pWndTip->m_hWnd, 0L); }
  604. _AFXCMN_INLINE int CTabCtrl::GetCurFocus() const
  605. { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_GETCURFOCUS, 0, 0L); }
  606. #endif
  607. /////////////////////////////////////////////////////////////////////////////
  608. _AFXCMN_INLINE CAnimateCtrl::CAnimateCtrl()
  609. { }
  610. _AFXCMN_INLINE BOOL CAnimateCtrl::Open(LPCTSTR lpszName)
  611. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, ACM_OPEN, 0, (LPARAM)lpszName); }
  612. _AFXCMN_INLINE BOOL CAnimateCtrl::Open(UINT nID)
  613. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, ACM_OPEN, 0, nID); }
  614. _AFXCMN_INLINE BOOL CAnimateCtrl::Play(UINT nFrom, UINT nTo, UINT nRep)
  615. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, ACM_PLAY, nRep, MAKELPARAM(nFrom, nTo)); }
  616. _AFXCMN_INLINE BOOL CAnimateCtrl::Stop()
  617. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, ACM_STOP, 0, 0L); }
  618. _AFXCMN_INLINE BOOL CAnimateCtrl::Close()
  619. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, ACM_OPEN, 0, 0L); }
  620. _AFXCMN_INLINE BOOL CAnimateCtrl::Seek(UINT nTo)
  621. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, ACM_PLAY, 0, MAKELPARAM(nTo, nTo)); }
  622. /////////////////////////////////////////////////////////////////////////////
  623. #ifndef _AFX_NO_RICHEDIT_SUPPORT
  624. _AFXCMN_INLINE CRichEditCtrl::CRichEditCtrl()
  625. { }
  626. _AFXCMN_INLINE BOOL CRichEditCtrl::CanUndo() const
  627. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_CANUNDO, 0, 0); }
  628. _AFXCMN_INLINE int CRichEditCtrl::GetLineCount() const
  629. { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_GETLINECOUNT, 0, 0); }
  630. _AFXCMN_INLINE BOOL CRichEditCtrl::GetModify() const
  631. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_GETMODIFY, 0, 0); }
  632. _AFXCMN_INLINE void CRichEditCtrl::SetModify(BOOL bModified /* = TRUE */)
  633. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETMODIFY, bModified, 0);}
  634. _AFXCMN_INLINE void CRichEditCtrl::GetRect(LPRECT lpRect) const
  635. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_GETRECT, 0, (LPARAM)lpRect); }
  636. _AFXCMN_INLINE CPoint CRichEditCtrl::GetCharPos(long lChar) const
  637. { ASSERT(::IsWindow(m_hWnd)); CPoint pt; ::SendMessage(m_hWnd, EM_POSFROMCHAR, (WPARAM)&pt, (LPARAM)lChar); return pt;}
  638. _AFXCMN_INLINE void CRichEditCtrl::SetOptions(WORD wOp, DWORD dwFlags)
  639. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETOPTIONS, (WPARAM)wOp, (LPARAM)dwFlags); }
  640. _AFXCMN_INLINE void CRichEditCtrl::EmptyUndoBuffer()
  641. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_EMPTYUNDOBUFFER, 0, 0); }
  642. _AFXCMN_INLINE void CRichEditCtrl::ReplaceSel(LPCTSTR lpszNewText, BOOL bCanUndo)
  643. {ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_REPLACESEL, (WPARAM) bCanUndo, (LPARAM)lpszNewText); }
  644. _AFXCMN_INLINE void CRichEditCtrl::SetRect(LPCRECT lpRect)
  645. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETRECT, 0, (LPARAM)lpRect); }
  646. _AFXCMN_INLINE BOOL CRichEditCtrl::Undo()
  647. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_UNDO, 0, 0); }
  648. _AFXCMN_INLINE void CRichEditCtrl::Clear()
  649. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_CLEAR, 0, 0); }
  650. _AFXCMN_INLINE void CRichEditCtrl::Copy()
  651. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_COPY, 0, 0); }
  652. _AFXCMN_INLINE void CRichEditCtrl::Cut()
  653. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_CUT, 0, 0); }
  654. _AFXCMN_INLINE void CRichEditCtrl::Paste()
  655. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_PASTE, 0, 0); }
  656. _AFXCMN_INLINE BOOL CRichEditCtrl::SetReadOnly(BOOL bReadOnly /* = TRUE */ )
  657. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_SETREADONLY, bReadOnly, 0L); }
  658. _AFXCMN_INLINE int CRichEditCtrl::GetFirstVisibleLine() const
  659. { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_GETFIRSTVISIBLELINE, 0, 0L); }
  660. _AFXCMN_INLINE BOOL CRichEditCtrl::DisplayBand(LPRECT pDisplayRect)
  661. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_DISPLAYBAND, 0, (LPARAM)pDisplayRect); }
  662. _AFXCMN_INLINE void CRichEditCtrl::GetSel(CHARRANGE &cr) const
  663. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_EXGETSEL, 0, (LPARAM)&cr); }
  664. _AFXCMN_INLINE void CRichEditCtrl::LimitText(long nChars)
  665. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_EXLIMITTEXT, 0, nChars); }
  666. _AFXCMN_INLINE long CRichEditCtrl::LineFromChar(long nIndex) const
  667. { ASSERT(::IsWindow(m_hWnd)); return (long)::SendMessage(m_hWnd, EM_EXLINEFROMCHAR, 0, nIndex); }
  668. _AFXCMN_INLINE void CRichEditCtrl::SetSel(CHARRANGE &cr)
  669. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_EXSETSEL, 0, (LPARAM)&cr); }
  670. _AFXCMN_INLINE long CRichEditCtrl::FindText(DWORD dwFlags, FINDTEXTEX* pFindText) const
  671. { ASSERT(::IsWindow(m_hWnd)); return (long)::SendMessage(m_hWnd, EM_FINDTEXTEX, dwFlags, (LPARAM)pFindText); }
  672. _AFXCMN_INLINE long CRichEditCtrl::FormatRange(FORMATRANGE* pfr, BOOL bDisplay)
  673. { ASSERT(::IsWindow(m_hWnd)); return (long)::SendMessage(m_hWnd, EM_FORMATRANGE, (WPARAM)bDisplay, (LPARAM)pfr); }
  674. _AFXCMN_INLINE long CRichEditCtrl::GetEventMask() const
  675. { ASSERT(::IsWindow(m_hWnd)); return (long)::SendMessage(m_hWnd, EM_GETEVENTMASK, 0, 0L); }
  676. _AFXCMN_INLINE long CRichEditCtrl::GetLimitText() const
  677. { ASSERT(::IsWindow(m_hWnd)); return (long)::SendMessage(m_hWnd, EM_GETLIMITTEXT, 0, 0L); }
  678. _AFXCMN_INLINE long CRichEditCtrl::GetSelText(LPSTR lpBuf) const
  679. { ASSERT(::IsWindow(m_hWnd)); return (long)::SendMessage(m_hWnd, EM_GETSELTEXT, 0, (LPARAM)lpBuf); }
  680. _AFXCMN_INLINE void CRichEditCtrl::HideSelection(BOOL bHide, BOOL bPerm)
  681. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_HIDESELECTION, bHide, bPerm); }
  682. _AFXCMN_INLINE void CRichEditCtrl::RequestResize()
  683. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_REQUESTRESIZE, 0, 0L); }
  684. _AFXCMN_INLINE WORD CRichEditCtrl::GetSelectionType() const
  685. { ASSERT(::IsWindow(m_hWnd)); return (WORD)::SendMessage(m_hWnd, EM_SELECTIONTYPE, 0, 0L); }
  686. _AFXCMN_INLINE COLORREF CRichEditCtrl::SetBackgroundColor(BOOL bSysColor, COLORREF cr)
  687. { ASSERT(::IsWindow(m_hWnd)); return (COLORREF)::SendMessage(m_hWnd, EM_SETBKGNDCOLOR, bSysColor, cr); }
  688. _AFXCMN_INLINE DWORD CRichEditCtrl::SetEventMask(DWORD dwEventMask)
  689. { ASSERT(::IsWindow(m_hWnd)); return (DWORD)::SendMessage(m_hWnd, EM_SETEVENTMASK, 0, dwEventMask); }
  690. _AFXCMN_INLINE BOOL CRichEditCtrl::SetOLECallback(IRichEditOleCallback* pCallback)
  691. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_SETOLECALLBACK, 0, (LPARAM)pCallback); }
  692. _AFXCMN_INLINE BOOL CRichEditCtrl::SetTargetDevice(HDC hDC, long lLineWidth)
  693. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_SETTARGETDEVICE, (WPARAM)hDC, lLineWidth); }
  694. _AFXCMN_INLINE BOOL CRichEditCtrl::SetTargetDevice(CDC &dc, long lLineWidth)
  695. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_SETTARGETDEVICE, (WPARAM)dc.m_hDC, lLineWidth); }
  696. _AFXCMN_INLINE long CRichEditCtrl::StreamIn(int nFormat, EDITSTREAM &es)
  697. { ASSERT(::IsWindow(m_hWnd)); return (long)::SendMessage(m_hWnd, EM_STREAMIN, nFormat, (LPARAM)&es); }
  698. _AFXCMN_INLINE long CRichEditCtrl::StreamOut(int nFormat, EDITSTREAM &es)
  699. { ASSERT(::IsWindow(m_hWnd)); return (long)::SendMessage(m_hWnd, EM_STREAMOUT, nFormat, (LPARAM)&es); }
  700. _AFXCMN_INLINE long CRichEditCtrl::GetTextLength() const
  701. { ASSERT(::IsWindow(m_hWnd)); return (long)::SendMessage(m_hWnd, WM_GETTEXTLENGTH, NULL, NULL); }
  702. #endif //!_AFX_NO_RICHEDIT_SUPPORT
  703. /////////////////////////////////////////////////////////////////////////////
  704. #endif //_AFXCMN_INLINE
  705. /////////////////////////////////////////////////////////////////////////////