domingo, 1 de julho de 2007

I've found a litle time today to post an litle article about the ttrayicon component that came with Delphi.

There are some samples that you can found it on the web, but all those I've have seen has a litle problem when you minimize and restore your app. The problem is that it stays two titles of your application on the start menu bar.

So lets do the job.

On onClick event of your TTrayIcon put the follow code:

Self.Show; //comment this line if your D2007 doesnt have update 1application.Restore;

Drop an TApplicationEvents on your form and put the follow code on OnMinimize event of your TApplicationEvents component.