Delphi 去掉MDI窗口的滚动条


本文整理自网络,侵删。

  在MDI主窗体中如下代码:


Function ClientWindowProc( wnd: HWND; msg: Cardinal; wparam, lparam: Integer ): Integer; stdcall;
Var
pUserdata: Pointer;
Begin
pUserdata:= Pointer( GetWindowLong( wnd, GWL_USERDATA ));
Case msg of
WM_NCCALCSIZE: Begin
If (GetWindowLong( wnd, GWL_STYLE ) and (WS_HSCROLL or WS_VSCROLL)) <> 0 Then
SetWindowLong( wnd, GWL_STYLE, GetWindowLong(wnd, GWL_STYLE) and not (WS_HSCROLL or WS_VSCROLL));
End;
End;
Result := CallWindowProc(pUserdata, wnd, msg, wparam, lparam );
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
// ShowScrollBar(mainform.clienthandle, SB_BOTH, false );
If ClientHandle <> 0 Then Begin
If GetWindowLong( ClientHandle, GWL_USERDATA ) <> 0 Then Exit;
// 加上回调句柄
SetWindowLong( ClientHandle, GWL_USERDATA, SetWindowLong( ClientHandle, GWL_WNDPROC, integer( @ClientWindowProc)));
End;

相关阅读 >>

Delphi旋转位图

Delphi的combobox不能输入只能选择

Delphi for 循环 downto用法

Delphi tfdquery提交tfdmemtable修改的数据

Delphi 创建大窗口

Delphi 获取北京时间

Delphi在64位系统下读写注册表

Delphi 时间戳与日期互转

Delphi idhttp post

Delphi捕获twebbrowser的close事件

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...