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

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 16-05-2008
Avatar de vroa74
vroa74 vroa74 is offline
Miembro
 
Registrado: jul 2006
Posts: 254
Poder: 18
vroa74 Va por buen camino
Question Obtener una lista del hardware instalado

estoy tratando de hacer esto:
encontre algo en truco mania mas no he podido hacer que se vea nada.
enlace

el codigo tal y cual lo cito:

Obtenido de alt.comp.lang.borland-delphi
Autor: alanglloyd@aol.com

Se trata de leer los datos del registro de Windows.

-Añade Registry en el uses de tu form
-Añade un TMemo (Memo1) y un TButton
-Pon este código en el OnClick del TButton:

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
 
  procedure GetHardwareList(DisplayStrings : TStrings);
  var 
    RegHKDD, RegHKLM: TRegistry;
    SLKeys, SLHWL: TStringList;
    i: Integer;
    RegDataInfo : TRegDataInfo;
  begin 
    try
      RegHKDD := TRegistry.Create;
      RegHKDD.RootKey := HKEY_DYN_DATA;
      RegHKLM := TRegistry.Create;
      RegHKLM.RootKey := HKEY_LOCAL_MACHINE;
      SLKeys := TStringList.Create;
      SLHWL := TStringList.Create;
      SLHWL.Sorted := true;
      if RegHKDD.OpenKey('\Config Manager\Enum', false) then begin 
        RegHKDD.GetKeyNames(SLKeys);
        for i := 0 to SLKeys.Count - 1 do 
          if RegHKDD.OpenKey('\Config Manager\Enum\' + SLKeys[i], false)then
            if RegHKLM.OpenKey('\Enum\' + RegHKDD.ReadString('HardWareKey'), false) then 
              if RegHKLM.GetDataInfo('Class', RegDataInfo) then 
                SLHWL.Add(RegHKLM.ReadString('Class')
                              + ': '
                              + RegHKLM.ReadString('DeviceDesc'));
      end; {if RegHKDD.OpenKey('\Config Manager\Enum', false)}
    finally
      SLKeys.Free;
      RegHKLM.Free;
      RegHKDD.Free;
    end; 
    DisplayStrings.Assign(SLHWL);
    SLHWL.Free;
  end; 
 
begin 
  GetHardwareList(Memo1.Lines);
end;

la verdad ya lo hice tal como marca mas sin embargo no tengo un resultado:
estoy trabajando con windows Xp y vista quiza haya alguna modificación, le agradeceria mucho si me ayudan.
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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Obtener datos del hardware (MB, RAM y Micro) Marca y/o Modelo JoAnCa API de Windows 7 19-02-2010 17:03:47
Como obtener datos del hardware (RAM, MB, Video) JoAnCa API de Windows 4 22-10-2007 22:30:44
obtener el hardware instalado droguerman OOP 1 14-05-2007 18:01:58
Hola! Informacion sobre hardware instalado kolokol API de Windows 1 09-03-2004 23:06:13
Obtener Hardware Instalado diegofhernando Varios 4 09-03-2004 20:28:36


La franja horaria es GMT +2. Ahora son las 02:51:12.


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