去掉MDI主窗体客户区凹陷的效果

字体大小: 中小 标准 ->行高大小: 标准
在DELHPI6中加入了一个主窗体,并将该窗体的formstyle设置成fsMDIform,在该窗体上加入菜单,运行时发现菜单以下部分窗体有明显凹进去的现象,如何消除?

windoze@yeah.net:

重载窗体WndProc:

private

{ Private declarations }

FClientInstance: TFarProc;

FPrevClientProc: TFarProc;

procedure ClientWndProc(var Message: TMessage);

procedure TForm1.ClientWndProc(var Message: TMessage);

begin

with Message do

case Msg of

$3F:

begin

SetWindowLong(ClientHandle, GWL_EXSTYLE, 0);

SetWindowPos(ClientHandle, 0, 0, 0, 0, 0, SWP_FRAMECHANGED

or SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE or SWP_NOZORDER);

end;

else

Result := CallWindowProc(FPrevClientProc,

ClientHandle, Msg, wParam, lParam);

end;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

FClientInstance := MakeObjectInstance(ClientWndProc);

FPrevClientProc := Pointer(GetWindowLong(ClientHandle, GWL_WNDPROC));

SetWindowLong(ClientHandle, GWL_WNDPROC, LongInt(FClientInstance));

end;

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/68162.html