I am writing a program in Delphi that displays fresh information in balloons.
Is there a way to determine which balloon I clicked on?
Like this:
sendername := 'Gert';
TrayIcon1.Visible := True;
TrayIcon1.BalloonHint := 'You got a new message from '+sendername+'!';
TrayIcon1.ShowBalloonHint;
...
sendername := 'Peter';
TrayIcon1.Visible := True;
TrayIcon1.BalloonHint := 'You got a new message from '+sendername+'!';
TrayIcon1.ShowBalloonHint;
Now I would like to show the related letter in a BalloonClick event, but how can I determine which one was clicked?
Your question seems to imply that multiple balloons can be displayed by a single TTrayIcon component. That is not the case. There is only one balloon, and the text of the balloon will contain whatever you last assigned to BalloonHint.
So in your case, the sendername variable will contain the name that is currently being shown in the balloon.