I am developing an application that controls a machine.
When I get an error message from the machine, users should be able to immediately notice it, one way to do this is to blink the tray on the taskbar. When the machine clears the error, the tray should stop flashing.
There is one slight annoyance using the FlashWindowEx function, when I clear the window flicker, it remains (in my case winXP) orange (does not blink).

[Flags]
public enum FlashMode {
FLASHW_STOP = 0,
FLASHW_CAPTION = 1,
FLASHW_TRAY = 2,
FLASHW_ALL = 3,
FLASHW_TIMER = 4,
FLASHW_TIMERNOFG = 12
}
public static bool FlashWindowEx(IntPtr hWnd, FlashMode fm) {
FLASHWINFO fInfo = new FLASHWINFO();
fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo));
fInfo.hwnd = hWnd;
fInfo.dwFlags = (UInt32)fm;
fInfo.uCount = UInt32.MaxValue;
fInfo.dwTimeout = 0;
return FlashWindowEx(ref fInfo);
}
[StructLayout(LayoutKind.Sequential)]
public struct FLASHWINFO {
public UInt32 cbSize;
public IntPtr hwnd;
public UInt32 dwFlags;
public UInt32 uCount;
public UInt32 dwTimeout;
}
In my case, I use FLASHW_TRAY to start blinking and FLASHW_STOP to stop blinking.
Am I doing something wrong or is this a known WinXP error and is there a fix for it?