问题描述
确定系统范围字体(特别是颜色)的 Win32 API 调用是什么.
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.
我可以使用 GetSysColor 找到各种系统范围窗口元素的颜色,但找不到字体的等效项.
I can use GetSysColor to find the colors of various system-wide window elements, but cannot find the equivalent for fonts.
推荐答案
GetSysColor(COLOR_MENUTEXT) 为您提供菜单字体颜色.
GetSysColor(COLOR_MENUTEXT) gives you the menu font colour.
SystemParametersInfo 将允许您恢复一些字体信息,同样用于在设备上下文上绘制的 GetStockObject.
SystemParametersInfo Will allow you to recover some font information, likewise GetStockObject for drawing on the device context.
但是系统字体(可能)是 Tahoma(在 XP/W2K 上)或 MS Sans Serif,具体取决于您如何设置 Dialog.
But the system font is (probably) either Tahoma (on XP/W2K) or MS Sans Serif depending on how you set up your Dialog.
参见 http://blogs.msdn.com/oldnewthing/archive/2005/02/04/366987.aspx 了解更多.
这篇关于确定 Windows 系统宽字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!