Thursday, June 10, 2021

【Visual Studio Visual Csharp】Shell About Dialog

 using System;

using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; // make sure that using System.Runtime.InteropServices; is included using System.Runtime.InteropServices; // make sure that using System.Reflection; is included using System.Reflection; namespace ShellAbout_dialog { public partial class Form1 : Form { [DllImport("shell32.dll")] static extern int ShellAbout(IntPtr hWnd, string szApp, string szOtherStuff, IntPtr hIcon); public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { ShellAbout(this.Handle, "AppName " + Assembly.GetExecutingAssembly().GetName().Version.ToString(), "", IntPtr.Zero); } } }

No comments:

Post a Comment