如何保证一个MDI子窗口一直最大化(100分)

  • 主题发起人 savetime
  • 开始时间
to shenloqi, <br>不能下载,能否发到我的邮箱:savetime@alibaba.com<br>谢谢!<br>
 
我发给你吧。我不要了分,谢谢你给我上了一课。[:)]
 
to shadow, 我一直在考虑如何向你道歉, 既然你是如此豁达之人, 想必会原谅我的粗鲁。<br>to shenloqi, 使用你的方法我已经解决了问题,但有一点小小的遗憾,(因为用你的方法<br>做不出完全覆盖MDI空间的效果——还是我不知道?) &nbsp; 我感觉天心ERP的导航窗口应该是<br>MDIChild,但不知是如何保持最大化的。
 
你说得有道理,我也没怪过你。呵呵。<br>整天对着毫无生气的电脑,尤其遇到长时间解决不了的问题时,人很容易会浮躁。<br>浮躁的时候,很容易忽略细节,保持开朗的心情更利于解决问题。[:)]
 
很抱歉,最近工作忙,一直没有时间上大富翁.<br>在我的这个例子中Unit1有以下代码,其中的FormResize代码就是你要的吧<br><br>&nbsp; private<br>&nbsp; &nbsp; { Private declarations }<br>&nbsp; &nbsp; FClientInstance,<br>&nbsp; &nbsp; &nbsp; FPrevClientProc: TFarProc;<br>&nbsp; &nbsp; procedure ClientWndProc(var Message: TMessage);<br><br>procedure TForm1.ClientWndProc(var Message: TMessage);<br>var<br>&nbsp; MyDC: hDC;<br>&nbsp; Ro, Co: Word;<br>begin<br>&nbsp; with Message do<br>&nbsp; &nbsp; case Msg of<br>&nbsp; &nbsp; &nbsp; WM_ERASEBKGND:<br>&nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FormResize(nil);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Result := 1; //其实无所谓了<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; Result := CallWindowProc(FPrevClientProc, ClientHandle, Msg, wParam,<br>&nbsp; &nbsp; &nbsp; &nbsp; lParam);<br>&nbsp; &nbsp; end;<br>end;<br><br>procedure TForm1.FormResize(Sender: TObject);<br>var<br>&nbsp; wRect: TRect;<br>begin<br>&nbsp; GetWindowRect(ClientHandle, wRect);<br>&nbsp; if Assigned(Form3) then<br>&nbsp; begin<br>&nbsp; &nbsp; Form3.SetBounds(0, 0, wRect.Right - wRect.Left - 4, wRect.Bottom - wRect.Top<br>&nbsp; &nbsp; &nbsp; - 4);<br>&nbsp; end;<br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br>&nbsp; FClientInstance := MakeObjectInstance(ClientWndProc);<br>&nbsp; FPrevClientProc := Pointer(GetWindowLong(ClientHandle, GWL_WNDPROC));<br>&nbsp; SetWindowLong(ClientHandle, GWL_WNDPROC, LongInt(FClientInstance));<br>end;<br>
 
顶部