adaptacion a Delphi 6
el TrucoMania "495 Que tu aplicacion ocupe todo el area de pantalla excluyendo la barra de tareas" funciona, pero no actualiza el estado de la ventana, es decir, WindowState NO es wsMaximized, por lo que al darle al boton de maximizar y restaurar, no se comporta como cabe esperar (siempre mantendrá todo el area de pantalla ocupado). He retocado el truco para delphi 6.
Coloquemos pues un ApplicationEvents y el código asociado es:
Código:
procedure TFrmMdi.ApplicationEvents1SettingChange(Sender: TObject;
Flag: Integer; const Section: String; var Result: Integer);
var R:TRect;
begin
// cuando esta maximizada y se cambia la barra de tareas de sitio:
if (flag = SPI_SETWORKAREA) and (frmmdi.WindowState = wsmaximized) then
begin
SystemParametersInfo(SPI_GETWORKAREA, 0, @R, 0);
SetBounds(R.Left, R.Top, R.Right-R.Left, R.Bottom-R.Top);
Result:=0;
end;
end;
procedure TFrmMdi.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
var R:TRect;
begin
if msg.wParam = SIZE_MAXIMIZED then
begin
SystemParametersInfo(SPI_GETWORKAREA, 0, @R, 0);
// ******** extracto de la ayuda de delphi *********
// LOWORD(lParam); // New width of client area
// HIWORD(lParam); // New height of client area
msg.lParam := loword(R.Right-R.Left);
msg.lParam := hiword(R.Bottom-R.Top);
handled:=false;
end;
Nota: Este "Super"-truco
no se podría haber llevado a cabo sin la estimable ayuda de madriles