任务栏闪烁效果



我试图存档的闪烁效果,如图所示与我的c#主窗体。我在谷歌上搜索了很多,我看到System.Windows.ShellTaskbarItemInfo是可能的。这似乎比下载和导入那些dlls要容易得多。

我知道如何制作一个新的TaskbarItemInfo,但我不知道如何将它连接到主形式。

有什么建议我怎么能做到这一点与System.Windows.Shell参考?

看不见图片你是在说windows 7的闪烁效果吗

创建一个新的TaskbarItemInfo:

public TaskbarItemInfo TaskbarItemInfo {get;设置;}

    public Form1()
    {
        InitializeComponent();
        this.TaskbarItemInfo = new TaskbarItemInfo();//
    }

但我更喜欢这个:

使用System.Runtime.InteropServices;

    [DllImport("user32.dll")]
    public static extern int FlashWindow(IntPtr Hwnd, bool Revert); 
    // check if window is minimised
    private void Form4_Resize(object sender, EventArgs e)
    {
         if (this.WindowState == FormWindowState.Minimized)
             FlashWindow(this.Handle, false);
    }

这个应该可以…

也//闪烁窗口,直到它收到焦点

FlashWindow.Flash(这个);

//Flash窗口5次FlashWindow。Flash (5);

//开始闪烁" indefinite "

FlashWindow.Start(这个);

//停止" indefinite "闪烁FlashWindow.Stop(这);

最新更新