• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

Question regarding system fonts

When right clicking on the desktop, then clicking properties and switching to the Appearance tab in the Display Properties dialog box, you can adjust the fonts used for the titlebar, tooltips, message boxes, menus icons etc.

Which functions do I use in Visual C++ to acquire these fonts? I’ve used GetStockObject() but this function allows you only to retrieve the default system font and a few others.

By the way, I’m using Win32 SDK and not MFC at all.
1 Solution
EnumFontFamilies(passing the Desktop's HDC as the first parameter). You can use this same methodology for the Printer's fonts.

Good luck!!

I have a feeling that you're asking "how do I get the specific font used in the Windows title bar" rather than "how do I get a list of fonts installed on the system", which is what DrDelphi has told you how to do. Unfortunately I'm at home and don't have access to my Windows documentation at the moment, so can't answer that question...if it's still unanswered tomorrow I should be able to help.
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

They're stored in the registry as LOGFONTW structures.
  HKCU\Control Panel\Desktop\WindowMetrics

See the following article for an example:

josamotoAuthor Commented:
I presume that I'll be using something like GetProfileString() to access the registry. I'm not too keen on using the registry, the parameters to the above functions is a bit tricky, especially the first two which requires the application name and the key name.

What will I ce using to retrieve the font from the registry?
josamotoAuthor Commented:
Thanx man, you really helped me a lot!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now