S
Solid_Snake
Unregistered / Unconfirmed
GUEST, unregistred user!
我在form1里面设置了form2.show,在form1的鼠标单击时得到form1的窗口句柄,并使form1变为最小,当show出form2时,两个窗口并排出现在屏幕上面,我想使鼠标在form1里面单击使其变为最小,在form2里面单击使其最大,但是我的程序在form2里面单击变成了使form1最大,请帮我看看代码,帮我纠正一下吧:<br>procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;<br> Shift: TShiftState; X, Y: Integer);<br>var<br> ss:TPoint;<br> mlngHwndCaptured: HWND;<br>begin<br><br>if GetCapture()<>0 then<br>begin<br> ss.X :=X;<br> ss.Y:= Y;<br> ClientToScreen(ss);<br> mlngHwndCaptured := WindowFromPoint(ss);<br> ShowWindow(mlngHwndCaptured,SW_MINIMIZE);<br>end;<br><br><br>procedure TForm2.FormMouseDown(Sender: TObject; Button: TMouseButton;<br> Shift: TShiftState; X, Y: Integer);<br>var<br> ss1:TPoint;<br> bb: HWND;<br>begin<br><br>if GetCapture()<>0 then<br>begin<br> ss1.X :=X;<br> ss1.Y:= Y;<br> ClienttoScreen(ss1);<br> bb := WindowFromPoint(ss1);<br> ShowWindow(bb,SW_MAXIMIZE);<br> end;<br><br><br><br>