PDA

Ver la Versión Completa : Averiguar si existen formularios visibles en la pantalla


dec
07-06-2006, 20:23:14
Con esta función puede averiguarse si alguno de los formularios de nuestra aplicación se está mostrando en pantalla:


uses
Forms;

function HasShowingFormsInScreen
(alsoMainForm:boolean=false):boolean;
var
i: integer;
begin
Result := false;
for i:=0 to Screen.FormCount-1 do
begin
if Result then
Exit;
if Screen.Forms[i].Showing then
begin
with Screen, Application do
begin
if (Forms[i] = MainForm) then
Result := alsoMainForm
else
begin
Result := true;
Exit;
end;
end;
end;
end;
end;