Help Center

CTooltip.SetTitlemethod

Adds a standard icon and title string to a Tooltip.

WindowsmethodCTooltip.incdocumented

Syntax

FUNCTION SetTitle (BYVAL hTooltip AS HWND, BYVAL nIcon AS LONG, BYVAL pwszTitle AS WSTRING PTR) AS BOOLEAN

Parameters

NameDescription
hTooltipThe handle of the Tooltip control.
nIconSet nIcon to one of the following values to specify the icon to be displayed. As of Windows Vista and later, this parameter can also contain an HICON value. Any value greater than TTI_ERROR_LARGE is assumed to be an HICON. See table below.
pwszTitlePointer to the title string. You must assign a value to nIcon.

Return value

Returns TRUE if successful, FALSE if not.

Description

Adds a standard icon and title string to a tooltip.

Remarks

The title of a tooltip appears above the text, in a different font. It is not sufficient to have a title; the tooltip must have text as well, or it is not displayed.

When nIcon contains an HICON, a copy of the icon is created by the tooltip window.

When calling TTM_SETTITLE, the string pointed to by pwszTitle must not exceed 100 TCHARs in length, including the terminating NULL.

Reference

  • Include file CTooltip.inc
  • Defined in AfxNova/CTooltip.inc:614
  • Documented in Windows/WIndows Controls/CTooltip Class.md
  • Topic: CTooltip Class