Sorry for the late reply. I've already added an example to the documentation, but the current online docs is equivalent to the "master" branch (last stable released branch), and not the more up-to-date "maint" or "develop" branches.
Anyway, add the following code to your main form's
AfterCreate() method.
pmTray := TfpgPopupMenu.Create(self);
with pmTray do
begin
Name := 'pmTray';
SetPosition(256, 128, 120, 20);
AddMenuItem('Start Timer...', '', nil);
AddMenuItem('Stop Timer...', '', nil);
AddMenuItem('-', '', nil);
AddMenuItem('Show Form', '', @miShowFormClicked);
AddMenuItem('-', '', nil);
AddMenuItem('Quit', '', @miFileQuitClicked);
end;
TrayIcon := TfpgSystemTrayIcon.Create(self);
with TrayIcon do
begin
Name := 'TrayIcon';
SetPosition(256, 240, 20, 20);
PopupMenu := pmTray;
ImageName := 'stdimg.folderhome';
end;
You define a popup menu, which in turn you will assign to the
PopupMenu property of the systemtray component. There are a couple of properties you can adjust to configure the systemtray appearance.