如何禁止MDI主窗口的ScrollBar(100分)

  • 主题发起人 主题发起人 savetime
  • 开始时间 开始时间
S

savetime

Unregistered / Unconfirmed
GUEST, unregistred user!
如题.通常发生在子窗口超过主窗口屏幕或子窗口最小化时
 
http://www.delphibbs.com/delphibbs/dispq.asp?lid=203257

FClientHandle := Windows.CreateWindowEx(WS_EX_CLIENTEDGE, 'MDICLIENT',
nil, WS_CHILD or WS_VISIBLE or WS_GROUP or WS_TABSTOP or
WS_CLIPCHILDREN or WS_CLIPSIBLINGS or
MDIS_ALLCHILDSTYLES, 0, 0, ClientWidth, ClientHeight, Handle, 0,
HInstance, @ClientCreateStruct);

 
要改源代码!
 
easy!

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: 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;
Result := CallWindowProc(pUserData, wnd, msg, wParam, lParam);
end;

//===========================================================================================
procedure TXKMainW.FormCreate(Sender: TObject);
begin

//设置系统时间
SetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SSHORTDATE, 'yyyy-MM-dd');
StatusBarMain.Panels[0].Text := '系统时间:' + FormatDateTime('YYYY"年"MM"月"DD"日"', Date);

//消除滚 动 条
if ClientHandle <> 0 then
begin
if GetWindowLong(ClientHandle, GWL_USERDATA) <> 0 then Exit;
SetWindowLong(ClientHandle, GWL_USERDATA, SetWindowLong(ClientHandle, GWL_WNDPROC, Integer(@ClientWindowProc)));
end;

//设置菜单位置
end;

 
http://www.delphibbs.com/delphibbs/dispq.asp?lid=869903
 
许久不来,怠慢各位!
 
后退
顶部