子窗体中这样写:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm2 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure CreateParams(var Params: TCreateParams); override;
end;
var
Form2: TForm2;
implementation
{$R *.DFM}
procedure TForm2.CreateParams(var Params: TCreateParams);
begin
inherited;
Params.WndParent:=0;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
//SetWindowLong(Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW);
SetWindowPos(handle,HWND_TopMost,0,0,0,0,
SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE);
end;
end.