protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            const int WM_SETICON = 0x80;
            Bitmap smallIcon = new Bitmap(SystemInformation.SmallIconSize.Width, SystemInformation.SmallIconSize.Height);
            SendMessage(this.Handle, WM_SETICON, (IntPtr)0, smallIcon.GetHicon());
            SendMessage(this.Handle, WM_SETICON, (IntPtr)1, this.Icon.Handle);
        }

        [DllImport("user32.dll")]
        static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-05
  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
相关资源
相似解决方案