Scalabium Software

SMExport/SMImport suites
Knowledge for your independence'.
Home Delphi and C++Builder tips


#95: How can I receive a modem list, which is installed in Win95/98?

If you needs to retrieve a list of modems which was installed in MS Windows, you can use the next procedure:

function EnumModems: TStrings;
var
  R: TRegistry;
  s: ShortString;
  N: TStringList;
  i, j: integer;
begin
  Result:= TStringList.Create;
  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
          N:= TStringList.Create;
          try
            GetKeyNames(N);
            for i := 0 to N.Count-1 do
            begin
              CloseKey;
              OpenKey(N[i], False);
              s:= ReadString('AttachedTo');
              for j := 1 to 4 do
                if Pos(Chr(j+Ord('0')), s) > 0 then
                  Break;
              Result.AddObject(ReadString('DriverDesc'), TObject(j));
              CloseKey;
            end;
          finally
            N.Free;
          end;
        end;
    end;
  finally
    R.Free;
  end;
end;


Published: September 18, 2000

See also
 
SMDBGrid
SMMsg suite
Viewer for TNEF-files (winmail.dat)
DBISAM Password Recovery
Paradox to Text converter
Paradox to MS Access converter
Viewer for MS Outlook Messages
Excel Web-stream
Protected Storage Viewer
Clarion Viewer
 
 


Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2025, Scalabium Software. All rights reserved.
webmaster@scalabium.com

SMExport advertising