Flashing in the TaskBar

The windows guidlines state ...

Rather than flashing the button continually, you can flash the window button
only a limited number of times (for example, three), then leave the button
in the highlighted state, as shown in Figure 11.2. This lets users know
there is still a pending message.


From what i have been able to gather, flashing itself is very easy (Just call the Flash method on the windows form.) 


To leave the button in the highlighted state, I resorted resorted to using the user32.dll method call FlashWindow() ... this was the code added ... 

using System.Runtime.InteropServices; 
[DllImport("user32.dll", CharSet = CharSet.Auto)] 
public static extern int FlashWindow(IntPtr hWnd, bool state);

These are the existing Flash methods in the windows form ... 

public void Flash();

public void Flash(int flashRate, FlashWindow flashWhat, bool continuousUntilActivated);


I propose a third

public void Flash(int flashRate, FlashWindow flashWhat, bool continuousUntilActivated, bool leaveHighlighted);

Note the last bool ... 






Answer this question

Flashing in the TaskBar

  • KarthikChennappan

    Thinking about the a little bit more ... I propose adding another argument ... flashTimes. I think this would then embody all that is needed. 

    public void Flash(int flashRate, int flashTimes, FlashWindow flashWhat, bool continuousUntilActivated, bool leaveHighlighted); 



  • vizca

    Hi can you please explain how you make the Title in the taskbar to flash. I dont understand what you have put so far. Thanks


  • Flashing in the TaskBar