Exemple #1
0
        /// <summary>
        /// Flashes the console window
        /// </summary>
        /// <param name="once">if off, flashes repeated until the user makes the console foreground</param>
        public void Flash(bool once)
        {
            IntPtr hwnd = LoggerUtils.GetConsoleWindow();

            if (hwnd == IntPtr.Zero)
            {
                return;
            }

            int style = LoggerUtils.GetWindowLong(hwnd, LoggerUtils.GWL_STYLE);

            if ((style & LoggerUtils.WS_CAPTION) == 0)
            {
                return;
            }

            FlashWInfo info = new FlashWInfo();

            info.Size  = Marshal.SizeOf(typeof(FlashWInfo));
            info.Flags = LoggerUtils.FLASHW_ALL;
            if (!once)
            {
                info.Flags |= LoggerUtils.FLASHW_TIMERNOFG;
            }
            LoggerUtils.FlashWindowEx(ref info);
        }
Exemple #2
0
        private static FlashWInfo Create_FLASHWINFO(IntPtr handle, uint flags, uint count, uint timeout)
        {
            var fi = new FlashWInfo();

            fi.cbSize    = Convert.ToUInt32(Marshal.SizeOf(fi));
            fi.hwnd      = handle;
            fi.dwFlags   = flags;
            fi.uCount    = count;
            fi.dwTimeout = timeout;
            return(fi);
        }
        public void RequestUserAttention()
        {
            if (Application.Current.MainWindow == null)
            {
                return;
            }

            var interop = new WindowInteropHelper(Application.Current.MainWindow);
            var info    = new FlashWInfo
            {
                hwnd      = interop.Handle,
                dwFlags   = FlashFlags.Tray | FlashFlags.TimerNoForeground,
                uCount    = uint.MaxValue,
                dwTimeout = 0,
                cbSize    = (uint)Marshal.SizeOf <FlashWInfo>()
            };

            FlashWindowEx(ref info);
        }
Exemple #4
0
        /// <summary>
        /// Flashes the console window
        /// </summary>
        /// <param name="once">if off, flashes repeated until the user makes the console foreground</param>
        public static void Flash(bool once)
        {
            IntPtr hwnd = GetConsoleWindow();

            if (hwnd == IntPtr.Zero)
            {
                return;
            }

//			int style = GetWindowLong(hwnd, GWL_STYLE);
//			if ((style & WS_CAPTION)==0)
//				return;

            FlashWInfo info = new FlashWInfo();

            info.Size  = Marshal.SizeOf(typeof(FlashWInfo));
            info.Flags = FLASHW_ALL;
            if (!once)
            {
                info.Flags |= FLASHW_TIMERNOFG;
            }
            FlashWindowEx(ref info);
        }
Exemple #5
0
 private static extern bool FlashWindowEx(ref FlashWInfo pwfi);
Exemple #6
0
 public static extern int FlashWindowEx(ref FlashWInfo fwi);
Exemple #7
0
 static extern void FlashWindowEx(ref FlashWInfo info);
Exemple #8
0
        /// <summary>
        /// Flashes the console window
        /// </summary>
        /// <param name="once">if off, flashes repeated until the user makes the console foreground</param>
        public static void Flash(bool once)
        {
            IntPtr hwnd = GetConsoleWindow();
            if (hwnd == IntPtr.Zero)
                return;

            int style = GetWindowLong(hwnd, GWL_STYLE);
            if ((style & WS_CAPTION) == 0)
                return;

            FlashWInfo info = new FlashWInfo();
            info.Size = Marshal.SizeOf(typeof(FlashWInfo));
            info.Flags = FLASHW_ALL;
            if (!once) info.Flags |= FLASHW_TIMERNOFG;
            FlashWindowEx(ref info);
        }
Exemple #9
0
 static extern void FlashWindowEx(ref FlashWInfo info);
Exemple #10
0
 private static extern bool FlashWindowEx(ref FlashWInfo pwfi);
Exemple #11
0
 private static FlashWInfo Create_FLASHWINFO(IntPtr handle, uint flags, uint count, uint timeout)
 {
     var fi = new FlashWInfo();
     fi.cbSize = Convert.ToUInt32(Marshal.SizeOf(fi));
     fi.hwnd = handle;
     fi.dwFlags = flags;
     fi.uCount = count;
     fi.dwTimeout = timeout;
     return fi;
 }