Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > API de Windows
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #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.449
Poder: 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
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 05:46:00.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi