Ver Mensaje Individual
  #2  
Antiguo 05-08-2008
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.297
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Prueba con este mensaje.
En la parte public del formulario define este procedimiento:
Código Delphi [-]
procedure CMShowingChanged(var Message: TMessage); message CM_SHOWINGCHANGED;

En la implementacion prueba con esto:
Código Delphi [-]
procedure TForm1.CMShowingChanged(var Message: TMessage);
var
  Str:String;
  i:Integer;
begin

  MessageDlg('Classname:'+ Self.ClassName+#13+#10+
             'Name:'+ Self.Name+ #13+#10+
             'Left:'+ IntToStr(Self.Left) + #13+#10+
             'Width:'+ IntToStr(Self.Width)+#13+#10+
             'Style:'+ IntToStr(Ord(Self.FormStyle))+#13+#10+
             'Visible:' + BoolToStr(Self.Visible, True), mtInformation, [mbOK], 0);

  Str := InputBox('Visualizar o no un form', 'Introduce un número(par=VISIBLE):','0');
  i := StrToIntDef(Str, 0);

  if Odd(i) then begin
    MessageDlg('Visualizar.', mtInformation, [mbOK], 0);
    inherited;
  end
  else begin
    MessageDlg('No visualizar', mtInformation, [mbOK], 0);
    Self.Close;
  end;
end;

En este caso visualiza o no dependiendo del número que coloques; Se trata de cambiar eso por la condición que tú necesites.

La verdad es que no lo había probado hasta ahora; Me has pillado mirando la VCL por otros temas y al revisar el hilo, he visto este mensaje, lo he probado y parece que funciona.
Ahora mismo no se me ocurre que inconvenientes puede tener; Sería cuestión de hacerlo funcionar y ver qué tal (si sale algo que no se nos haya ocurrido).
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita