/// <summary> /// Stop Flashing the specified Window (form) /// </summary> /// <param name="form"></param> /// <returns></returns> public static bool Stop(System.Windows.Forms.Form form) { if (Win2000OrLater) { FlashwInfo fi = CreateFlashHInfo(form.Handle, FlashWStop, uint.MaxValue, 0); return(FlashWindowEx(ref fi)); } return(false); }
/// <summary> /// Flash the specified Window (form) for the specified number of times /// </summary> /// <param name="form">The Form (Window) to Flash.</param> /// <param name="count">The number of times to Flash.</param> /// <returns></returns> public static bool Flash(System.Windows.Forms.Form form, uint count) { if (Win2000OrLater) { FlashwInfo fi = CreateFlashHInfo(form.Handle, FlashHAll, count, 0); return(FlashWindowEx(ref fi)); } return(false); }
/// <summary> /// Flash the specified Window (Form) until it receives focus. /// </summary> /// <param name="form">The Form (Window) to Flash.</param> /// <returns></returns> public static bool Flash(System.Windows.Forms.Form form) { // Make sure we're running under Windows 2000 or later if (Win2000OrLater) { FlashwInfo fi = CreateFlashHInfo(form.Handle, FlashHAll | FlashWTimerNoCfg, uint.MaxValue, 0); return(FlashWindowEx(ref fi)); } return(false); }
private static FlashwInfo CreateFlashHInfo(IntPtr handle, uint flags, uint count, uint timeout) { FlashwInfo fi = new FlashwInfo(); fi.CbSize = Convert.ToUInt32(Marshal.SizeOf(fi)); fi.Hwnd = handle; fi.DwFlags = flags; fi.UCount = count; fi.DwTimeout = timeout; return(fi); }
private static extern bool FlashWindowEx(ref FlashwInfo pwfi);