G
go2
Unregistered / Unconfirmed
GUEST, unregistred user!
以下是我的代码<br>///////////form1 start<br>unit Uflatwin1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br> StdCtrls;<br><br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> Button2: TButton;<br> procedure Button1Click(Sender: TObject);<br> procedure Button2Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>uses Uflatwin, Uflatwin2;<br><br>{$R *.DFM}<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> form2.show;<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>begin<br> form3.showmodal;<br>end;<br><br>end.<br><br>/////////form1 end<br><br>/////////////////form2 start///////////<br>unit Uflatwin;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,<br> StdCtrls;<br><br>type<br> TForm2 = class(TForm)<br> Button1: TButton;<br> procedure Button1Click(Sender: TObject);<br> private<br> { Private declarations }<br> procedure WMNCHITTEST(var Message:TMessage);Message WM_NCHITTEST;<br><br> public<br> { Public declarations }<br> protected<br> procedure CreateParams(var Params: TCreateParams);override;<br> end;<br><br>var<br> Form2: TForm2;<br><br>implementation<br><br>{$R *.DFM}<br>Procedure TForm2.CreateParams(var Params:TCreateParams);<br>begin<br> inherited CreateParams(Params);<br> if BorderStyle = bsNone then<br> with Params do<br> begin<br> Style:= Style or WS_POPUP;<br> EXStyle:=ExStyle or WS_EX_TOPMOST or WS_EX_ACCEPTFILES or WS_DLGFRAME;<br> WndParent:=GetDesktopWindow();<br> end;<br>end;<br><br>procedure TForm2.Button1Click(Sender: TObject);<br>begin<br>close;<br>end;<br><br>procedure TForm2.WMNCHITTEST(var Message:TMessage);<br>begin<br> inherited;<br> if Message.Result = htClient then<br> Message.Result := htCaption;<br>end;<br><br>end.<br>/////////////////form2 end////<br><br><br>//////form3 start////<br>unit Uflatwin2;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;<br><br>type<br> TForm3 = class(TForm)<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form3: TForm3;<br><br>implementation<br><br>{$R *.DFM}<br><br>end.<br>/////form3 end////<br>其中form2是一浮动窗口,可是在我打开form3的窗口时,form2就无法移动,<br>请问我要如何让form2移动,form3必须是showmodal方式打开,就象netants、flashget一样 <br><br>