problems with ITrayIcons.Hide !!!

delphi package - easy access to kernel objects etc.
Post Reply
Jay
Posts: 13
Joined: Thu Apr 29, 2004 9:34 am

problems with ITrayIcons.Hide !!!

Post by Jay »

hello!

ITrayIcons.Hide only works when i call a MessageBox after that function.

Code: Select all

Name := 'program.exe';
Process( Name).TrayIcons.Hide;
MessageBox(0, pchar('"' + Process( Name).Exefile + '"'), '', 0);
Process( Name).TrayIcons.Show;
can you tell me why ? ... and an alternative way to use ITrayIcons.Hide without a MessageBox ?

thanx.


Jay
Jay
Posts: 13
Joined: Thu Apr 29, 2004 9:34 am

Post by Jay »

ok. sorry for this stupid post. i read your help about ITrayIcons.
there it is written that the visibility is only changed temporarily.
You can access the visibility change of the tray icons by using the following methods. A hidden tray icon is automatically shown again in the moment when the ITrayIcon instance gets freed. That means the visibility is only changed temporarily.
but is it possible to hide/delete a trayicon and show it after a certain time again ?

thanx.


Jay
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

It's possible, you just need to make sure that the ITrayIcon instance for which you called "Hide" doesn't get destroyed. That means, you need to store it in a global variable or list or something like that.
Jay
Posts: 13
Joined: Thu Apr 29, 2004 9:34 am

Post by Jay »

thank you. it works.


kind regards,

Jay
Post Reply