Program Project1;Uses
Forms,
Windows,
Messages,
SysUtils;
{$R *.res}
Begin
{=================-start 隐藏主窗体=================}
If LowerCase(ParamStr(1)) = '-start' Then Begin
ShowWindow(Application.Handle, SW_HIDE);
Application.ShowMainForm := False;
End;
{===================================================}
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
End.
Aaaa
TForm1 = Class (tform)
Protected
Procedure WndProc (Var message:tmessage); Override;
End;
Procedure Tform1.wndproc (Var message:tmessage);
Begin
Case Message.msg of
Wm_syscommand:begin
Try
Case message. WParam of
Sc_close, Sc_minimize:begin
Cooltrayicon1.minimizetotray: = True;
Application.minimize;
End;
Else
Inherited WndProc (message);
End;
Except
On Eaccessviolation do;
End;
End;
End;
End;
Procedure tform1.formcreate (Sender:tobject);
Var
Dwstyle:dword;
Begin
{========== Sets the current form properties and does not appear on the taskbar =================}
Dwstyle: = GetWindowLong (Form1.handle,gwl_exstyle);
Dwstyle: =dwstyle or Ws_ex_toolwindow;
SetWindowLong (Application.handle,gwl_exstyle,dwstyle);
{=======================================================}
End;