Flashing Taskbaricon effect
I am trying to archive a blinking effect as shown in the image with my main C # form. I searched a lot and I saw that this is possible with System.Windows.Shell
and TaskbarItemInfo
. It looks a lot easier than downloading and importing these dlls
.
I know how to create a new one TaskbarItemInfo
, but I don't know how I can connect it to the main form.
Any suggestions how can I do this using the link System.Windows.Shell
?
source to share
Can't see the image .. You are talking about the blinking effect of windows 7
To create a new TaskbarItemInfo:
public TaskbarItemInfo TaskbarItemInfo {get; set; }
public Form1()
{
InitializeComponent();
this.TaskbarItemInfo = new TaskbarItemInfo();//
}
But I prefer this:
using 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);
}
This should work.
Also // Popup until it gets focus FlashWindow.Flash (this);
// Flash window 5 times FlashWindow.Flash (this is, 5);
// Start blinking "Undefined" FlashWindow.Start (this);
// Stop blinking "Indefinate" FlashWindow.Stop (this);
source to share