tags:

views:

262

answers:

2

What is the Win32 API call to determine the system-wide font (in particular the color) for say Menus.

This would be equivalent to going into Appearance Settings - Advanced - and then choosing Menu as the item to look at.

I can use GetSysColor to find the colors of various system-wide window elements, but cannot find the equivalent for fonts.

A: 

In C#, there's Control.DefaultFont, and for native access, this blog describes the win32 API call for getting it. The API call is SystemParametersInfo().

Phil Reif
+2  A: 

GetSysColor(COLOR_MENUTEXT) gives you the menu font colour.

SystemParametersInfo Will allow you to recover some font information, likewise GetStockObject for drawing on the device context.

But the system font is (probably) either Tahoma (on XP/W2K) or MS Sans Serif depending on how you set up your Dialog.

See http://blogs.msdn.com/oldnewthing/archive/2005/02/04/366987.aspx for more.

David L Morris