Using custom-draw in tooltips to adjust the font

Using custom-draw in tooltips to adjust the font

Last time, we looked at in-place tooltips.
In that example, we finessed the font problem by
simply setting the destination font into the tooltip control.
We got away with that since we had only one tool.
But if you have multiple tools with different fonts,
then you can't set a font into the tooltip control and
expect it to work for every tool.
That's where custom draw comes in.

Start with the program from last time, but this time,
we'll set the font via custom-draw instead of setting it
globally.

Of course, doing this is overkill in our case where we have
only one tool,
so you'll have to imagine that the tooltip is managing
multiple tool regions, each with a different font.
When we get the NM_CUSTOMDRAW notification,
we respond to the CDDS_PREPAINT stage by
changing the font and returning the CDRF_NEWFONT
flag (which is necessary when changing the font).