Solved

Question regarding system fonts

Posted on 2002-06-29
6
234 Views
Last Modified: 2013-12-03

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.
0
Comment
Question by:josamoto
6 Comments
 
LVL 6

Expert Comment

by:DrDelphi
ID: 7118887
EnumFontFamilies(passing the Desktop's HDC as the first parameter). You can use this same methodology for the Printer's fonts.


Good luck!!


0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 7118897
0
 
LVL 12

Expert Comment

by:pjknibbs
ID: 7119544
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.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 25

Accepted Solution

by:
clockwatcher earned 100 total points
ID: 7120447
They're stored in the registry as LOGFONTW structures.
 
  HKCU\Control Panel\Desktop\WindowMetrics

See the following article for an example:

  http://www.codeguru.com/mfc/comments/6527.shtml
0
 

Author Comment

by:josamoto
ID: 7150227
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?
0
 

Author Comment

by:josamoto
ID: 7150235
Thanx man, you really helped me a lot!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now