Lazarus

Programming => LCL => Topic started by: jw on April 16, 2010, 10:30:12 pm

Title: system tray balloon notification
Post by: jw on April 16, 2010, 10:30:12 pm
useing windows xp


I can't seem to get the balloon notification function of ttryicon to appear.


I can get a left click to bring up a menu
a hover brings up the hint but it's always behind the task bar
with a right click I'd like to bring up the balloon tip but right now I can only do things like the trayicon example
does bring up a dialog etc.


1) Is there a way to get the hint to appear in front of the taskbar?
2) how to I call the built in balloon tip in ttrayicon?

 
Title: Re: system tray balloon notification
Post by: jw on April 17, 2010, 01:20:14 am

1) to get the balloon tip to fire use the command ttrayicon.showballoonhint; you will have to program your own timer to get the balloon to close as there's a known bug in the lcl

here's a code snip....


procedure Tform.systrayClick(Sender: TObject);
begin
if systray_click = true then
   begin

     systray_click := false;
     systray.showballoonhint;
     systray_balloon_timer.enabled := true;

   end;

end;



procedure Tform.systray_balloon_timerTimer(Sender: TObject);
begin

     systray.visible:=false;
     systray.visible:=true;
     systray_click := true;
     systray_balloon_timer.enabled := false;

end;             


2)to get the hints from behind the toolbar I cheated and did this

ttrayicon..hint := 'my ultra cool hint' + chr(13) + chr (10);

that raised the hint above the taskbar from behind it.
TinyPortal © 2005-2018