I have a Delphi 2006 app that can minimize to a tray icon, and displays various alert messages via a balloon hint over the tray icon.
Under some circumstances - I don't know when - a previously displayed balloon hint keeps popping up and won't go away. It displays for the length of time programmed, closes, then immediately reappears.
It is always a balloon hint from this app.
If the app displays another balloon hint, that one shows for the programmed time, then the phantom hint resumes.
It is as if the hint is stuck in a queue somewhere and doesn't get removed. In absence of anyone with some inspiration (I realise it's a long shot...), does anyone know how to purge the balloon hints?
Which TrayIcon are you using? The TCustomTrayIcon in "Vcl.ExtCtrls" uses TNotifyIconData to send the Popup to the TrayIcon. Some properties require Windows Vista or later.
public
FData: TNotifyIconData; //Winapi.ShellAPI
procedure TCustomTrayIcon.ShowBalloonHint;
begin
FData.uFlags := FData.uFlags or NIF_INFO;
FData.dwInfoFlags := Cardinal(FBalloonFlags);
Shell_NotifyIcon(NIM_MODIFY, FData); //Refresh(NIM_MODIFY);
end;
You can see whats going on by handling messages send by the trayicon.
NIN_BALLOONSHOW = WM_USER + 2;
NIN_BALLOONHIDE = WM_USER + 3;
NIN_BALLOONTIMEOUT = WM_USER + 4;
NIN_BALLOONUSERCLICK = WM_USER + 5;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With