使用LoadIcon获取现代系统图标 [英] Getting modern system icons with LoadIcon

查看:197
本文介绍了使用LoadIcon获取现代系统图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 LoadIcon 用于加载系统图标,例如注意"标志.效果很好,但这使我的图标具有旧的(我认为)Windows 7外观.

我的程序在Windows 10上运行.

代码:

hicon = LoadIcon(NULL, IDI_EXCLAMATION);

有没有办法使图标具有新外观?

另一方面, MessageBox MB_ICONEXCLAMATION标志一起显示新图标.

解决方案

我看到MessageBoxW使用LoadIcon for loading system icons such as the "Attention" sign. This works fine, but this gives me the icon with the old (I think) Windows 7 look.

My program runs on Windows 10.

Code:

hicon = LoadIcon(NULL, IDI_EXCLAMATION);

Is there a way to get the icons with the new look?

On the other hand MessageBox with the MB_ICONEXCLAMATION flag shows the new icon.

解决方案

I saw that MessageBoxW uses the LoadIconWithScaleDown function for loading icons instead of LoadImage or LoadIcon. With standard icon IDs (from 0x7f00 (IDI_APPLICATION..IDI_SHIELD) this function actually loads images from imageres.dll (while LoadImage loads them from user32.dll).

这篇关于使用LoadIcon获取现代系统图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆