Ver Mensaje Individual
  #3  
Antiguo 28-10-2004
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: 19.441
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
Versión mejorada ;-)

Éste sí me gusta más...

(1) Coloca en tu form un botón
(2) Añade la unit ComObj al uses
(3) Añade las dos definiciones siguientes al private.

Código Delphi [-]
    procedure Minimize;
    procedure Restore;

(4) La implementación de los dos procedimientos es la siguiente:

Código Delphi [-]
procedure TForm1.Minimize;
var
  Shell : OleVariant;
begin
  Shell := CreateOleObject('Shell.Application') ;
  Shell.MinimizeAll;
  Shell := VarNull;
end;
procedure TForm1.Restore;
var
  Shell : OleVariant;
begin
  Shell := CreateOleObject('Shell.Application') ;
  Shell.UndoMinimizeAll;
  Shell := VarNull;
  // Delay for 100ms to allow all other windows to restore then
  // set this one to foreground.
  Sleep(100);
  SetForegroundWIndow(Self.Handle);
end; {Restore}

(5) Y por último en el evento del botón coloca lo siguiente:

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
begin
  case Button1.Tag of
  0:
    begin
      Minimize;
      Button1.Tag := 1;
    end;
  1:
    begin
      Restore;
      Button1.Tag := 0;
    end;
  end;
end;
__________________
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