Note that there are some explanatory texts on larger screens.

plurals
  1. POFlashWindowEx FLASHW_STOP still keeps taskbar colored
    text
    copied!<p>I am developing an application that controls an Machine.<br/> When I receive an error from the Machine the users should be able to directly notice it, one way that is done is Flashing the tray on the taskbar. When the machine clears the error the tray should stop flashing.</p> <p>There's one little annoyance using the FlashWindowEx function, when I clear the flashing of the window, it stays (in my case winXP) orange (not flashing).<br/> <img src="https://i.stack.imgur.com/GOS2r.gif" alt="Sample of status"/></p> <pre><code> [Flags] public enum FlashMode { /// /// Stop flashing. The system restores the window to its original state. /// FLASHW_STOP = 0, /// /// Flash the window caption. /// FLASHW_CAPTION = 1, /// /// Flash the taskbar button. /// FLASHW_TRAY = 2, /// /// Flash both the window caption and taskbar button. /// This is equivalent to setting the FLASHW_CAPTION | FLASHW_TRAY flags. /// FLASHW_ALL = 3, /// /// Flash continuously, until the FLASHW_STOP flag is set. /// FLASHW_TIMER = 4, /// /// Flash continuously until the window comes to the foreground. /// 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; } </code></pre> <p>In my case I use FLASHW_TRAY to start flashing and FLASHW_STOP to stop the flashing.</p> <p>Am I doing something wrong or is this a known bug of WinXP and is there a fix for it?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload