Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-06

Flashing task bat icon orange on Windows 7

5 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

K. P.
to Richard Mace

I have no clue how they do this - but would suspect that they might cycle through a number of images based on a timer

Date: Fri, 12 Jun 2015 21:25:02 +0100
From:
To:
Subject: [Lazarus] Flashing task bat icon orange on Windows 7

?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. Any ideas?
Thanks
Richard?

Reply by email

Simon Ameis
to Richard Mace: I am trying to work out how to flash the taskbar icon in Windows 7, like Skype does,…

You'll need the taskbar's handle which you can get from WidgetSet.AppHandle.

uses JwaWindows, InterfaceBase;
procedure TForm1.Button1Click(Sender: TObject);
var
  i: FLASH_INFO;
begin
  i.cbSize := sizeof(i);
  i.hwnd := WidgetSet.AppHandle;
  i.dwFlags := FLASHW_TRAY or FLASHW_TIMERNOFG;
  i.uCount := 0;
  i.dwTimeout := 0;
  FlashWindowEx(i);
end;
Richard Mace wrote 18 lines
?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. Any ideas? Thanks Richard? -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150613/a11059a2/attachment.html>

Reply by email

Michael Van Ham
to Richard Mace: I am trying to work out how to flash the taskbar icon in Windows 7, like Skype does,…
Richard Mace wrote 6 lines
?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.freepascal.org/pipermail/lazarus/attachments/20150613/e54762f1/attachment.html>

Reply by email