Buenas a todos,
teango una Aplicacion MDI y quisiera saber la manera mas "elegante" de maximimar un formulario Hijo al tamaño del area cliente del formulario padre, es decir que cuando maximize un form hijo este no se fusione con la barra de herramientas del form padre, hice un acercamiento con el siguiente código, pero mmm solo hago la simulacion de maximizar,
por ahi lei de manejar los mesanajes de WM_WINDOWPOSCHANGING , WM_GETMINMAXINFO SetWindowLong, pero la verdad probe con todo y nada, Gracias de antemano y FELIZ NAVIDAD!!
Código Delphi
[-]
function MDIChildProc(hwnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
var
F: TChild;
begin
F := TChild(FindControl(hwnd));
begin
case uMsg of
WM_MOVE,
WM_SIZE:
begin
if biMaximize in (F.BorderIcons) then
begin
if (F.WindowState = wsNormal) and (F.BoundsRect <> MaxRect)then
F.Rect := Bounds(F.Left, F.Top, F.Width, F.Height);
end;
end;
WM_SYSCOMMAND:
begin
case wParam and $FFF0 of
end;
SC_MAXIMIZE:
begin
if F.WindowState = wsMinimized then begin
Windows.ShowWindow(F.Handle, SW_RESTORE);
F.BoundsRect := MaxRect;
end
else
if F.BoundsRect = MaxRect then F.BoundsRect := F.Rect
else F.BoundsRect := MaxRect;
Result := 0;
Exit;
end;
SC_RESTORE:
begin
if biMaximize in (F.BorderIcons) then
F.BoundsRect := F.Rect;
end;
end;
end;
end;
Result := CallWindowProc(Pointer(F.Tag), hwnd, uMsg, wParam, lParam);
end;
end;