如何以编程方式更改程序图标
How to change program Icon programmatically?
如何在Visual C++中以编程方式更改程序图标?我的IDE是Visual Studio 2013。
我想将图标更改为嵌入式资源图标。你知道该怎么办吗?
using System.Runtime.InteropServices;
..
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern IntPtr SendMessage(IntPtr hWnd, uint msg, int wParam, IntPtr lParam);
struct IconHandler
{
internal const uint WmSeticon = 0x80u;
internal const int IconSmall = 0x0;
internal const int IconBig = 0x1;
}
private void Form1_Load(object sender, EventArgs e)
{
InitializeComponent();
//Properties.Resources.Icon.Handle is just an .*ico file in your resources. Icons can have different sizes.
SendMessage(Handle, IconHandler.WmSeticon, IconHandler.IconSmall, Properties.Resources.Icon.Handle);
SendMessage(Handle, IconHandler.WmSeticon, IconHandler.IconBig, Properties.Resources.Icon.Handle);
}
如果您想更改Microsoft Visual Studio C++的程序图标,您可以:
Right Click Visual Studio 2013
1.Click "Properties"
2.Click the sub-tab "Shortcut"
3.Click "Change Icon"
4.Browse or select from the list below
完成!
相关文章:
- 如何为 C++ Visual Studio 2019 指定应用程序图标?
- 什么是"undetectable means",它们如何更改 C/C++ 程序的对象?
- 如何在运行时永久更改窗口图标?
- 获取应用程序图标时出现问题
- 隐藏自定义应用程序窗口,但应在任务栏上显示应用程序图标(不是作为托盘图标)
- 字符串更改程序输出随机字符
- 在任务管理器中修改应用程序图标,而不是在系统托盘中
- 为什么i和j的值只有一个更改程序而有所不同
- 如何在OS X上的Qt应用程序中设置应用程序图标,足以进行分发
- 在Qt Creator中设置OSX的应用程序图标
- 使用CMake设置应用程序图标
- 如何更改的图标:任务栏,在左上角,当按下Alt Tab键时的图标,我的.exe
- 我们可以根据当前的解决方案配置更改exe图标吗?
- 如何在任务管理器中更改应用程序图标
- 当我们在另一个程序中调用该程序时,更改程序中常量参数的值
- 在 Linux 上的 Qt 中获取应用程序图标 URL
- 如何在Qt中设置应用程序图标
- 如何以编程方式更改程序图标
- Win32:更改程序图标
- 动态更改程序图标