Baffo rasta
Baffo rasta

Reputation: 165

Is it possible to stylize a tooltip with WIN32 API and GDI+ (C++)

I'm writing down some code and I would like to warn the user about wrong moves using a tooltip. The max I can achieve using WIN32 <commctrl.h> TOOLINFO structure is a classic rectangular tooltip on a single line. The result I'd like to reach is something like this:

enter image description here

Is there any way to do this using GDI+ and WIN32 API?

Thanks in advance!

Upvotes: 2

Views: 803

Answers (1)

Jonathan Potter
Jonathan Potter

Reputation: 37132

To split your tooltip text onto multiple lines, send the control a TTM_SETMAXTIPWIDTH message to give it a maximum width. It will then wrap text automatically, or you can use \r\n to insert line breaks manually. This is described in detail here: How to Implement Multiple Line Tooltips.

Use the TTM_SETTITLE message to give your tooltip a title and an icon.

Upvotes: 2

Related Questions