How to use Windows ToolTip Control without bounding to a tool

后端 未结 2 2003
感动是毒
感动是毒 2021-01-04 10:32

I want to use the native windows tooltip control (pure Win32 API, no MFC stuff).

I read the doc, it seems that I have to send a TTM_ADDTOOL message to bond a tool to

2条回答
  •  佛祖请我去吃肉
    2021-01-04 11:11

    You need to call TTM_ADDTOOL at least once, you can't call TTM_SETTOOLINFO or get TTN_GETDISPINFO without it AFAIK.

    If your target it XP+ you can get away with using TTM_POPUP to display the tip at any position and at any time (But you need to handle the initial delay yourself unless you want a tracking tooltip)

    Generally you call TTM_ADDTOOL and associate it with a rectangle (TOOLINFO.rect) or a child window, or you can set the text to LPSTR_TEXTCALLBACK and handle TTN_GETDISPINFO if everything has a tip. MSDN has some sample code you should take a look at...

提交回复
热议问题