Blink the form tab in Taskbar using FlashWindow from user32.dll

I will show you how to blink the tab in taskbar using FlashWindow from the user32.dll like, in yahoo messenger, if anyone replies then reply window blinks.

We need to use Windows API "FlashWindow" to make the minimized form to flash, which display as the blink effect


using System.Runtime.InteropServices;

        [DllImport("user32.dll")]
        public static extern int FlashWindow(IntPtr Hwnd, bool Revert);  

         // Add form's resize event to judge whether a form has been minimized or not.

        private void Form4_Resize(object sender, EventArgs e)

        {

             if (this.WindowState == FormWindowState.Minimized)

                 FlashWindow(this.Handle, false);

        }
Ebook Download
View all
Learn
View all