Delphi TTrayIcon baloonhint misbehaves when triggered twice

68 Views Asked by At

Let's say I display baloonhint "A". While it's still showing, I would like to update to a new state.

As described in other articles like Close TrayIcon Balloon Programmatically , I cancel the old ballonhint by setting

TrayIcon1.BalloonHint := '';

When I then trigger a new ShowBaloonHint with a different text "B", the system completely misbehaves.

To reproduce use the following code and click on one button after another:

procedure TForm1.Button1Click(Sender: TObject);
begin
     TrayIcon1.BalloonHint := 'AAA';
     TrayIcon1.ShowBalloonHint;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
     TrayIcon1.BalloonHint := '';
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
     TrayIcon1.BalloonHint := 'New state';
     TrayIcon1.ShowBalloonHint;
end;
  1. The "AAA" baloon pops up
  2. Then ballonhint is removed.
  3. First the "New state" ballon shows up, but without the required icon. Then after the standard timeout this wrong windows disappears and the new expected hint WITH the icon pops up again.

This behaviour is identically for Delphi11 and Delphi2010.

0

There are 0 best solutions below