SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
ShowWindow(Application.Handle, SW_RESTORE);
ShowWindow(Application.Handle, SW_HIDE);
procedure TfrmMain.SetNotifyIcon(bShow: boolean);
var
NotifyIcon: TNotifyIconData;
begin
NotifyIcon.cbSize := sizeof(NotifyIcon);
NotifyIcon.Wnd := self.Handle;
NotifyIcon.uCallbackMessage := Message_NotifyIcon;
NotifyIcon.uID := 0;
NotifyIcon.uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP;
NotifyIcon.hIcon := Application.Icon.Handle;
NotifyIcon.szTip := ''My Tools'';
if bShow then
Shell_NotifyIcon(NIM_ADD, @NotifyIcon)
else
Shell_NotifyIcon(NIM_DELETE, @NotifyIcon);
end;