Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1041675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:23:22+00:00 2026-05-16T15:23:22+00:00

Is it possible to trigger Windows’ flash the task bar button X times or

  • 0

Is it possible to trigger Windows’ “flash the task bar button X times or until the window comes to the foreground” behavior from a batch file? I’m trying to call the user’s attention to a long-running script upon completion.

Using an external program to trigger the flashing is fine, as long as it doesn’t require an install (i.e. the executable can be bundled with my scripts).

Update

Here’s what I ended up with (a minimalist port of Andreas’ Delphi code). I’ve compiled it under MinGW at it appears to be dependent only on KERNEL32.DLL and USER32.DLL, so should be highly portable.

Flashes three times, then stays highlighted until brought to the foreground.

#define WINVER 0x501
#define _WIN32_WINNT 0x501

#include <windows.h>

void main(int argc, char **argv) {
    FLASHWINFO info = { sizeof(info), GetConsoleWindow(), FLASHW_TIMERNOFG | FLASHW_TRAY, 3, 0 };

    FlashWindowEx(&info);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:23:23+00:00Added an answer on May 16, 2026 at 3:23 pm

    It is very easy to do using a very simple external *.exe. It simply has to call the FlashWindowEx function of the Windows API.

    This is a sample Delphi console application:

    program flashwnd;
    
    {$APPTYPE CONSOLE}
    
    uses
      SysUtils, Windows;
    
    var
      OldTitle, UniqueTitle: string;
      h: HWND;
      c: cardinal;
      fwi: TFlashWInfo;
    
    begin
    
      try
        h := GetConsoleWindow();
    
        c := 10;
        if ParamCount = 1 then
          c := StrToInt(ParamStr(1));
    
        FillChar(fwi, sizeof(fwi), 0);
        fwi.cbSize := sizeof(fwi);
        fwi.hwnd := h;
        fwi.dwFlags := FLASHW_ALL;
        fwi.uCount := c;
        fwi.dwTimeout := 0;
        FlashWindowEx(fwi);
      except
        on E: Exception do
          Writeln(E.ClassName + ': ' + E.Message);
      end;
    end.
    

    Simply call it like

    flashwnd
    

    to flash the current console window ten times. Call

    flashwnd 27
    

    to flash the window 27 times.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 512k
  • Answers 512k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Generally, the code that is executed at the beginning of… May 16, 2026 at 5:35 pm
  • Editorial Team
    Editorial Team added an answer if i use previous written code , i may take… May 16, 2026 at 5:35 pm
  • Editorial Team
    Editorial Team added an answer Your problem is algorithmic. What happens if two adjacent elements… May 16, 2026 at 5:35 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Is it possible to trigger an action in Windows Service, or is it possible
I think it's possible to somehow hook with the windows environment (specifically explorer.exe) and
Is there any way to programatically trigger global mediakeys in Windows using Java? I
I don't mind if it's only possible in the latest version of Windows, but
Is it possible to access and trigger the tab loading image within a Firefox
Is it possible to have a constraint/trigger on a record being entered that checks
Bamboo CI has a build in feature of having the subversion program trigger a
Possible Duplicate: VS2008 Setup Project: Shared (By All Users) Application Data Files? Please can
How can I trigger a stored procedure in SQL Server 2005 based on emails
I have a windows application which is published on a website and can be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.