public static void Flash(this IWin32Window window, int count, FlashWindowFlags flashWindowFlags) { if (window == null) throw new NullReferenceException(); var info = new FlashWindowInfo(window.Handle, flashWindowFlags, (uint)count); info.Flash(); }
public void FlashWindow(FlashWindowFlags fOptions, uint FlashCount, uint FlashRate) { if (_hwndSource != null) { FlashWindow(_hwndSource.Handle, fOptions, FlashCount, FlashRate); } }
public FlashWindowInfo(IntPtr handle, FlashWindowFlags flags, uint count, uint timeout) { _size = Convert.ToUInt32(Marshal.SizeOf(typeof(FlashWindowInfo))); _windowHandle = handle; _flags = flags; _count = count; _timeout = timeout; }
public FlashWindowInfo(IntPtr handle, FlashWindowFlags flags, uint flashCount, uint flashRate) { Size = Convert.ToUInt32(Marshal.SizeOf(typeof(FlashWindowInfo))); WindowHandle = handle; Flags = flags; FlashCount = flashCount; FlashRate = flashRate; }
public FlashWindowInfo(IntPtr Handle, FlashWindowFlags Flags, uint Count, uint Timeout) { hWnd = Handle; cbSize = (uint)Marshal.SizeOf(typeof(FlashWindowInfo)); dwFlags = Flags; uCount = Count; dwTimeout = Timeout; }
/// <summary> /// /// </summary> /// <param name="form"></param> /// <param name="count"></param> /// <param name="flags"></param> /// <param name="timeout"></param> /// <returns></returns> public static bool FlashWindow(WinForms.Form form, uint count, FlashWindowFlags flags, uint timeout) { FlashWindowInfo info = new FlashWindowInfo(); info.cbSize = 20; info.dwFlags = 0x0000000C | (uint)flags; // FLASHW_TIMERNOFG info.dwTimeout = timeout; info.hwnd = form.Handle; info.uCount = count; return(FlashWindowEx(ref info)); }
/// <summary> /// Flashes the window. /// </summary> private static bool FlashWindow(IntPtr hWnd, FlashWindowFlags options = (FlashWindowFlags.FLASHW_ALL | FlashWindowFlags.FLASHW_TIMERNOFG), uint count = 3, uint rate = 0) { if (hWnd == IntPtr.Zero) { return(false); } FLASHWINFO fi = new FLASHWINFO(); fi.cbSize = (uint)Marshal.SizeOf(typeof(FLASHWINFO)); fi.dwFlags = options; fi.uCount = count; fi.dwTimeout = rate; fi.hwnd = hWnd; return(FlashWindowEx(ref fi)); }
public static void FlashWindowEx(IntPtr windowHandle, FlashWindowFlags flags, int count, TimeSpan timeout) { HandleManipulator.ValidateAsArgument(windowHandle, "windowHandle"); var flashInfo = new FlashInfo { Size = Marshal.SizeOf(typeof(FlashInfo)), Hwnd = windowHandle, Flags = flags, Count = count, Timeout = Convert.ToInt32(timeout.TotalMilliseconds) }; User32.FlashWindowEx(ref flashInfo); }
/// <summary> /// /// </summary> /// <param name="form"></param> /// <param name="count"></param> /// <param name="flags"></param> /// <param name="timeout"></param> /// <returns></returns> public static bool FlashWindowUntilStop(WinForms.Form form, uint count, FlashWindowFlags flags, uint timeout) { if (flags == 0) { throw new ArgumentException("Flags cannot be zero", "flags"); } FlashWindowInfo info = new FlashWindowInfo(); info.cbSize = 20; info.dwFlags = 0x00000004 | (uint)flags; // FLASHW_TIMER info.dwTimeout = timeout; info.hwnd = form.Handle; info.uCount = count; return(FlashWindowEx(ref info)); }
public static bool FlashWindow(IntPtr hWnd, FlashWindowFlags fOptions, uint FlashCount, uint FlashRate) { if (IntPtr.Zero != hWnd) { FLASHWINFO fi = new FLASHWINFO(); fi.cbSize = (uint)Marshal.SizeOf(typeof(FLASHWINFO)); fi.dwFlags = fOptions; fi.uCount = FlashCount; fi.dwTimeout = FlashRate; fi.hwnd = hWnd; return FlashWindowEx(ref fi); } return false; }
public static bool FlashWindow(IntPtr hWnd, FlashWindowFlags fOptions, uint FlashCount, uint FlashRate) { if (IntPtr.Zero != hWnd) { FLASHWINFO fi = new FLASHWINFO(); fi.cbSize = (uint)Marshal.SizeOf(typeof(FLASHWINFO)); fi.dwFlags = fOptions; fi.uCount = FlashCount; fi.dwTimeout = FlashRate; fi.hwnd = hWnd; return(FlashWindowEx(ref fi)); } return(false); }
/// <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, int 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 User32.FlashWindowEx(ref flashInfo); }
public FlashWindowInfo(IntPtr handle, FlashWindowFlags flags, uint flashCount) : this(handle, flags, flashCount, 0) { }
/// <summary> /// Flashes the specified window. It does not change the active state of the window. The function uses the default /// cursor blink rate. /// </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> public static void FlashWindowEx(IntPtr windowHandle, FlashWindowFlags flags) { FlashWindowEx(windowHandle, flags, 0); }
/// <summary> /// Flashes the specified window. It does not change the active state of the window. The function uses the default /// cursor blink rate. /// </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> public static void FlashWindowEx(IntPtr windowHandle, FlashWindowFlags flags, int count) { FlashWindowEx(windowHandle, flags, count, TimeSpan.FromMilliseconds(0)); }
/// <summary> /// /// </summary> /// <param name="form"></param> /// <param name="count"></param> /// <param name="flags"></param> /// <returns></returns> public static bool FlashWindowUntilStop(WinForms.Form form, uint count, FlashWindowFlags flags) { return(FlashWindowUntilStop(form, count, flags, 0)); }
public void FlashWindow(FlashWindowFlags fOptions, uint FlashCount, uint FlashRate) { if (_hwndSource != null) FlashWindow(_hwndSource.Handle, fOptions, FlashCount, FlashRate); }
/// <summary> /// Flashes the specified window. It does not change the active state of the window. The function uses the default /// cursor blink rate. /// </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> public static void FlashWindowEx(IntPtr windowHandle, FlashWindowFlags flags) { FlashWindowEx(windowHandle, flags, 0); }
/// <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 FlashWindowInfo(IntPtr handle, FlashWindowFlags flags, uint count) : this(handle, flags, count, 0) { }
/// <summary> /// /// </summary> /// <param name="form"></param> /// <param name="count"></param> /// <param name="flags"></param> /// <param name="timeout"></param> /// <returns></returns> public static bool FlashWindow(WinForms.Form form, uint count, FlashWindowFlags flags, uint timeout) { FlashWindowInfo info = new FlashWindowInfo(); info.cbSize = 20; info.dwFlags = 0x0000000C | (uint)flags; // FLASHW_TIMERNOFG info.dwTimeout = timeout; info.hwnd = form.Handle; info.uCount = count; return FlashWindowEx(ref info); }
/// <summary> /// /// </summary> /// <param name="form"></param> /// <param name="count"></param> /// <param name="flags"></param> /// <returns></returns> public static bool FlashWindowUntilStop(WinForms.Form form, uint count, FlashWindowFlags flags) { return FlashWindowUntilStop(form, count, flags, 0); }
/// <summary> /// Flashes the specified window. It does not change the active state of the window. The function uses the default /// cursor blink rate. /// </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> public static void FlashWindowEx(IntPtr windowHandle, FlashWindowFlags flags, uint count) { FlashWindowEx(windowHandle, flags, count, TimeSpan.FromMilliseconds(0)); }
/// <summary> /// /// </summary> /// <param name="form"></param> /// <param name="count"></param> /// <param name="flags"></param> /// <param name="timeout"></param> /// <returns></returns> public static bool FlashWindowUntilStop(WinForms.Form form, uint count, FlashWindowFlags flags, uint timeout) { if (flags == 0) throw new ArgumentException("Flags cannot be zero", "flags"); FlashWindowInfo info = new FlashWindowInfo(); info.cbSize = 20; info.dwFlags = 0x00000004 | (uint)flags; // FLASHW_TIMER info.dwTimeout = timeout; info.hwnd = form.Handle; info.uCount = count; return FlashWindowEx(ref info); }
/// <summary> /// Flashes the window. It does not change the active state of the window. /// </summary> /// <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> /// <param name="flags">The flash status.</param> public void Flash(uint count, TimeSpan timeout, FlashWindowFlags flags = FlashWindowFlags.All) { WindowCore.FlashWindowEx(Handle, flags, count, timeout); }
/// <summary> /// Flashes the window. It does not change the active state of the window. /// </summary> /// <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> /// <param name="flags">The flash status.</param> public void Flash(int count, TimeSpan timeout, FlashWindowFlags flags = FlashWindowFlags.All) { AWindowHelper.FlashWindowEx(Handle, flags, count, timeout); }