NMTTDISPINFOW structure (commctrl.h)

Contains information used in handling the TTN_GETDISPINFO notification code. This structure supersedes the TOOLTIPTEXT structure.

Syntax

typedef struct tagNMTTDISPINFOW {
  NMHDR     hdr;
  LPWSTR    lpszText;
  WCHAR     szText[80];
  HINSTANCE hinst;
  UINT      uFlags;
  LPARAM    lParam;
} NMTTDISPINFOW, *LPNMTTDISPINFOW;

Members

hdr

Type: NMHDR

NMHDR structure that contains additional information about the notification.

lpszText

Type: LPTSTR

Pointer to a null-terminated string that will be displayed as the tooltip text. If hinst specifies an instance handle, this member must be the identifier of a string resource.

szText[80]

Type: TCHAR

Buffer that receives the tooltip text. An application can copy the text to this buffer instead of specifying a string address or string resource. For tooltip text that exceeds 80 TCHARs, see comments in the remarks section of this document.

hinst

Type: HINSTANCE

Handle to the instance that contains a string resource to be used as the tooltip text. If lpszText is the address of the tooltip text string, this member must be NULL.

uFlags

Type: UINT

Flags that indicates how to interpret the idFrom member of the included NMHDR structure.

Value Meaning
TTF_IDISHWND
If this flag is set, idFrom is the tool's handle. Otherwise, it is the tool's identifier.
TTF_RTLREADING
Windows can be mirrored to display languages such as Hebrew or Arabic that read right-to-left (RTL). Normally, tooltip text is read in same direction as the text in its parent window. To have a tooltip read in the opposite direction from its parent window, add the TTF_RTLREADING flag to the uFlags member when processing the notification.
TTF_DI_SETITEM

Version 4.70. If you add this flag to uFlags while processing the notification, the tooltip control will retain the supplied information and not request it again.

lParam

Type: LPARAM

Version 4.70. Application-defined data associated with the tool.

Remarks

You need to point the lpszText array to your own private buffer when the text used in the tooltip exceeds 80 TCHARs in length. The system automatically strips the ampersand (&) accelerator TCHARs from all strings passed to a tooltip control, unless the control has the TTS_NOPREFIX style.

Note

The commctrl.h header defines NMTTDISPINFO as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Header commctrl.h