Link to home
Start Free TrialLog in
Avatar of Treppenmeister
Treppenmeister

asked on

Registry OpenKey doesnt seem to work - Delphi 2010

I try to read the registry

var
   Registry: TRegistry;
   PrinterName : string ;
begin
    Registry:=TRegistry.Create;
    PrinterName := devMode^.dmDeviceName;
    Registry.RootKey:=HKEY_LOCAL_MACHINE;
    if Registry.OpenKey('System\ControlSet001\Control\Print\Printers\'+lPrinterName+'\DsDriver',False) then begin
       ....
    end;

end;

Open in new window


This code worked with Delphi 2006 & Windows 7.
Printername would be in my case 'FreePDF'. The registry entry exists.
When i use it with Delphi 2010 then Openkey returns false (at least under Windows 7 - i didnt try other OS yet)

What am I missing?
ASKER CERTIFIED SOLUTION
Avatar of Ferruccio Accalai
Ferruccio Accalai
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial