I am new to Delphi with experience in interpreted languages like Perl + PHP and have little-to-none experience in compiled langauges.
I am trying to send an MDI parent form with several child forms to tray.
Here is the code I have so far:
...
private
TrayIconData: TNotifyIconData;
...
procedure TMainForm.SendtoTray();
begin
with TrayIconData do
begin
cbSize := SizeOf(TrayIconData);
Wnd := Handle;
uID := 0;
uFlags := NIF_MESSAGE + NIF_ICON + NIF_TIP;
uCallbackMessage := WM_ICONTRAY;
hIcon := Application.Icon.Handle;
StrPCopy(szTip, Application.Title);
end;
Shell_NotifyIcon(NIM_ADD, @TrayIconData);
MainForm.Hide;
end;
but if MainForm has a child form, the application seems to just minimize to taskbar and create an icon in the tray.
TIA
I am trying to send an MDI parent form with several child forms to tray.
Here is the code I have so far:
...
private
TrayIconData: TNotifyIconData;
...
procedure TMainForm.SendtoTray();
begin
with TrayIconData do
begin
cbSize := SizeOf(TrayIconData);
Wnd := Handle;
uID := 0;
uFlags := NIF_MESSAGE + NIF_ICON + NIF_TIP;
uCallbackMessage := WM_ICONTRAY;
hIcon := Application.Icon.Handle;
StrPCopy(szTip, Application.Title);
end;
Shell_NotifyIcon(NIM_ADD, @TrayIconData);
MainForm.Hide;
end;
but if MainForm has a child form, the application seems to just minimize to taskbar and create an icon in the tray.
TIA