Partager via


CMFCTabToolTipInfo Structure

This structure provides information about the MDI tab that the user is hovering over.

struct CMFCTabToolTipInfo

Members

Data Members

Name

Description

CMFCTabToolTipInfo::m_nTabIndex

Specifies the index of the tab control.

CMFCTabToolTipInfo::m_pTabWnd

A pointer to the tab control.

CMFCTabToolTipInfo::m_strText

The tooltip text.

Remarks

A pointer to a CMFCTabToolTipInfo structure is passed as a parameter of the AFX_WM_ON_GET_TAB_TOOLTIP message. This message is generated when MDI tabs are enabled and the user hovers over a tab control.

Example

The following example shows how CMFCTabToolTipInfo is used in the MDITabsDemo Sample: MFC Tabbed MDI Application.

LRESULT CMainFrame::OnGetTabToolTip(WPARAM /*wp*/, LPARAM lp)
{
    CMFCTabToolTipInfo* pInfo = (CMFCTabToolTipInfo*) lp;
    ASSERT (pInfo != NULL);

    if (pInfo)
    {
        ASSERT_VALID (pInfo->m_pTabWnd);
        if (!pInfo->m_pTabWnd->IsMDITab ())
        {
            return 0;
        }
        pInfo->m_strText.Format (_T("Tab #%d Custom Tooltip"), pInfo->m_nTabIndex + 1);
    }

    return 0;
}

Inheritance Hierarchy

CMFCTabToolTipInfo

Requirements

Header: afxbasetabctrl.h

See Also

Reference

Hierarchy Chart

CMDIFrameWndEx::EnableMDITabs

CMDITabInfo::m_bTabCustomTooltips

Other Resources

MFC Classes