/// <summary> /// Flashes the specified window. It does not change the active state of the window. /// </summary> /// <param name="windowHandle">A handle to the window to be flashed. The window can be either opened or minimized.</param> /// <param name="flags">The flash status.</param> /// <param name="count">The number of times to flash the window.</param> /// <param name="timeout">The rate at which the window is to be flashed.</param> public static void FlashWindowEx(IntPtr windowHandle, FlashWindowFlags flags, uint count, TimeSpan timeout) { // Check if the handle is valid HandleManipulator.ValidateAsArgument(windowHandle, "windowHandle"); // Create the data structure var flashInfo = new FlashInfo {Size = Marshal.SizeOf(typeof (FlashInfo)), Hwnd = windowHandle, Flags = flags, Count = count, Timeout = Convert.ToInt32(timeout.TotalMilliseconds)}; // Flash the window NativeMethods.FlashWindowEx(ref flashInfo); }
public static extern bool FlashWindowEx(ref FlashInfo pwfi);