Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 28-03-2009
Khronos Khronos is offline
Miembro
 
Registrado: abr 2007
Posts: 298
Poder: 18
Khronos Va por buen camino
Cita:
Valores INI por defecto

Cuando lees un "archivo de idioma", podrías proporcionar un valor "por defecto" a cada valor, para el caso de que una determinda "clave" no se encuentre en el archivo de idioma, o bien tenga un valor (o pueda tener un valor) "vacío".

Código Delphi [-]
procedure TFMain.FormCreate(Sender: TObject);
var
Reg: TRegistry;
i: integer;
begin
LoadLangs();
//En este procedimiento si no encuentra los archivos .lang en la carpeta \lang
//informa que se usará como idioma el español.


  try
    Reg:= TRegistry.Create;
    Reg.RootKey:= HKEY_CURRENT_USER;
    Reg.OpenKey('\Software\KMem', true);
    if Reg.ValueExists('Speed') = false then Reg.WriteInteger('Speed', 3);
    if Reg.ValueExists('StartUp') = false then Reg.WriteBool('StartUp', true);
    if Reg.ValueExists('Ico') = false then Reg.WriteBool('Ico', true);
    if Reg.ValueExists('Lang') = false then Reg.WriteString('Lang', 'spanish');

    i:= langbox.Items.IndexOf(Reg.ReadString('Lang'));
    if i > -1 then
      begin
        langbox.ItemIndex:= i;
        langbox.OnChange(sender);
      end;

    tbTime.Position:= Reg.ReadInteger('Speed');
    CheckBox1.Checked:= Reg.ReadBool('StartUp');
    CheckBox2.Checked:= Reg.ReadBool('Ico');
  finally
    Reg.Free;
  end;
   try
     Reg:= TRegistry.Create;
     Reg.RootKey:= HKEY_LOCAL_MACHINE;
     Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Run', false);
     Reg.WriteString('KMem', Paramstr(0));
   finally
     Reg.free;
   end;
   If CheckBox2.Checked = false then  TrayIcon1.Visible:= false;
end;

Saludos.
Responder Con Cita
Respuesta



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 16:57:32.


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