Date: | June 27, 2006 / year-entry #214 |
Tags: | code |
Orig Link: | https://blogs.msdn.microsoft.com/oldnewthing/20060627-22/?p=30723 |
Comments: | 2 |
Summary: | 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... |
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. BOOL OnCreate(HWND hwnd, LPCREATESTRUCT lpcs) { ...
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 |
Comments (2)
Comments are closed. |
Thank you for publishing your code examples. They are really always very instructive.
I tried them on W2K, and saw something that I can’t explain: even without TTS_NOANIMATE, sometimes the tooltip was drawn without animation and border (at least I believe it’s a tooltip since it’s yellow). And with that flag, it’s always without animation and border. But whenever it’s drawn without border, the window is clipped to the parent (when I resize the partent window).
Is it possible to eliminate animation and still have tooltip that is not clipped? I hope it’s not a W2K specific problem. Thanks.
I found that using WS_EX_TOPMOST instead of WS_EX_TRANSPARENT gives a consistent, black border around the tooltip. If I combine the two, the border disappears on W2K. I don’t think WS_EX_TRANSPARENT is useful anyway since the tooltip already relay mouse messages to the parent’s window (as specified by TTF_TRANSPARENT).