Ver Mensaje Individual
  #2  
Antiguo 22-02-2005
S.M.S. S.M.S. is offline
Miembro
 
Registrado: jun 2003
Ubicación: España
Posts: 56
Reputación: 21
S.M.S. Va por buen camino
Creo que podría ser de la forma que pongo a continuación, al menos así me funciona en un ordenador con W98. Desconozco si esto mismo es válido para versiones posteriores de Windows. Agradecería sus comentarios en este sentido.

Código Delphi [-]
function TengoModem: Boolean;
 var
 R: TRegistry;
 S: TStringList;
 i: integer;
begin
R:= TRegistry.Create;
try
 with R do
 begin
  RootKey:= HKEY_LOCAL_MACHINE;
  if OpenKey('\System\CurrentControlSet\Services\Class\Modem',False) then
   if HasSubKeys then
   begin
     S:= TStringList.Create;
     try
      GetKeyNames(S);
      for i := 0 to S.Count-1 do
      begin
         OpenKey(S[i], False);
         Result:= ValueExists('DriverDesc');
         CloseKey;
         if Result then Break;
      end;
     finally
      S.Free;
     end;
   end;
 end;
finally
   R.Free;
end;
end;

Saludos.
Responder Con Cita