• 大小: 36KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: C#
  • 标签:

资源简介

C# winform 窗体任务栏颜色提示,包括颜色不变和颜色闪烁两种提示方式。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace test
{
    public partial class FlashWin : Form
    {
        public struct FLASHWINFO
        {
             public UInt32 cbSize;
             public IntPtr hwnd;
             public UInt32 dwFlags;
             public UInt32 uCount;
             public UInt32 dwTimeout;
        } 

        public FlashWin()
        {
            InitializeComponent();
        }

         public const UInt32 FLASHW_STOP = 0;
         public const UInt32 FLASHW_CAPTION = 1;
         public const UInt32 FLASHW_TRAY = 2;
         public const UInt32 FLASHW_ALL = 3;
         public const UInt32 FLASHW_TIMER = 4;
         public const UInt32 FLASHW_TIMERNOFG = 12; 


        [DllImport(“user32.dll“)]
        static extern bool FlashWindowEx(ref FLASHWINFO pwfi);

        [DllImport(“user32.dll“)]
        static extern bool FlashWindow(IntPtr handle bool invert); 


        private void button1_Click(object sender EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized; 
 
             FLASHWINFO fInfo = new FLASHWINFO();
 
             fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo));
             fInfo.hwnd = this.Handle;
             fInfo.dwFlags = FLASHW_TRAY | FLASHW_TIMERNOFG;
             fInfo.uCount = UInt32.MaxValue;
             fInfo.dwTimeout = 0;  
             FlashWindowEx(ref fInfo);
        }

        private void button2_Click(object sender EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized; 
            FlashWindow(this.Handletrue);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      24576  2011-07-13 15:44  test\test\bin\Debug\test.exe

     文件      28160  2011-07-13 15:44  test\test\bin\Debug\test.pdb

     文件       5632  2005-12-08 14:51  test\test\bin\Debug\test.vshost.exe

     文件       1813  2011-07-13 15:46  test\test\FlashWin.cs

     文件       2693  2011-07-13 15:45  test\test\FlashWin.Designer.cs

     文件       5814  2011-07-13 15:45  test\test\FlashWin.resx

     文件       1033  2011-07-13 15:41  test\test\obj\Debug\test.csproj.GenerateResource.Cache

     文件      24576  2011-07-13 15:44  test\test\obj\Debug\test.exe

     文件        180  2011-07-13 15:41  test\test\obj\Debug\test.FlashWin.resources

     文件       2905  2011-07-08 16:59  test\test\obj\Debug\test.Form1.resources

     文件      28160  2011-07-13 15:44  test\test\obj\Debug\test.pdb

     文件        180  2011-06-27 11:54  test\test\obj\Debug\test.Properties.Resources.resources

     文件        399  2011-07-13 15:44  test\test\obj\test.csproj.FileListAbsolute.txt

     文件        466  2011-07-13 15:33  test\test\Program.cs

     文件       1156  2011-06-27 11:52  test\test\Properties\AssemblyInfo.cs

     文件       2864  2011-06-27 11:52  test\test\Properties\Resources.Designer.cs

     文件       5612  2011-06-27 11:52  test\test\Properties\Resources.resx

     文件       1089  2011-06-27 11:52  test\test\Properties\Settings.Designer.cs

     文件        249  2011-06-27 11:52  test\test\Properties\Settings.settings

     文件       3569  2011-07-13 15:32  test\test\test.csproj

     文件        901  2011-06-27 11:52  test\test.sln

    ..A..H.     11264  2011-07-13 15:46  test\test.suo

     目录          0  2011-06-27 11:52  test\test\obj\Debug\TempPE

     目录          0  2011-06-27 11:54  test\test\bin\Debug

     目录          0  2011-07-13 15:44  test\test\obj\Debug

     目录          0  2011-07-13 15:31  test\test\bin

     目录          0  2011-06-27 11:54  test\test\obj

     目录          0  2011-06-27 11:52  test\test\Properties

     目录          0  2011-07-13 15:46  test\test

     目录          0  2011-06-27 11:52  test

............此处省略3个文件信息

评论

共有 条评论

相关资源