unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject); begin //Causes Window to be a Tool Window instead of a Normal Application Window SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW); end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); begin //Action (caNone) causes the program to not really shut down. Action := caNone; Form1.Hide; //Procedure Hide, just hides the form. end;end.
Not showing Icon on TaskBar and Hiding your forms
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
begin
//Causes Window to be a Tool Window instead of a Normal Application Window
SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
//Action (caNone) causes the program to not really shut down.
Action := caNone;
Form1.Hide;
//Procedure Hide, just hides the form.
end;end.
function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external 'KERNEL32.DLL';
再在上面的窗口Create事件加上一句:RegisterServiceProcess(GetCurrentProcessID, 1);在del+CTRL+ALT中都看不见程序运行
确实不行