How to draw the bitmap icon on title bar when Windows Aero theme is enabled(启用 Windows Aero 主题时如何在标题栏上绘制位图图标)
问题描述
我正在开发 MFC 应用程序(DWM 库不可用).我想在标题栏上绘制一个用作按钮的位图.但是,在 Windows 7 中启用 Aero 主题时,位图不会出现(禁用 Aero 主题时没有问题).但是我的应用程序仍然可以通过单击位图的位置来做出反应.有谁可以教我如何解决这个问题?
I'm developing a MFC application (DWM library is not available). I want to draw a bitmap functioning as a button on the title bar. However, the bitmap won't present when the Aero theme is enabled in Windows 7 (There are no problem when I disable the Aero theme). But my application still reactable by clicking on the position of the bitmap. Does anyone can teach me how to solve this problem?
谢谢
推荐答案
MSDN 上描述了使用 DWM 将自定义数据绘制到框架区域,也解释了命中测试:
Drawing custom data into the frame area with DWM is described on MSDN, also the hit testing is explained there as well:
使用 DWM 自定义窗口框架
如果您在 CodeProject 网站上搜索 DWM,您会发现一些对您有帮助的文章:
If you search for DWM on the CodeProject site you find some articles that will help you:
C++ 中的 Vista 好东西: 在你的 UI 中使用 Glass
使用位图绘制自定义标题Windows 7/Vista Aero 主题
这篇关于启用 Windows Aero 主题时如何在标题栏上绘制位图图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:启用 Windows Aero 主题时如何在标题栏上绘制位图图标
基础教程推荐
- 初始化列表*参数*评估顺序 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- CString 到 char* 2021-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
