I'm writing a Win32 application using plain C and WinAPI. No MFC or C++ is allowed. To get the controls to draw using the appropriate style, I use a manifest, as described in the corresponding MSDN article. Everything is fine, and when I change the system style, my application changes style as well. But the font used is just ugly. How do I force the application to use the standard system font?
相关问题
- the application was unable to start correctly 0xc0
- Handle button click in another application
- win32 Python - pythoncom error - ImportError: No m
- how to Enumerate local fonts in silverlight 4
- How to prevent windows from accessing and detectin
相关文章
- Why windows 64 still makes use of user32.dll etc?
- Can WM_NEXTDLGCTL be used with non-dialog windows?
- Python relative import with more than two dots
- Windows EventLog: How fast are operations with it?
- Bind a char to an enum type
- Are resource files compiled as UNICODE or ANSI cod
- Loading custom font using JavaFX 8 and css
- Generating .afm from .ttf [closed]
You can use
SystemParametersInfo
withSPI_GETNONCLIENTMETRICS
parameter to retrieve the current font. SystemParametersInfo will take into account the current theme and provides font information for captions, menus, and message dialogs. (See remark toGetStockObject
http://msdn.microsoft.com/en-us/library/dd144925(VS.85).aspx). The function will retrieveNONCLIENTMETRICS
structure (see http://msdn.microsoft.com/en-us/library/ff729175(v=VS.85).aspx) which contains all information you needs:An example how to create and a set font in a window/control if you knows
LOGFONT
parameter see at the end of the example from change the default window font in a win32 windows project, but use doLOGFONT
not fromGetStockObject(DEFAULT_GUI_FONT)
, but returned bySystemParametersInfo
withSPI_GETNONCLIENTMETRICS
parameter instead.