CWnd::EnableToolTips

BOOL EnableToolTips( BOOL bEnable );

Return Value

TRUE if tooltips are enabled; otherwise FALSE.

Parameters

bEnable

Specifies whether the tooltip control is enabled or disabled. TRUE enables the control; FALSE disables the control.

Remarks

Call this member function to enable tooltips for the given window. Override OnToolHitTest to provide the TOOLINFO struct(s) for the window.

Note   Some windows, such as CToolBar, provide a built-in implementation of OnToolHitTest.

See TOOLINFO in the Win32 SDK Programmer’s Reference for more information on this structure.

Simply calling EnableToolTips is not enough to display tool tips for your child controls unless the parent window is derived from CFrameWnd. This is because CFrameWnd provides a default handler for the TTN_NEEDTEXT notification. If your parent window is not derived from CFrameWnd, that is, if it is a dialog box or a form view, tool tips for your child controls will not display correctly unless you provide a handler for the TTN_NEEDTEXT tool tip notification. See Tool Tips in Visual C++ Programmer’s Guide for a sample handler.

The default tool tips provided for your windows by EnableToolTips do not have text associated with them. In order to retrieve text for the tool tip to display, the TTN_NEEDTEXT notification is sent to the tool tip control's parent window just before the tool tip window is displayed. If there is no handler for this message to assign some value to the pszText member of the TOOLTIPTEXT structure, there will be no text displayed for the tool tip.

CWnd OverviewClass MembersHierarchy Chart

See Also   CWnd::CancelToolTips, CWnd::OnToolHitTest, CToolBar, TOOLINFO