views:

3264

answers:

4

I know I can programatically make the taskbar item for a particular window start flashing when something changes, but is there any way I can stop it from flashing either programatically after a certain period of time or at least is there a keyboard shortcur I can give to my users to somehow stop the flashing?

+3  A: 

The FlashWindowEx function which controls the flashing takes a FLASHWINFO struct which has a uCount field to control how many times it flashes. Also, a possible value for the dwFlags field is FLASHW_STOP to cause the flashing to stop.

EDIT: Forgot was a C# tagged question ... so P/Invoke goodness found here.

imaginaryboy
+1  A: 

I would prefer programmers didn't do this. I find a flashing taskbar to be very disturbing and annoying when I am in the zone doing something else.

Thomas Eyde
+1  A: 

@thomas -- Amazingly Microsoft's own Windows Vista User Experience Guidelines agree with you ...

While having a background window flash its taskbar button is better than having it automatically come to the top and steal input focus, flashing taskbar buttons are still very intrusive. It is hard for users to concentrate when a taskbar button is flashing, so you should assume that users will immediately stop what they are doing to make the flashing stop. Consequently, reserve taskbar flashing only for situations where immediate attention is required.

Of course who knows who actually follows those guidelines ... or who even reads them. :)

imaginaryboy
+2  A: 

Instead of flashing the tasbar you can consider using the NotifyIcon. This will let you put something on the system tray (something else many consider evil because of the proliferation of apps that do this). Then you can popup a ballon tip with any change that actually describes the change itself.

To use: (1) Drag the NotifyIcon onto your form or create in your app NotifyIcon notify = new NotifyIcon(); (2) Set the icon property to the required image (3) Control whether it is visible on the system tray using the Visible property (4) Call ShowBalloonText to show popup text (limited to 64 characters)

Either way, you shoudl add an option to the program that allows the end user to turn this feature on/off based on their feelings about it all. I personally like the notify icon because the ballon text can say something like "Server went down"

Marcus Erickson