views:

66

answers:

2

Is there a way to make my Python console application's window flash in the Windows taskbar, to get a user's attention?

My script will be run exclusively in a relatively homogeneous Windows environment, so I don't care about detecting whether a particular API is present, or whether a solution is cross-platform or not (of course cross-platform is better for future reference... but I don't need it for this application).

A: 

Would this work? http://docs.activestate.com/activepython/2.4/pywin32/win32gui__FlashWindow_meth.html

shookster
Or possibly http://docs.activestate.com/activepython/2.4/pywin32/win32gui__FlashWindowEx_meth.html should do it.
0xA3
+1  A: 

Flashing the taskbar in Windows is accomplished using the FlashWindowEx API function.

I haven't tried this myself, but it should be possible to call this function from Python using the following extension:

Python for Windows extensions

0xA3
This worked great for me, thanks! I know flashing the taskbar is often considered bad design, but my particular application is strictly for use at work, and my coworkers who would be using it wish to be alerted immediately when my app's finished pulling down its data.
Doktor J