unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
Procedure CreateParams(Var Params: TCreateParams); Override;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
uses unit2;
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.Show;
end;
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
with Params do
begin
exStyle := exStyle or WS_EX_APPWINDOW;
WndParent := 0;
end;
end;
end.
----------------------------------------------
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm2 = class(TForm)
private
{ Private declarations }
Procedure CreateParams(Var Params: TCreateParams); Override;
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.DFM}
{ TForm2 }
procedure TForm2.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
with Params do
begin
exStyle := exStyle or WS_EX_APPWINDOW;
WndParent := 0;
end;
end;
end.
-------------------------
program Project1;
uses
Windows,
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2};
{$R *.RES}
begin
Application.Initialize;
SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.Run;
end.
-------------------------------------
工程文件这样改,把工程的窗口隐藏!