//uses shellapi; procedure TForm1.FormCreate(Sender: TObject); begin //如果我没有猜错的话,你是想让窗体(form)在屏幕上显示而在任务栏不显示,下面代码可以实现 setwindowlong(application.handle,GWL_EXSTYLE,getwindowlong(application.Handle,GWL_EXSTYLE) or WS_EX_TOOLWINDOW); end;
在DPR中(你可更改Form的Name,这里假设为TPasskiller) var ES:integer; begin Application.Initialize; ES:=GetWindowLong(Application.Handle,GWL_EXSTYLE); ES:=ES or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW; SetWindowLong(Application.Handle,GWL_EXSTYLE,ES); Application.CreateForm(TPassKiller, PassKiller); Application.Run; end.完全符合你的要求!
procedure TForm1.FormCreate(Sender: TObject); begin setwindowlong(application.handle,-20,getwindowlong (application.Handle,-20) or $80);//只要這句就行了end;
你直接将form去掉或者hide不就行了?
在application.run;前加
application.showmainform :=false;
procedure TForm1.FormCreate(Sender: TObject);
begin
//如果我没有猜错的话,你是想让窗体(form)在屏幕上显示而在任务栏不显示,下面代码可以实现
setwindowlong(application.handle,GWL_EXSTYLE,getwindowlong(application.Handle,GWL_EXSTYLE) or WS_EX_TOOLWINDOW);
end;
var
ES:integer;
begin
Application.Initialize;
ES:=GetWindowLong(Application.Handle,GWL_EXSTYLE);
ES:=ES or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW;
SetWindowLong(Application.Handle,GWL_EXSTYLE,ES);
Application.CreateForm(TPassKiller, PassKiller);
Application.Run;
end.完全符合你的要求!
begin
setwindowlong(application.handle,-20,getwindowlong
(application.Handle,-20) or $80);//只要這句就行了end;