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 tadodataset 加载数据到fdmemtable1

Delphi实现win10下Delphi 10.3.1 inline hook 域名转向之internetconnecta

Delphi webbrowser 无法调用当前浏览器的版本

Delphi 获取硬盘序列号(ide,sata,scsi)

Delphi 简单方法搜索定位treeview项

Delphi 官方使用并行编程库介绍

Delphi 深入了解unigui hyperserver

Delphi 判断正在运行的设备是iphone还是ipad

Delphi xe6调用android手机标准功能

Delphi x 的 y 次方

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



打赏

取消

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

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

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

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

评论

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

    正在狠努力加载,请稍候...