Windows 95
Windows NT 4.0 // 0x0400
VC98
Windows 98
Windows Me
Windows 2000 // 0x0500
Windows XP // 0x0501
#if _WIN32_IE >= 0x0500
_AFXCMN_INLINE COLORREF CTreeCtrl::GetLineColor() const
{ ASSERT(::IsWindow(m_hWnd)); return (COLORREF)::SendMessage(m_hWnd, TVM_GETLINECOLOR, 0, 0L); }
_AFXCMN_INLINE COLORREF CTreeCtrl::SetLineColor(COLORREF clrNew /*= CLR_DEFAULT*/)
{ ASSERT(::IsWindow(m_hWnd)); return (COLORREF)::SendMessage(m_hWnd, TVM_SETLINECOLOR, 0, (LPARAM)clrNew); }
#endif
#if _WIN32_IE >= 0x0500
_AFXCMN_INLINE int CSpinButtonCtrl::GetPos32(LPBOOL lpbError /*= NULL*/) const
{ ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, UDM_GETPOS32, 0, (LPARAM)lpbError); }
_AFXCMN_INLINE int CSpinButtonCtrl::SetPos32(int nPos)
{ ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, UDM_SETPOS32, 0, (LPARAM)nPos); }
#endif
#if _WIN32_IE >= 0x0500
_AFXCMN_INLINE int CToolBarCtrl::GetString(int nString, LPTSTR lpstrString, int cchMaxLen) const
{ ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_GETSTRING, MAKEWPARAM(cchMaxLen, nString), (LPARAM)lpstrString); }
#endif
#if _WIN32_IE >= 0x0500
_AFXCMN_INLINE int CHeaderCtrl::GetBitmapMargin() const
{ ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, HDM_GETBITMAPMARGIN, 0, 0L); }
_AFXCMN_INLINE int CHeaderCtrl::SetBitmapMargin(int nWidth)
{ ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, HDM_SETBITMAPMARGIN, nWidth, 0L); }
_AFXCMN_INLINE int CHeaderCtrl::SetFilterChangeTimeout(DWORD dwTimeOut)
{ ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, HDM_SETFILTERCHANGETIMEOUT, 0, dwTimeOut); }
_AFXCMN_INLINE int CHeaderCtrl::EditFilter(int nColumn, BOOL bDiscardChanges)
{ ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, HDM_EDITFILTER, nColumn, MAKELPARAM(bDiscardChanges, 0)); }
_AFXCMN_INLINE int CHeaderCtrl::ClearFilter(int nColumn)
{ ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, HDM_CLEARFILTER, nColumn, 0L); }
_AFXCMN_INLINE int CHeaderCtrl::ClearAllFilters()
{ ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, HDM_CLEARFILTER, (WPARAM)-1, 0L); }
#endif
#if _WIN32_IE >= 0x0500
_AFXCMN_INLINE void CReBarCtrl::PushChevron(UINT uBand, LPARAM lAppValue)
{ ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_PUSHCHEVRON, uBand, lAppValue); }
#endif
#if _WIN32_IE >= 0x0500
_AFXCMN_INLINE CSize CToolTipCtrl::GetBubbleSize(LPTOOLINFO lpToolInfo) const
{ ASSERT(::IsWindow(m_hWnd)); return CSize((DWORD)::SendMessage(m_hWnd, TTM_GETBUBBLESIZE, 0, (LPARAM)lpToolInfo)); }
_AFXCMN_INLINE BOOL CToolTipCtrl::AdjustRect(LPRECT lprc, BOOL bLarger /*= TRUE*/)
{ ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TTM_ADJUSTRECT, bLarger, (LPARAM)lprc); }
_AFXCMN_INLINE BOOL CToolTipCtrl::SetTitle(UINT uIcon, LPCTSTR lpstrTitle)
{ ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TTM_SETTITLE, uIcon, (LPARAM)lpstrTitle); }
#endif
#if (_WIN32_WINNT >= 0x0501)
AFX_INLINE HRESULT CToolTipCtrl::SetWindowTheme(LPCWSTR pszSubAppName)
{ ASSERT(::IsWindow(m_hWnd)); return (HRESULT)::SendMessage(m_hWnd, TTM_SETWINDOWTHEME, 0, (LPARAM)pszSubAppName); }
AFX_INLINE HRESULT CComboBoxEx::SetWindowTheme(LPCWSTR pszSubAppName)
{ ASSERT(::IsWindow(m_hWnd)); return (HRESULT)::SendMessage(m_hWnd, CBEM_SETWINDOWTHEME, 0, (LPARAM)pszSubAppName); }
AFX_INLINE void CReBarCtrl::GetBandMargins(PMARGINS pMargins)
{ ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, RB_GETBANDMARGINS, 0, (LPARAM)pMargins); }
AFX_INLINE HRESULT CReBarCtrl::SetWindowTheme(LPCWSTR pszSubAppName)
{ ASSERT(::IsWindow(m_hWnd)); return (HRESULT)::SendMessage(m_hWnd, RB_SETWINDOWTHEME, 0, (LPARAM)pszSubAppName); }
AFX_INLINE void CToolBarCtrl::GetMetrics(LPTBMETRICS ptbm) const
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(ptbm != NULL);
::SendMessage(m_hWnd, TB_GETMETRICS, 0, (LPARAM)ptbm);
}
AFX_INLINE void CToolBarCtrl::SetMetrics(LPTBMETRICS ptbm)
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(ptbm != NULL);
::SendMessage(m_hWnd, TB_SETMETRICS, 0, (LPARAM)ptbm);
}
AFX_INLINE HRESULT CToolBarCtrl::SetWindowTheme(LPCWSTR pszSubAppName)
{ ASSERT(::IsWindow(m_hWnd)); return (HRESULT)::SendMessage(m_hWnd, TB_SETWINDOWTHEME, 0, (LPARAM)pszSubAppName); }
AFX_INLINE LRESULT CListCtrl::SetSelectedColumn(int iCol)
{
ASSERT(::IsWindow(m_hWnd));
return ListView_SetSelectedColumn(m_hWnd, iCol);
}
AFX_INLINE DWORD CListCtrl::SetView(int iView)
{
ASSERT(::IsWindow(m_hWnd));
return ListView_SetView(m_hWnd, iView);
}
AFX_INLINE DWORD CListCtrl::GetView() const
{
ASSERT(::IsWindow(m_hWnd));
return ListView_GetView(m_hWnd);
}
AFX_INLINE LRESULT CListCtrl::InsertGroup(int index, PLVGROUP pgrp)
{
ASSERT(::IsWindow(m_hWnd));
return ListView_InsertGroup(m_hWnd, index, pgrp);
}
AFX_INLINE int CListCtrl::SetGroupInfo(int iGroupId, PLVGROUP pgrp)
{
ASSERT(::IsWindow(m_hWnd));
return (int)ListView_SetGroupInfo(m_hWnd, iGroupId, pgrp);
}
AFX_INLINE int CListCtrl::GetGroupInfo(int iGroupId, PLVGROUP pgrp) const
{
ASSERT(::IsWindow(m_hWnd));
return (int)ListView_GetGroupInfo(m_hWnd, iGroupId, pgrp);
}
AFX_INLINE LRESULT CListCtrl::RemoveGroup(int iGroupId)
{
ASSERT(::IsWindow(m_hWnd));
return ListView_RemoveGroup(m_hWnd, iGroupId);
}
AFX_INLINE LRESULT CListCtrl::MoveGroup(int iGroupId, int toIndex)
{
ASSERT(::IsWindow(m_hWnd));
return ListView_MoveGroup(m_hWnd, iGroupId, toIndex);
}
AFX_INLINE LRESULT CListCtrl::MoveItemToGroup(int idItemFrom, int idGroupTo)
{
ASSERT(::IsWindow(m_hWnd));
return ListView_MoveItemToGroup(m_hWnd, idItemFrom, idGroupTo);
}
AFX_INLINE void CListCtrl::SetGroupMetrics(PLVGROUPMETRICS pGroupMetrics)
{
ASSERT(::IsWindow(m_hWnd));
ListView_SetGroupMetrics(m_hWnd, pGroupMetrics);
}
AFX_INLINE void CListCtrl::GetGroupMetrics(PLVGROUPMETRICS pGroupMetrics) const
{
ASSERT(::IsWindow(m_hWnd));
ListView_GetGroupMetrics(m_hWnd, pGroupMetrics);
}
AFX_INLINE LRESULT CListCtrl::EnableGroupView(BOOL fEnable)
{
ASSERT(::IsWindow(m_hWnd));
return ListView_EnableGroupView(m_hWnd, fEnable);
}
AFX_INLINE BOOL CListCtrl::SortGroups(PFNLVGROUPCOMPARE _pfnGroupCompare, LPVOID _plv)
{
ASSERT(::IsWindow(m_hWnd));
return (BOOL)::SendMessage(m_hWnd, LVM_SORTGROUPS, (WPARAM)(LPARAM)_plv, (LPARAM)_pfnGroupCompare );
}
AFX_INLINE LRESULT CListCtrl::InsertGroupSorted(PLVINSERTGROUPSORTED pStructInsert)
{
ASSERT(::IsWindow(m_hWnd));
return ListView_InsertGroupSorted(m_hWnd, pStructInsert);
}
AFX_INLINE void CListCtrl::RemoveAllGroups()
{
ASSERT(::IsWindow(m_hWnd));
ListView_RemoveAllGroups(m_hWnd);
}
AFX_INLINE BOOL CListCtrl::HasGroup(int iGroupId) const
{
ASSERT(::IsWindow(m_hWnd));
return (BOOL)ListView_HasGroup(m_hWnd, iGroupId);
}
AFX_INLINE BOOL CListCtrl::SetTileViewInfo(PLVTILEVIEWINFO ptvi)
{
ASSERT(::IsWindow(m_hWnd));
return (BOOL)ListView_SetTileViewInfo(m_hWnd, ptvi);
}
AFX_INLINE BOOL CListCtrl::GetTileViewInfo(PLVTILEVIEWINFO ptvi) const
{
ASSERT(::IsWindow(m_hWnd));
return (BOOL)ListView_GetTileViewInfo(m_hWnd, ptvi);
}
AFX_INLINE BOOL CListCtrl::SetTileInfo(PLVTILEINFO pti)
{
ASSERT(::IsWindow(m_hWnd));
return (BOOL)ListView_SetTileInfo(m_hWnd, pti);
}
AFX_INLINE BOOL CListCtrl::GetTileInfo(PLVTILEINFO pti) const
{
ASSERT(::IsWindow(m_hWnd));
return (BOOL)ListView_GetTileInfo(m_hWnd, pti);
}
AFX_INLINE BOOL CListCtrl::SetInsertMark(LPLVINSERTMARK lvim)
{
ASSERT(::IsWindow(m_hWnd));
return (BOOL)ListView_SetInsertMark(m_hWnd, lvim);
}
AFX_INLINE BOOL CListCtrl::GetInsertMark(LPLVINSERTMARK lvim) const
{
ASSERT(::IsWindow(m_hWnd));
return (BOOL)ListView_GetInsertMark(m_hWnd, lvim);
}
AFX_INLINE int CListCtrl::InsertMarkHitTest(LPPOINT pPoint, LPLVINSERTMARK lvim) const
{
ASSERT(::IsWindow(m_hWnd));
return (int)ListView_InsertMarkHitTest(m_hWnd, pPoint, lvim);
}
AFX_INLINE int CListCtrl::GetInsertMarkRect(LPRECT pRect) const
{
ASSERT(::IsWindow(m_hWnd));
return (int)ListView_GetInsertMarkRect(m_hWnd, pRect);
}
AFX_INLINE COLORREF CListCtrl::SetInsertMarkColor(COLORREF color)
{
ASSERT(::IsWindow(m_hWnd));
return (COLORREF)ListView_SetInsertMarkColor(m_hWnd, color);
}
AFX_INLINE COLORREF CListCtrl::GetInsertMarkColor() const
{
ASSERT(::IsWindow(m_hWnd));
return ListView_GetInsertMarkColor(m_hWnd);
}
AFX_INLINE BOOL CListCtrl::SetInfoTip(PLVSETINFOTIP plvInfoTip)
{
ASSERT(::IsWindow(m_hWnd));
return ListView_SetInfoTip(m_hWnd, plvInfoTip);
}
AFX_INLINE UINT CListCtrl::GetSelectedColumn() const
{
ASSERT(::IsWindow(m_hWnd));
return ListView_GetSelectedColumn(m_hWnd);
}
AFX_INLINE BOOL CListCtrl::IsGroupViewEnabled() const
{
ASSERT(::IsWindow(m_hWnd));
return ListView_IsGroupViewEnabled(m_hWnd);
}
AFX_INLINE COLORREF CListCtrl::GetOutlineColor() const
{
ASSERT(::IsWindow(m_hWnd));
return ListView_GetOutlineColor(m_hWnd);
}
AFX_INLINE COLORREF CListCtrl::SetOutlineColor(COLORREF color)
{
ASSERT(::IsWindow(m_hWnd));
return ListView_SetOutlineColor(m_hWnd, color);
}
AFX_INLINE void CListCtrl::CancelEditLabel()
{
ASSERT(::IsWindow(m_hWnd));
ListView_CancelEditLabel(m_hWnd);
}
/////////////////////////////////////////////////////////////////////////////
// CLinkCtrl
AFX_INLINE CLinkCtrl::CLinkCtrl()
{ }
AFX_INLINE CLinkCtrl::~CLinkCtrl()
{
DestroyWindow();
}
// Attributes
AFX_INLINE int CLinkCtrl::GetIdealHeight() const
{
ASSERT(::IsWindow(m_hWnd));
return (int) ::SendMessage(m_hWnd, LM_HITTEST, 0, 0);
}
// operations
AFX_INLINE BOOL CLinkCtrl::SetItem(PLITEM pItem)
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(pItem != NULL);
return (BOOL) ::SendMessage(m_hWnd, LM_SETITEM, 0, (LPARAM)pItem);
}
AFX_INLINE BOOL CLinkCtrl::SetItemID(int iLink, LPCWSTR szID)
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(lstrlenW(szID) <= MAX_LINKID_TEXT);
if (lstrlenW(szID) > MAX_LINKID_TEXT)
return FALSE;
LITEM item;
item.mask = LIF_ITEMINDEX | LIF_ITEMID;
item.iLink = iLink;
lstrcpyW(item.szID, szID);
return SetItem(&item);
}
AFX_INLINE BOOL CLinkCtrl::SetItemUrl(int iLink, LPCWSTR szUrl)
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(lstrlenW(szUrl) <= L_MAX_URL_LENGTH);
if (lstrlenW(szUrl) >= L_MAX_URL_LENGTH)
return FALSE;
LITEM item;
item.mask = LIF_ITEMINDEX | LIF_URL;
item.iLink = iLink;
lstrcpyW(item.szUrl, szUrl);
return SetItem(&item);
}
AFX_INLINE BOOL CLinkCtrl::SetItemState(int iLink, UINT state, UINT stateMask /*= 0xFFFFFFFF*/)
{
ASSERT(::IsWindow(m_hWnd));
LITEM item;
item.mask = LIF_ITEMINDEX | LIF_STATE;
item.iLink = iLink;
item.state = state;
item.stateMask = stateMask;
return SetItem(&item);
}
AFX_INLINE BOOL CLinkCtrl::GetItem(PLITEM pItem) const
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(pItem != NULL);
return (BOOL) ::SendMessage(m_hWnd, LM_GETITEM, 0, (LPARAM)pItem);
}
AFX_INLINE BOOL CLinkCtrl::GetItemID(int iLink, CString& strID) const
{
ASSERT(::IsWindow(m_hWnd));
LITEM item;
item.mask = LIF_ITEMINDEX | LIF_ITEMID;
item.iLink = iLink;
if (!GetItem(&item))
return FALSE;
strID = item.szID;
return TRUE;
}
AFX_INLINE BOOL CLinkCtrl::GetItemID(int iLink, LPWSTR szID, UINT cchID) const
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(szID != NULL);
ASSERT(cchID >= MAX_LINKID_TEXT);
if (szID == NULL || cchID < MAX_LINKID_TEXT)
return FALSE;
LITEM item;
item.mask = LIF_ITEMINDEX | LIF_ITEMID;
item.iLink = iLink;
if (!GetItem(&item))
return FALSE;
lstrcpyW(szID, item.szID);
return TRUE;
}
AFX_INLINE BOOL CLinkCtrl::GetItemUrl(int iLink, CString& strUrl) const
{
ASSERT(::IsWindow(m_hWnd));
LITEM item;
item.mask = LIF_ITEMINDEX | LIF_URL;
item.iLink = iLink;
if (!GetItem(&item))
return FALSE;
strUrl = item.szUrl;
return TRUE;
}
AFX_INLINE BOOL CLinkCtrl::GetItemUrl(int iLink, LPWSTR szUrl, UINT cchUrl) const
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(szUrl != NULL);
ASSERT(cchUrl >= L_MAX_URL_LENGTH);
if (szUrl == NULL || cchUrl < L_MAX_URL_LENGTH)
return FALSE;
LITEM item;
item.mask = LIF_ITEMINDEX | LIF_URL;
item.iLink = iLink;
if (!GetItem(&item))
return FALSE;
lstrcpyW(szUrl, item.szUrl);
return TRUE;
}
AFX_INLINE BOOL CLinkCtrl::GetItemState(int iLink, UINT *pnState, UINT stateMask /*= 0xFFFFFFFF*/) const
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(pnState != NULL);
if (pnState == NULL)
return FALSE;
LITEM item;
item.mask = LIF_ITEMINDEX | LIF_URL;
item.iLink = iLink;
item.stateMask = stateMask;
if (!GetItem(&item))
return FALSE;
*pnState = item.state;
return TRUE;
}
AFX_INLINE BOOL CLinkCtrl::HitTest(PLHITTESTINFO phti) const
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(phti != NULL);
return (BOOL) ::SendMessage(m_hWnd, LM_HITTEST, 0, (LPARAM)phti);
}
#endif // _WIN32_WINNT >= 0x0501
#if WINVER >= 0x0500
_AFXDLGS_INLINE BOOL CPrintDialogEx::PrintSelection() const
{ return m_pdex.Flags & PD_SELECTION ? TRUE : FALSE; }
_AFXDLGS_INLINE BOOL CPrintDialogEx::PrintRange() const
{ return m_pdex.Flags & PD_PAGENUMS ? TRUE : FALSE; }
_AFXDLGS_INLINE BOOL CPrintDialogEx::PrintCurrentPage() const
{ return m_pdex.Flags & PD_CURRENTPAGE ? TRUE : FALSE; }
_AFXDLGS_INLINE BOOL CPrintDialogEx::PrintAll() const
{ return !PrintRange() && !PrintSelection() && !PrintCurrentPage() ? TRUE : FALSE; }
_AFXDLGS_INLINE BOOL CPrintDialogEx::PrintCollate() const
{ return m_pdex.Flags & PD_COLLATE ? TRUE : FALSE; }
_AFXDLGS_INLINE HDC CPrintDialogEx::GetPrinterDC() const
{ ASSERT_VALID(this);
ASSERT(m_pdex.Flags & PD_RETURNDC);
return m_pdex.hDC; }
#endif //(WINVER >= 0x0500)
#if (_WIN32_WINNT >= 0x0500)
AFX_INLINE COLORREF CDC::GetDCBrushColor() const
{ ASSERT(m_hDC != NULL); return ::GetDCBrushColor(m_hDC); }
AFX_INLINE COLORREF CDC::SetDCBrushColor(COLORREF crColor)
{ ASSERT(m_hDC != NULL); return ::SetDCBrushColor(m_hDC, crColor); }
AFX_INLINE COLORREF CDC::GetDCPenColor() const
{ ASSERT(m_hDC != NULL); return ::GetDCPenColor(m_hDC); }
AFX_INLINE COLORREF CDC::SetDCPenColor(COLORREF crColor)
{ ASSERT(m_hDC != NULL); return ::SetDCPenColor(m_hDC, crColor); }
AFX_INLINE BOOL CDC::GetCharABCWidthsI(UINT giFirst, UINT cgi, LPWORD pgi, LPABC lpabc) const
{ ASSERT(m_hDC != NULL); return ::GetCharABCWidthsI(m_hDC, giFirst, cgi, pgi, lpabc); }
AFX_INLINE BOOL CDC::GetCharWidthI(UINT giFirst, UINT cgi, LPWORD pgi, LPINT lpBuffer) const
{ ASSERT(m_hDC != NULL); return ::GetCharWidthI(m_hDC, giFirst, cgi, pgi, lpBuffer); }
AFX_INLINE BOOL CDC::GetTextExtentExPointI(LPWORD pgiIn, int cgi, int nMaxExtent, LPINT lpnFit, LPINT alpDx, LPSIZE lpSize) const
{
ASSERT(lpSize != NULL);
ASSERT(m_hDC != NULL);
return ::GetTextExtentExPointI(m_hDC, pgiIn, cgi, nMaxExtent, lpnFit, alpDx, lpSize);
}
AFX_INLINE BOOL CDC::GetTextExtentPointI(LPWORD pgiIn, int cgi, LPSIZE lpSize) const
{
ASSERT(lpSize != NULL);
ASSERT(m_hDC != NULL);
return ::GetTextExtentPointI(m_hDC, pgiIn, cgi, lpSize);
}
#endif
#if(WINVER >= 0x0500)
AFX_INLINE BOOL CWnd::GetWindowInfo(PWINDOWINFO pwi) const
{ ASSERT(::IsWindow(m_hWnd)); return ::GetWindowInfo(m_hWnd, pwi); }
AFX_INLINE CWnd* CWnd::GetAncestor(UINT gaFlags) const
{ ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetAncestor(m_hWnd, gaFlags)); }
AFX_INLINE BOOL CWnd::GetMenuBarInfo(LONG idObject, LONG idItem, PMENUBARINFO pmbi) const
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(pmbi != NULL);
return ::GetMenuBarInfo(m_hWnd, idObject, idItem, pmbi);
}
AFX_INLINE BOOL CWnd::GetScrollBarInfo(LONG idObject, PSCROLLBARINFO psbi) const
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(psbi != NULL);
return ::GetScrollBarInfo(m_hWnd, idObject, psbi);
}
AFX_INLINE BOOL CWnd::GetTitleBarInfo(PTITLEBARINFO pti) const
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(pti != NULL);
return ::GetTitleBarInfo(m_hWnd, pti);
}
AFX_INLINE BOOL CWnd::AnimateWindow(DWORD dwTime, DWORD dwFlags)
{
ASSERT(::IsWindow(m_hWnd));
return ::AnimateWindow(m_hWnd, dwTime, dwFlags);
}
AFX_INLINE BOOL CWnd::FlashWindowEx(DWORD dwFlags, UINT uCount, DWORD dwTimeout)
{
ASSERT(::IsWindow(m_hWnd));
FLASHWINFO fwi;
fwi.cbSize = sizeof(fwi);
fwi.hwnd = m_hWnd;
fwi.dwFlags = dwFlags;
fwi.uCount = uCount;
fwi.dwTimeout = dwTimeout;
return ::FlashWindowEx(&fwi);
}
AFX_INLINE BOOL CComboBox::GetComboBoxInfo(PCOMBOBOXINFO pcbi) const
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(pcbi != NULL);
return ::GetComboBoxInfo(m_hWnd, pcbi);
}
AFX_INLINE DWORD CListBox::GetListBoxInfo() const
{ ASSERT(::IsWindow(m_hWnd)); return ::GetListBoxInfo(m_hWnd); }
AFX_INLINE BOOL CMenu::SetMenuInfo(LPCMENUINFO lpcmi)
{ ASSERT(::IsMenu(m_hMenu)); return ::SetMenuInfo(m_hMenu, lpcmi); }
AFX_INLINE BOOL CMenu::GetMenuInfo(LPMENUINFO lpcmi) const
{ ASSERT(::IsMenu(m_hMenu)); return ::GetMenuInfo(m_hMenu, lpcmi); }
#endif // WINVER >= 0x0500
#if(_WIN32_WINNT >= 0x0500)
AFX_INLINE BOOL CWnd::SetLayeredWindowAttributes(COLORREF crKey, BYTE bAlpha, DWORD dwFlags)
{
ASSERT(::IsWindow(m_hWnd));
return ::SetLayeredWindowAttributes(m_hWnd, crKey, bAlpha, dwFlags);
}
AFX_INLINE BOOL CWnd::UpdateLayeredWindow(CDC* pDCDst, POINT *pptDst, SIZE *psize,
CDC* pDCSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags)
{
ASSERT(::IsWindow(m_hWnd));
return ::UpdateLayeredWindow(m_hWnd, pDCDst->GetSafeHdc(), pptDst, psize,
pDCSrc->GetSafeHdc(), pptSrc, crKey, pblend, dwFlags);
}
#endif // _WIN32_WINNT >= 0x0500
#if(_WIN32_WINNT >= 0x0501)
AFX_INLINE BOOL CWnd::GetLayeredWindowAttributes(COLORREF *pcrKey, BYTE *pbAlpha, DWORD *pdwFlags) const
{
ASSERT(::IsWindow(m_hWnd));
return ::GetLayeredWindowAttributes(m_hWnd, pcrKey, pbAlpha, pdwFlags);
}
AFX_INLINE BOOL CWnd::PrintWindow(CDC* pDC, UINT nFlags) const
{
ASSERT(::IsWindow(m_hWnd));
return ::PrintWindow(m_hWnd, pDC->GetSafeHdc(), nFlags);
}
AFX_INLINE BOOL CScrollBar::GetScrollBarInfo(PSCROLLBARINFO pScrollInfo) const
{ ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, SBM_GETSCROLLBARINFO, NULL, (LPARAM)pScrollInfo); }
AFX_INLINE BOOL CEdit::SetCueBanner(LPCWSTR lpcwText)
{
ASSERT(::IsWindow(m_hWnd));
return Edit_SetCueBannerText(m_hWnd, lpcwText);
}
AFX_INLINE BOOL CEdit::GetCueBanner(LPWSTR lpwText, int cchText)
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(lpwText != NULL);
return Edit_GetCueBannerText(m_hWnd, lpwText, cchText);
}
AFX_INLINE BOOL CButton::GetIdealSize(SIZE* psize)
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(psize != NULL);
return Button_GetIdealSize(m_hWnd, psize);
}
AFX_INLINE BOOL CButton::SetImageList(PBUTTON_IMAGELIST pbuttonImagelist)
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(pbuttonImagelist != NULL);
return Button_SetImageList(m_hWnd, pbuttonImagelist);
}
AFX_INLINE BOOL CButton::GetImageList(PBUTTON_IMAGELIST pbuttonImagelist)
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(pbuttonImagelist != NULL);
return Button_GetImageList(m_hWnd, pbuttonImagelist);
}
AFX_INLINE BOOL CButton::SetTextMargin(RECT* pmargin)
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(pmargin != NULL);
return Button_SetTextMargin(m_hWnd, pmargin);
}
AFX_INLINE BOOL CButton::GetTextMargin(RECT* pmargin)
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(pmargin == NULL);
return Button_GetTextMargin(m_hWnd, pmargin);
}
#endif // _WIN32_WINNT >= 0x0501
#if (_WIN32_WINNT >= 0x0501)
/////////////////////////////////////////////////////////////////////////////
// CLinkCtrl
BOOL CLinkCtrl::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
UINT nID)
{
// initialize common controls
VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_LINK_REG));
#ifndef _UNICODE
ASSERT(0);
dwStyle;
rect;
pParentWnd;
nID;
// Can only be used in UNICODE builds
return FALSE;
#else
CWnd* pWnd = this;
return pWnd->Create(WC_LINK, NULL, dwStyle, rect, pParentWnd, nID);
#endif // _UNICODE
}
BOOL CLinkCtrl::CreateEx(DWORD dwExStyle, DWORD dwStyle, const RECT& rect,
CWnd* pParentWnd, UINT nID)
{
BOOL bRet = Create(dwStyle, rect, pParentWnd, nID);
if (bRet)
{
ModifyStyleEx(0, dwExStyle);
}
return bRet;
}
#endif
참조 사이트: