FlashConsoleWindow

Flashes the console window entry in the taskbar and changes the integrated progress bar (Windows Vista+).

The problem

Batch or PowerShell scripts and other console applications sometimes do tasks that take a long time. But you don’t want to watch their output for minutes only to know when it’s done. Often you could barely recognise the current progress anyway. Build and packaging scripts for example generate a lot of lines very quickly and most of them are of little use. Moreover, the simple printing of those lines to the screen slows down the process. Then again, if the window is minimised you won’t see anything until the window suddenly closes after a while or just sits there waiting for a final user confirmation.

The solution

Instead of reading the console window output, the current state is easier to see directly on the taskbar item. Windows itself does not offer any tools to use these light effects from batch or PowerShell scripts. They’re only available through Windows API calls. This little program fills the gap. It flashes the taskbar entry of the console window it was called from, and also sets the integrated progress display from Windows Vista on. So you can tell at a glance whether the script is waiting for user input, how far it currently is or when a problem has occured.

To make use of any of this, the program must of course be called from the console script at suitable times. This call is very easy and simple though. Call the program without parameters to have the taskbar entry flash until the window is reactivated (gets the focus). (Nothing happens if the window was already active at that time.) To stop the flashing prematurely, just call FlashConsoleWindow -noflash. Call FlashConsoleWindow -progress 35 to set the progress bar to 35 %. FlashConsoleWindow -error changes the progress colour to red and FlashConsoleWindow -noprogress hides the progress bar altogether. -h or /? lists all supported parameters. The progress bar features are only available in Windows Vista, Windows 7 and Windows 8. On Windows XP, nothing will happen, just plain old flashing is supported here.

Compatibility: Windows 10 Windows 8 Windows 7 Windows XP 64 bit

Download

FlashConsoleWindow.exe12.5 KiBProgram file

master.zipLatest source code directly from GitHub (Visual C++ 2010)

There’s a public Git repository of FlashConsoleWindow on GitHub.

Licence and terms of use

This software is released under the terms of the simplified BSD licence. You can find the detailed terms and conditions in the download.

Statistic data

  • Created on 2013-02-24, updated on 2015-03-27.
  • Ca. 210 lines of code, estimated development costs: 210 - 840 €