_CALI
24-12-2012, 21:46:52
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!!
//procedmiento de ventana que maneja los mensajes de los formularios hijos
//donde F es el form hijo y MaxRect es el Rect de dicho form
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 //minimizado
begin
Windows.ShowWindow(F.Handle, SW_RESTORE);
F.BoundsRect := MaxRect;
end
else
if F.BoundsRect = MaxRect then //maximizado
F.BoundsRect := F.Rect
else //normal
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;
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!!
//procedmiento de ventana que maneja los mensajes de los formularios hijos
//donde F es el form hijo y MaxRect es el Rect de dicho form
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 //minimizado
begin
Windows.ShowWindow(F.Handle, SW_RESTORE);
F.BoundsRect := MaxRect;
end
else
if F.BoundsRect = MaxRect then //maximizado
F.BoundsRect := F.Rect
else //normal
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;