我问过这个问题在写UU的时候。已经解决。代码如下。记得给分啊
unit intask2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, TB2MDI;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
procedure Createparams(var params: TCreateParams); override;
procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses intask;
{$R *.dfm}
{ TForm1 }
procedure TForm1.Createparams(var params: TCreateParams);
begin
inherited CreateParams(Params);
Params.ExStyle := WS_EX_APPWINDOW;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
with Tform2.Create(self) do show;
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
beep;
showWindow(application.Handle,SW_HIDE);
end;
procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
begin
with Message do
begin
beep;
if (CmdType and $FFF0 = SC_MINIMIZE) and (Application.MainForm = Self) then
self.WindowState:=WsMinimized// Application.WndProc(TMessage(Message))
else if (CmdType and $FFF0 <> SC_MOVE) or (csDesigning in ComponentState) or
(Align = alNone) or (WindowState = wsMinimized) then
inherited;
if ((CmdType and $FFF0 = SC_MINIMIZE) or (CmdType and $FFF0 = SC_RESTORE)) and
not (csDesigning in ComponentState) and (Align <> alNone) then
RequestAlign;
end;
end;
end.
*************************
unit intask;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
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);
Params.ExStyle := WS_EX_APPWINDOW;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
showmessage('dsdfsdfs');
end;
end.