[StructLayout (LayoutKind.Sequential)]
public struct Flashwinfo
{
Public UInt32 cbsize;
Public INTPTR hwnd;
Public UInt32 dwFlags;
Public UInt32 Ucount;
Public UInt32 dwtimeout;
}
public class PInvoke
{
[DllImport ("User32.dll")]
public static extern Int16 FlashWindowEx (ref flashwinfo PWFI);
Stop flashing. The system restores the window to their original state.
Public Const UInt32 Flashw_stop = 0;
Flash the window caption.
Public Const UInt32 Flashw_caption = 1;
Flash the taskbar button.
Public Const UInt32 Flashw_tray = 2;
Flash both the window caption and taskbar button.
This was equivalent to setting the Flashw_caption | Flashw_tray flags.
Public Const UInt32 Flashw_all = 3;
Flash continuously, until the FLASHW_STOP flag is set.
Public Const UINT32 Flashw_timer = 4;
Flash continuously until the window comes to the foreground.
Public Const UInt32 FLASHW_TIMERNOFG = 12;
}
Blink when minimized
This. WindowState = = windowstate.minimized
Flashwinfo finfo = new Flashwinfo ();
Finfo.cbsize = (UINT) System.Runtime.InteropServices.Marshal.SizeOf (finfo);
Finfo.hwnd = new Windowinterophelper (this). Handle;
Finfo.ucount = 600;
Finfo.dwtimeout = 400;
Finfo.dwflags = Pinvoke.flashw_tray | Pinvoke.flashw_timer | Pinvoke.flashw_timernofg;
Pinvoke.flashwindowex (ref finfo);
WPF taskbar flashing