Delphi 去掉MDI窗口的滚动条
2013-06-24 13:56
441 查看
在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;
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;
相关文章推荐
- 在Java MDI窗口中加入滚动条
- Delphi非应用程序主窗口创建MDI
- mfc 切割窗口加入对话框资源(去掉滚动条)
- Delphi非应用程序主窗口创建MDI
- MFC MDI去掉滚动条
- 在Java MDI窗口中加入滚动条
- 控制MDI窗口的,最大化.最小化按钮!
- delphi固定窗口大小
- Android ScrollView去掉滚动条及ScrollView属性
- js/jquery获取浏览器窗口可视区域高度和宽度以及滚动条高度实现代码
- 如何在MDI客户区窗口响应鼠标双击消息?
- 去掉iframe的水平滚动条而保留垂直滚动条
- 用 Javascript 获取页面大小、窗口大小和滚动条位置
- Delphi中AnImateWindow用法淡入淡出窗口
- VB6.0代码窗口不支持鼠标中键操作滚动条解决方法
- 关于HTML中的滚动条/去掉滚动条
- Delphi中,除了应用程序主窗口会显示在任务栏上,其它窗口默认都不会显示在任务栏.
- 单例模式--实现多文档窗口(MDI)
- Windows SDK编程--创建MDI窗口
- 在MDI主框架窗口中添加图标Ico