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

时间:2010-01-27 09:04:04  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:ordark="#ffffff" cellpadding="5" width="99%" bgcolor="#ffffc0" border="1">private{ Private declarations }FClientInstance: TFarProc;FPrevClientProc: TFarProc;procedure ClientWndProc(var Message: TMessage);procedure TForm1.ClientWndProc(var Message: TMessage);begin  with Mess...
  正文:

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

重载窗体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;

去掉MDI主窗体客户区凹陷的效果》由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Language/Delphi/2010-01-27/12452.html


关键字:

关于《去掉MDI主窗体客户区凹陷的效果》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td