Win32 API按钮看起来很新,但使用了旧字体
Win32 API button is looking new but it uses old fonts
我使用Windows 7和Visual Studio 2013学习版,我是WinAPI的初学者。刚刚创建了一些按钮,代码如下:
HWND g_hPrzycisk;
g_hPrzycisk = CreateWindowEx(0, "BUTTON", "Button Here",
WS_CHILD | WS_VISIBLE | BS_CENTER, 100, 100, 150, 30, hwnd, NULL, hInstance, NULL);
按钮生成如下:https://i.stack.imgur.com/XHOkF.jpg
那么,问题出在哪里呢?我希望按钮看起来更像Windows7(使用Segoe UI字体或任何默认字体)。我一开始使用了#prgma指令,并在网上搜索了一些帮助。一无所获。如果有帮助,这里是我的#prgma
#pragma comment(linker,""/manifestdependency:type='win32'
name='Microsoft.Windows.Common-Controls' version='6.0.0.0'
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"")
如果有人能帮忙,我会非常感激的。如果问题重复-对不起。
要使用通用控件v6,还需要调用InitCommonControlsEx
您可以使用WM_SETFONT
为按钮指定所需的字体。
相关文章:
- 在C++中测量postscript字体宽度
- 问:如何使用C++中的按钮从窗口打开窗口
- 如何将点击的信号和插槽添加到qt中的自定义按钮中
- QML按钮点击功能执行顺序
- 当用户超过按钮点击限制时报告
- 函数计算用户按下按钮的频率
- 热键/按钮,根据需要进行编译,但不运行(在F5和Ctrl+Shift+B之间)
- 如何在Directwrite中获得给定字体的可用OpenType功能
- FLTK:按下哪个按钮 - 将数字传递给按钮的回调 (lambda)
- 如何通过按下第三个窗口中的按钮,将QString从一个窗口获取到另一个窗口
- 垂直方向的 Gtk3+ 旋转按钮 (c/c++)
- Qt自定义QPush按钮未显示在布局上
- SDL 操纵杆按钮按下/C++
- 如何使用按钮更新GTK3图像以使用C++从相机捕获图片
- Qt中来自不同功能的按钮引用
- WinAPI 在单击第一个对话框上的按钮控件并销毁第一个对话框后创建第二个对话框
- ImGui 在单击按钮后冻结
- WinAPI 无法创建按钮
- Win32 API按钮看起来很新,但使用了旧字体
- 在gtk+2.0中更改按钮上的字体大小