Click to See Complete Forum and Search --> : Getting Tooltip Font


David Giovannini
May 6th, 1999, 05:47 PM
Hello,
I seem to be looking in all the wrong places.
I need the system setting for tooltip/hint/info font and size.
The colors fore/back are
m_clrBkColor = ::GetSysColor(COLOR_INFOBK);
m_clrFrameColor = RGB(0,0,0); // black
m_clrTextColor = ::GetSysColor(COLOR_INFOTEXT);

How do I get the font settings?

Thanx
David Giovannini

BarD
May 6th, 1999, 06:05 PM
I am afraid it is not possible. When I had similar problem, I created my own control only for the purpose to use standard CToolTipCtrl class. I have found no mention in MSDN related with tooltips font
BarD

David Giovannini
May 7th, 1999, 10:04 AM
Unfortunately I need multi-lined tool-tips that I can easily change on the fly.
I found a Balloon ToolTip class on this site. With a few modifications (including drawing) it has served me well. I am using the system font for display.

I have noticed through regedit that tooltip font names are in current-user/control-panel/appearance/schemes/"name" byte 015C (unicode text). How to get the size and current scheme selected is another question.

Dave

Harvey Hawes
May 7th, 1999, 12:17 PM
Hi,

I may be way off on this, but isn't a tooltip (CToolTipCtrl) a window (i.e. CWnd)? Have you tried to call GetFont() ? Assuming that you are using a tooltip derived from CToolTipCtrl...

Of course I've never tried this....

HTH,



Harvey Hawes

Software Engineer
BioScience Analysis Software Ltd.

Masters Candidate
Cardiovascular/Respiratory Sciences
Faculty of Medicine
University of Calgary
Calgary, Alberta, Canada

David Giovannini
May 10th, 1999, 04:49 PM
Great idea and it works. The code is:
CToolTipCtrl tool;
tool.Create(this);
CFont *f = tool.GetFont();
LOGFONT pLogFont;
f->GetLogFont(&pLogFont);
m_fontText.CreateFontIndirect(&pLogFont);
Thank you