Adds a standard icon and title string to a tooltip.
Syntax
To send this message, call the
SendMessage
function as follows.
lResult = SendMessage( // returns LRESULT in lResult
hWndControl, // (HWND) handle to destination control
TTM_SETTITLE, // (UINT) message ID
wParam, // = (WPARAM)(int) icon;
lParam // = (LPARAM)(LPCTSTR) pszTitle;
);
Parameters
- icon
-
Set wParam to one of the following values to specify the icon to be displayed. As of Windows XP Service Pack 2 (SP2) and later, this parameter can also contain an HICON value. Any value greater than TTI_ERROR is assumed to be an HICON.
TTI_NONE- No icon.
TTI_INFO- Info icon.
TTI_WARNING- Warning icon
TTI_ERROR- Error Icon
TTI_INFO_LARGE- Large error Icon
TTI_WARNING_LARGE- Large error Icon
TTI_ERROR_LARGE- Large error Icon
- pszTitle
-
Pointer to the title string. You must assign a value to pszTitle.
Return Value
Returns TRUE if successful, FALSE if not.
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 icon contains an HICON, a copy of the icon is created by the tooltip window.
When calling TTM_SETTITLE, the string pointed to by pszTitle must not exceed 100 TCHARs in length, including the terminating NULL.
Example
The following example shows how to add a title and a system icon to a tooltip.
// hwndTip is the handle of the tooltip window.
HICON hIcon = LoadIcon(NULL, IDI_INFORMATION);
SendMessage(hwndTip, TTM_SETTITLE, (WPARAM)hIcon, L"Title text");
DestroyIcon(hIcon);
Message Information
| Minimum DLL Version | comctl32.dll version 5.80 or later |
|---|
| Header | comctl32.h |
|---|
| Minimum operating systems |
Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5 |
|---|
See Also
About Tooltip Controls