I Wanted to test interface ITrayIcons I used example codes:
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
//This MessageBox display text "we have 0 tray icons"
MessageBox(0, pchar('we have ' + IntToStr(TrayIcons.ItemCount) + ' tray icons'), 'info', 0);
//This MessageBox is empty
MessageBox(0, pchar(TrayIcons[0].Window.OwnerProcess.ExeFile), 'the first tray icon belongs to', 0);
//This MessageBox display text ""
MessageBox(0, pchar('"' + TrayIcons[0].Hint + '"'), 'the first tray icon''s hint is', 0);
//This do not work
with TrayIcons[0] do begin
Hide;
MessageBox(0, 'first tray icon is temporarily hidden now', 'info', 0);
Show;
end;
end;
I ask help me