program HellSystemTray;


uses
  Forms, Controls, Dialogs, ShellApi, Windows, tray in 'tray.pas' {Form1};

{$R *.RES}
var
  NotifyIconData : TNotifyIconData;
begin
  Application.Initialize;
  Application.ShowMainForm := False;
  Application.Title := 'HellSystemTray';
  Application.CreateForm(TForm1, Form1);
  NotifyIconData.cbSize := SizeOf( NotifyIconData );
  NotifyIconData.Wnd    := Form1.Handle;
  NotifyIconData.uCallbackMessage := WM_ShellIcon;
  NotifyIconData.hIcon  := Application.Icon.Handle;
  NotifyIconData.szTip  := 'Hell System Tray';
  NotifyIconData.uFlags := NIF_TIP + NIF_MESSAGE + NIF_ICON;
  try
    Shell_NotifyIcon( NIM_ADD, @NotifyIconData );
    ShowWindow(Application.Handle, SW_HIDE);
    Application.Run;
  finally
    Shell_NotifyIcon( NIM_DELETE, @NotifyIconData );
  end;
end.

