Custom ToolTips (Win32)

Custom ToolTips (Win32)

Post by The Ra » Thu, 27 Dec 2001 13:04:22



Fellow gurus,

The goal is: a tooltips window that displays text in multiple
fonts/colors. EX: One word in bold/black, the next in normal/red.

This requires an owner-drawn tooltips, correct? Which means the parent
window will have to hook/intercept the tooltips' paint message,
correct?

The question: If this is correct, how are the actual font/color
changes accomplished between two different words of text in the
tooltips? Do we set aside a couple of ASCII (system) characters (for
each font/color), insert them in the string, and parse them out? For
that matter--how do we control how each word is drawn, when we're
processing a hooked paint message? Break up the string? (Probably...
right?) (Another side question: the string isn't sent with the
WM_PAINT message anyway; it's just pixels that are painted...?)

Or, is there an easier way to change the font/color of the text within
the tooltips (using Win32)?

Thanks. It's just that... going to all the trouble of writing code
that might use flawed logic to begin with would suck--especially if
someone here already invented the wheel :-)

Thanks for any help.

Chad Lehman
Programmer/Hobbyist (since the teletype)

 
 
 

Custom ToolTips (Win32)

Post by The Ra » Thu, 27 Dec 2001 13:47:01


Quote:>The goal is: a tooltips window that displays text in multiple
>fonts/colors. EX: One word in bold/black, the next in normal/red.

>This requires an owner-drawn tooltips, correct? Which means the parent
>window will have to hook/intercept the tooltips' paint message,
>correct?

>The question: If this is correct, how are the actual font/color
>changes accomplished between two different words of text in the
>tooltips? Do we set aside a couple of ASCII (system) characters (for
>each font/color), insert them in the string, and parse them out? For
>that matter--how do we control how each word is drawn, when we're
>processing a hooked paint message? Break up the string? (Probably...
>right?) (Another side question: the string isn't sent with the
>WM_PAINT message anyway; it's just pixels that are painted...?)

>Or, is there an easier way to change the font/color of the text within
>the tooltips (using Win32)?

Sorry; maybe this needs clarification:

Using Custom Draw, and CDRF_NOTIFYITEMDRAW as the return value... how
do we paint each word? Each word in a string of text isn't considered
an ITEM by the paint cycle, is it? (That would be dumb ;) If we wanted
to change text... it would change ALL the text... right? So, how do we
get around that?

Thanks again

Chad

 
 
 

1. Q: Custom Draw (ToolTips)

Let's ask this a different way:

What point is there in the NM_CUSTOMDRAW (tooltips) message? ITEM
notification is useless, since the string is the only item. Isn't
NM_CUSTOMDRAW only useful if we want to draw the whole tooltip
ourselves?

If that's so, how do we draw a tooltips window (from scratch)? Buried
deep in commctrl.lib somewhere is the answer. If you've done this...
how? (sizing/text formatting/functions to use/etc) Anyone could slap a
sloppy self-drawn tooltips up there, but is there no way to make one
that looks like a Win32 tooltips (with multiple fonts/colors)?

Thanks again, for any thoughts

Chad Lehman

2. Missing libxfn.so

3. tooltip/listview/win32 SDK?

4. NT on FAT then OS/2 on same drive, possible?

5. Tooltips with the Win32 API?

6. Kermit News subscriptions

7. custom resource in WIN32 Dll ???

8. Disabling Protected mode CD-ROM driver under Windows95

9. Custom device property sheet and Win32?

10. Custom AppWizard for Win32

11. problems with a custom win32 DLL

12. ATL and custom interface derived from custom interface

13. Using custom interfaces with custom filter in directshow??