处理工具提示的TTN_NEEDTEXT通知

这个我只在对话框添加工具栏之后,当鼠标经过后让它有提示信息时用到的。

以下是摘抄:

1    首先要为使用 TTN_NEEDTEXT 通知 的每个控件提供一个字符串。 就是添加String字符串资源

2   添加消息映射  ON_NOTIFY_EX(TTN_NEEDTEXT, 0, &CMyDialog::OnTtnNeedText)

   函数原型:afx_msg BOOL OnTtnNeedText(UINT id, NMHDR *pNMHDR, LRESULT *pResult);

 

id

发送通知控件的标识符。 未使用。 控件 ID 从 NMHDR 结构为例。

pNMHDR

为一个比较有用的结构NMTTDISPINFO。。(经强制转换为pNMHDR)。

pResult

结果指针可设置的代码,在返回之前。 TTN_NEEDTEXT 处理程序可以忽略 pResult 参数。

 

 

NMTTDISPINFO structure

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

Syntax


typedef struct {
  NMHDR     hdr;
  LPTSTR    lpszText;
  TCHAR     szText;
  HINSTANCE hinst;
  UINT      uFlags;
#if (_WIN32_IE >= 0x0300)
  LPARAM    lParam;
#endif 
} NMTTDISPINFO, *LPNMTTDISPINFO;

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

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.

ValueMeaning
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

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值