[Lazarus] Flashing task bat icon orange on Windows 7

Michael Van Ham michael.vanham at gmail.com
Sat Jun 13 15:04:37 CEST 2015


On Fri, Jun 12, 2015 at 4:25 PM, Richard Mace <richard.mace at gmail.com>
wrote:

> ​Hi,
> I am trying to work out how to flash the taskbar icon in Windows 7, like
> Skype does, pragmatically. I have googled, and the closest I found was
> FlashWindowEx, but that doesn't actually flash the icon, just the form
> window.
>


If your app is not the foreground app, SetForegroundWindow will flash the
taskbar icon.

On a new project, drop a TTimer, paste this, run, and minimize your app.


procedure TForm1.Timer1Timer(Sender: TObject);
begin
  SetForegroundWindow(Form1.Handle);
end;


see msdn:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms633539(v=vs.85).aspx

"An application cannot force a window to the foreground while the user is
working with another window. Instead, Windows flashes the taskbar button of
the window to notify the user."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150613/e54762f1/attachment-0003.html>


More information about the Lazarus mailing list