Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Flashing in the taskbar
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00949364
Message ID:
00949433
Views:
14
This message has been marked as the solution to the initial question of the thread.
Hi Stephen,

Here is sample code to do this:
public const int FLASHW_STOP = 0;
public const int FLASHW_CAPTION = 0x00000001;
public const int FLASHW_TRAY = 0x00000002;
public const int FLASHW_ALL = (FLASHW_CAPTION | FLASHW_TRAY);
public const int FLASHW_TIMER = 0x00000004;
public const int FLASHW_TIMERNOFG = 0x0000000C;

[StructLayout(LayoutKind.Sequential)]
	public struct FLASHWINFO
{
	[MarshalAs(UnmanagedType.U4)]
	public int cbSize;
	public IntPtr hwnd;
	[MarshalAs(UnmanagedType.U4)]
	public int dwFlags;
	[MarshalAs(UnmanagedType.U4)]
	public int uCount;
	[MarshalAs(UnmanagedType.U4)]
	public int dwTimeout;
}

[DllImport("user32.dll")]
public static extern bool FlashWindowEx([MarshalAs(UnmanagedType.Struct)]
	ref FLASHWINFO pfwi);

private void button1_Click(object sender, System.EventArgs e)
{
	FLASHWINFO f = new FLASHWINFO(); 
	f.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(FLASHWINFO) );
	f.hwnd = this.Handle;

	f.dwFlags = FLASHW_ALL;   // FLASH_ALL
	f.uCount = 10;  // FLASH 10 times.
	f.dwTimeout = 0;   // Use default cursor blink rate.
	FlashWindowEx(ref f);
}
>Does anyone know how to make a winform's taskbar item flashes? For example, when a message comes into my MSN Messager, the message window showup minimized but the taskbar icon flashes.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform