Solved

Question regarding system fonts

Posted on 2002-06-29
6
241 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

717 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