C # implementing Taskbar flicker

Source: Internet
Author: User
PRivate void Flashit ()
{
Flashwinfo fi = new Flashwinfo ();
Fi.cbsize = (UINT) System.Runtime.InteropServices.Marshal.SizeOf (FI);
Fi.hwnd = Handle;
Fi.dwflags = Flashw_tray;
Fi.ucount = 3;
fi.dwtimeout = 0;
FlashWindowEx (ref FI);

}


[DllImport ("User32.dll")]
[Return:marshalas (Unmanagedtype.bool)]
static extern bool FlashWindowEx (ref flashwinfo PWFI);

[StructLayout (LayoutKind.Sequential)]
public struct Flashwinfo
{
Public UInt32 cbsize;
Public INTPTR hwnd;
Public UInt32 dwFlags;
Public UInt32 Ucount;
Public UInt32 dwtimeout;

}


Stop flashing. The system restores the window to their original state.
Public Const UInt32 Flashw_stop = 0;
Flash the window caption.
Public Const UInt32 Flashw_caption = 1;
Flash the taskbar button.
Public Const UInt32 Flashw_tray = 2;
Flash both the window caption and taskbar button.
This was equivalent to setting the Flashw_caption | Flashw_tray flags.
Public Const UInt32 Flashw_all = 3;
Flash continuously, until the FLASHW_STOP flag is set.
Public Const UINT32 Flashw_timer = 4;
Flash continuously until the window comes to the foreground.
Public Const UInt32 FLASHW_TIMERNOFG = 12;

The above is the C # implementation of the task bar flashing content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.