コード例 #1
0
 /// <summary>
 /// Start Flashing the specified Window (form)
 /// </summary>
 /// <param name="form">The Form (Window) to Flash.</param>
 /// <returns></returns>
 public static bool Start(Form form)
 {
     if (Win2000OrLater)
     {
         Flashwinfo fi = Create_FLASHWINFO(form.Handle, FLASHW_ALL, uint.MaxValue, 0);
         return(FlashWindowEx(ref fi));
     }
     return(false);
 }
コード例 #2
0
 /// <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(Form form, uint count)
 {
     if (Win2000OrLater)
     {
         Flashwinfo fi = Create_FLASHWINFO(form.Handle, FLASHW_ALL, count, 0);
         return(FlashWindowEx(ref fi));
     }
     return(false);
 }
コード例 #3
0
        /// <summary>
        /// Stop Flashing the specified process MainWindow
        /// </summary>
        /// <param name="process"></param>
        /// <returns></returns>
        public static bool StopWindowFlashing(Process process)
        {
            if (!Win2000OrLater)
            {
                return(false);
            }
            Flashwinfo fi = Create_FLASHWINFO(process.MainWindowHandle, FLASHW_STOP, uint.MaxValue, 0);

            return(FlashWindowEx(ref fi));
        }
コード例 #4
0
 /// <summary>
 /// Flash the spacified Window (Form) until it recieves focus.
 /// </summary>
 /// <param name="form">The Form (Window) to Flash.</param>
 /// <returns></returns>
 public static bool Flash(Form form)
 {
     // Make sure we're running under Windows 2000 or later
     if (Win2000OrLater)
     {
         Flashwinfo fi = Create_FLASHWINFO(form.Handle, FLASHW_ALL | FLASHW_TIMERNOFG, uint.MaxValue, 0);
         return(FlashWindowEx(ref fi));
     }
     return(false);
 }
コード例 #5
0
        private static Flashwinfo Create_FLASHWINFO(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);
        }
コード例 #6
0
ファイル: FlashWindowHelper.cs プロジェクト: Khayde/slimCat
        /// <summary>
        ///     The stop flashing window.
        /// </summary>
        /// <param name="win">
        ///     The win.
        /// </param>
        public static void StopFlashingWindow(this Window win)
        {
            var h = new WindowInteropHelper(win);

            var info = new Flashwinfo {hwnd = h.Handle};
            info.cbSize = Convert.ToUInt32(Marshal.SizeOf(info));
            info.dwFlags = FlashwStop;
            info.uCount = uint.MaxValue;
            info.dwTimeout = 0;

            FlashWindowEx(ref info);
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: sboulema/FlashWindow
        private static void FlashWindow(IntPtr hWnd)
        {
            Flashwinfo fInfo = new Flashwinfo();

            fInfo.cbSize    = Convert.ToUInt32(Marshal.SizeOf(fInfo));
            fInfo.hwnd      = hWnd;
            fInfo.dwFlags   = FlashwAll;
            fInfo.uCount    = UInt32.MaxValue;
            fInfo.dwTimeout = 0;

            FlashWindowEx(ref fInfo);
        }
コード例 #8
0
ファイル: Program.cs プロジェクト: sboulema/FlashWindow
        private static void FlashWindow(IntPtr hWnd)
        {
            Flashwinfo fInfo = new Flashwinfo();

            fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo));
            fInfo.hwnd = hWnd;
            fInfo.dwFlags = FlashwAll;
            fInfo.uCount = UInt32.MaxValue;
            fInfo.dwTimeout = 0;

            FlashWindowEx(ref fInfo);
        }
コード例 #9
0
        public static void StopFlashingWindow(Window win)
        {
            var h    = new WindowInteropHelper(win);
            var info = new Flashwinfo {
                hwnd = h.Handle
            };

            info.cbSize    = Convert.ToUInt32(Marshal.SizeOf(info));
            info.dwFlags   = FlashwStop;
            info.uCount    = UInt32.MaxValue;
            info.dwTimeout = 0;
            FlashWindowEx(ref info);
        }
コード例 #10
0
ファイル: FlashWindowHelper.cs プロジェクト: Khayde/slimCat
        private const uint FlashwTray = 2; // Flash the taskbar button.

        #endregion Fields

        #region Methods

        /// <summary>
        ///     The flash window.
        /// </summary>
        /// <param name="win">
        ///     The win.
        /// </param>
        /// <param name="count">
        ///     The count.
        /// </param>
        public static void FlashWindow(this Window win, uint count = 5)
        {
            // Don't flash if the window is active
            if (win.IsActive)
                return;

            var h = new WindowInteropHelper(win);

            var info = new Flashwinfo
                {
                    hwnd = h.Handle,
                    dwFlags = FlashwAll | FlashwTimernofg,
                    uCount = count,
                    dwTimeout = 0
                };

            info.cbSize = Convert.ToUInt32(Marshal.SizeOf(info));
            FlashWindowEx(ref info);
        }
コード例 #11
0
        public static void Flash(Window win, UInt32 count = UInt32.MaxValue)
        {
            //Don't flash if the window is active
            if (win.WindowState == WindowState.Maximized)
            {
                return;
            }
            var h = new WindowInteropHelper(win);

            var info = new Flashwinfo
            {
                hwnd      = h.Handle,
                dwFlags   = FlashwAll | FlashwTimernofg,
                uCount    = count,
                dwTimeout = 0
            };

            info.cbSize = Convert.ToUInt32(Marshal.SizeOf(info));
            FlashWindowEx(ref info);
        }
コード例 #12
0
        /// <summary>
        ///     The flash window.
        /// </summary>
        /// <param name="win">
        ///     The win.
        /// </param>
        /// <param name="count">
        ///     The count.
        /// </param>
        public static void FlashWindow(this Window win, uint count = 5)
        {
            // Don't flash if the window is active
            if (win.IsActive)
            {
                return;
            }

            var h = new WindowInteropHelper(win);

            var info = new Flashwinfo
            {
                hwnd      = h.Handle,
                dwFlags   = FlashwAll | FlashwTimernofg,
                uCount    = count,
                dwTimeout = 0
            };

            info.cbSize = Convert.ToUInt32(Marshal.SizeOf(info));
            FlashWindowEx(ref info);
        }
コード例 #13
0
 private static extern bool FlashWindowEx(ref Flashwinfo pwfi);
コード例 #14
0
ファイル: FlashWindowHelper.cs プロジェクト: Khayde/slimCat
 private static extern bool FlashWindowEx(ref Flashwinfo pwfi);