数码资讯
ShellAbout API函数“关于”对话框中显示自定义图标(C#版)
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; //声明API必须要有这个命名空间 using System.Drawing; //位图、图像处理必须添加该引用 namespace ConsoleApp1_CS { class Program { [DllImport("shell32.dll")] static extern int ShellAbout(IntPtr hWnd, string szApp, string szOtherStuff, IntPtr hIcon);
//API声明 static void Main(string[] args) { Bitmap b = new Bitmap(filename: @"E:\Picture\象棋 将.jpg"); IntPtr h = b.GetHicon(); ShellAbout(hWnd: IntPtr.Zero, szApp: "象棋", szOtherStuff: "自定义文字", hIcon: h); } } }
运行效果。
其他请参考另一帖子
https://www.cnblogs.com/ryueifu-VBA/p/16289274.html
ShellAbout API函数“关于”对话框中显示自定义图标(VBA版)
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。