Search code examples
delphidelphi-xe8trayicon

TrayIcon doesn't show notification


I use this code to show a TrayIcon it works and the TrayIcon appears in the Systray but it doesn't show the BalloonHint; I tried to change some setting but it still doesn't show the notification

procedure TMainForm.FormCreate(Sender: TObject);
begin
  TrayIcon1.Hint := 'Hint';
  TrayIcon1.AnimateInterval := 200;
  TrayIcon1.BalloonTitle := 'Hint';
  TrayIcon1.BalloonHint := 'Double click to restore Application';
  TrayIcon1.BalloonFlags := bfInfo;
end;

procedure TMainForm.ApplicationEvents1Minimize(Sender: TObject);
begin
  Hide();
  WindowState := wsMinimized;
  TrayIcon1.Visible := True;
  TrayIcon1.Animate := True;
  TrayIcon1.ShowBalloonHint;
end;

procedure TMainForm.TrayIcon1DblClick(Sender: TObject);
begin
  TrayIcon1.Visible := False;
  Show();
  WindowState := wsNormal;
  Application.BringToFront();
end;

what is wrong with this code?


The project is originally written in Delphi7 and now upgraded to DelphiXE8.


Solution

  • There is no problem with the code, it looks windows problem
    Reinstall windows fixed it