Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        public static bool FlashWindowStop(WinForms.Form form)
        {
            FlashWindowInfo info = new FlashWindowInfo();

            info.cbSize    = 20;
            info.dwFlags   = 0;           // FLASHW_STOP
            info.dwTimeout = 0;
            info.hwnd      = form.Handle;
            info.uCount    = 0;

            return(FlashWindowEx(ref info));
        }
Beispiel #2
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));
        }
Beispiel #3
0
        public void Flash(FlashFlags flags, int count, int timeout = 0)
        {
            FlashWindowInfo fwi = new FlashWindowInfo();

            fwi.cbSize    = (uint)Marshal.SizeOf(fwi);
            fwi.dwFlags   = flags;
            fwi.uCount    = (uint)count;
            fwi.dwTimeout = (uint)timeout;
            fwi.hwnd      = Hwnd;
            IntPtr ptr = Marshal.AllocHGlobal((int)fwi.cbSize);

            Marshal.StructureToPtr(fwi, ptr, false);
            FlashWindowEx(ptr);
            Marshal.FreeHGlobal(ptr);
        }
Beispiel #4
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));
        }
Beispiel #5
0
 public static extern bool FlashWindowEx(ref FlashWindowInfo pwfi);
 private static extern bool FlashWindowEx(ref FlashWindowInfo info);
        /// <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>
        /// 
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        public static bool FlashWindowStop(WinForms.Form form)
        {
            FlashWindowInfo info = new FlashWindowInfo();

            info.cbSize = 20;
            info.dwFlags = 0; // FLASHW_STOP
            info.dwTimeout = 0;
            info.hwnd = form.Handle;
            info.uCount = 0;

            return FlashWindowEx(ref info);
        }
        /// <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);
        }
Beispiel #10
0
 public static extern int FlashWindowEx([In] FlashWindowInfo fwiInfo);
Beispiel #11
0
 private static extern bool FlashWindowEx(ref FlashWindowInfo info);