Hola...
Esto que comentas, si bien puede solucionar tu problema, no es muy recomendable hacerlo.
Lo mejor sería que el método de clase sea la que devuelva ese valor:
Código Delphi
[-]
class procedure TParentForm.ShowWindow(ATag: Integer; var Reference);
var
i: Integer;
AForm: TForm;
begin
LockWindowUpdate(Application.MainForm.Handle);
try
for i := Screen.FormCount - 1 downto 0 do
begin
AForm := Screen.Forms[i];
if (AForm = Reference) then
begin
if (AForm.WindowState = wsMinimized) then
AForm.WindowState := wsNormal;
AForm.BringToFront;
Exit
end
end;
AForm := Create(Application);
AForm.Tag := ATag;
AForm.Show;
Reference := AForm
finally
LockWindowUpdate(0)
end
end;
De esta forma puedes hacer algo como:
Código Delphi
[-]
var
Form1: TForm1;
begin
TForm1.ShowWindow(1, Form1)
end;
Saludos...