Getting modern system icons with LoadIcon

耗尽温柔 提交于 2020-04-18 03:46:47

问题


I'm using 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.


回答1:


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).



来源:https://stackoverflow.com/questions/60887975/getting-modern-system-icons-with-loadicon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!