internal enum FlashMode
{
FLASHW_CAPTION = 0x1 ,
FLASHW_TRAY = 0x2 ,
FLASHW_ALL = FLASHW_CAPTION | FLASHW_TRAY
}
internal struct FlashInfo
{
public int cdSize;
public System.IntPtr hwnd;
public int dwFlags;
public int uCount;
public int dwTimeout;
}
[DllImport("user32.dll")]
private static extern int FlashWindowEx(ref FlashInfo pfwi);
private void Flash(System.IntPtr hwnd , FlashMode flashMode , int times)
{
unsafe
{
FlashInfo FlashInf = new FlashInfo();
FlashInf.cdSize = sizeof(FlashInfo);
FlashInf.dwFlags = (int)flashMode;
FlashInf.dwTimeout = 0;
FlashInf.hwnd = hwnd;
FlashInf.uCount = times;
FlashWindowEx(ref FlashInf);
}
}
|