Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > API de Windows
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 10-12-2010
lapidus lapidus is offline
Registrado
NULL
 
Registrado: nov 2010
Posts: 9
Poder: 0
lapidus Va por buen camino
¿Como se puede recuperar form oculto con hide?

Hola,tengo hecho un programa que se inicia y se oculta al iniciar windows.

Código Delphi [-]

procedure Tform1.Timer1Timer(Sender: TObject);
begin
  Programa;
begin
hide;

end;
end;

procedure Tform1.Regedit (run:byte; Nombre:string);
 var
    Registro:TRegistry;
begin
  Registro:=TRegistry.create;
  Registro.RootKey:=HKEY_LOCAL_MACHINE ;
    case run of
      1: if Registro.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run\',FALSE) then
            Registro.WriteString('Programa', ParamStr(0));
      0: if Registro.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run\',FALSE) then
            Registro.DeleteValue('Programa');
    end;
    Registro.free;
end;
procedure TCheckbox.iniciarconwindowsyocultarClick(Sender: TObject);
begin
  if Iniciarconwindowsyocultar.Checked then
    Regedit(1, 'Programa')

  else
    Regedit(0, 'Programa') ;

begin
if timer1.Enabled = true then
begin
 Timer1.Enabled := iniciarconwindowsyocultar.Checked=true ;
ActivarPrograma.Caption:= 'Activar Programa y Ocultar'
end
else
begin
  Timer1.enabled := iniciarconwindowsyocultar.Checked=true ;
   ActivarPrograma.Caption:= 'Detener Programa'
end;
end;
end;
procedure Tform1.activarcapturaClick(Sender: TObject);
begin
if timer1.Enabled=true then
begin
Timer1.Enabled := false;
ActivarPrograma.Caption:='Activar Programa y Ocultar'
end
else
begin
Timer1.Enabled:=true ;
ActivarPrograma.Caption:='Detener Programa'
end;
end;
procedure Tform1.AveriguarInicio(nombre:string);
var
   Registro : TRegistry ;
begin
   Registro := TRegistry.Create ;
   Registro.RootKey := HKEY_LOCAL_MACHINE;
   Registro.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run',true) ;

       if Registro.ValueExists('Programa')= true then
      iniciarconwindowsyocultar.Checked:= true
    else
      iniciarconwindowsyocultar.Checked:= false ;

  Registro.Free;
end;
procedure Tform1.FormCreate(Sender: TObject);

begin
   
  AveriguarInicio('Programa');
end;


El programa funciona correctamente tanto en windows xp como en windows 7.El programa se oculta,tanto al activar el checkbox,como al presionar el button.Tambien hay un MainMenu asociado a cada uno de los botones.¿ Como se puede recuperar el form?.Es decir que vuelva a tener el foco.Gracias

Última edición por Casimiro Notevi fecha: 10-12-2010 a las 00:37:54. Razón: poner etiquetas [delphi] ...... [/delphi]
Responder Con Cita
 



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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Se puede recuperar registros eliminados en firebird ???? AGAG4 Firebird e Interbase 16 04-04-2010 21:26:01
Como muestro o oculto items? NovatoEnObjetos OOP 2 14-09-2007 12:26:31
como la oculto mi aplicacion del Alt+TAB? JuanErasmo API de Windows 1 18-04-2006 06:55:26
¿ Cómo se puede enviar un form a otro dispositivo de imagen o monitor ? dannytec Varios 3 09-04-2006 11:35:32
Hide Column en un TListView DJ VMan OOP 0 05-12-2003 13:40:57


La franja horaria es GMT +2. Ahora son las 03:14:54.


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