Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL/Registry / INI Objects    [ Add a report in this area ]  
Report #:  80769   Status: Closed
Themes affect non-visual registry access
Project:  Delphi Build #:  12.0.3420.21218
Version:    12.3 Submitted By:   Malcolm Coulter
Report Type:  Basic functionality failure Date Reported:  1/1/2010 9:52:31 PM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    32 Bit Internal Tracking #:   274307
Resolution: Third Party (Resolution Comments) Resolved in Build: : 15.0.3715.28376
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
The demonstration code given below fails on Vista (build 6002) (any user type,no elevation, UAC enabled) if compiled with themes enabled, and succeeds if themes are not enabled.
The registry key exists and contains string values.

Note: real applications require the read/write access.


Added by Sysop
<<<<<<<<<<<<<<<<<<
Workaround: pass access mode as below
  Reg := tRegistry.Create(KEY_READ);
instead of
  Reg := tRegistry.Create;

I guess your issue might be related to QC#8164...
>>>>>>>>>>>>>>>>>>
Steps to Reproduce:
unit RegFrm;

interface

uses
  Windows, SysUtils, Classes, Controls, Forms, StdCtrls,
  Registry;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}


procedure TForm1.FormCreate(Sender: TObject);
var
  Reg   : tRegistry;
begin
  Reg := tRegistry.Create;
  Reg.RootKey := $80000002; //'HKEY_LOCAL_MACHINE'
  if Reg.OpenKey('\SOFTWARE\GIAT\GIATBase\Types',false) then
       Label1.Caption := 'SUCCESS'
  else Label1.Caption := 'FAILURE';
  Reg.Free;
end;

end.
Workarounds
No workaround if themes are needed.
Attachment
None
Comments

Tomohiro Takahashi at 1/2/2010 5:15:11 AM -
Could you please try to pass access mode as below?
  Reg := tRegistry.Create(KEY_READ);
instead of
  Reg := tRegistry.Create;

I guess your issue might be related to QC#8164...

Tomohiro Takahashi at 1/5/2010 5:35:31 PM -
Malcolm-san, any update?

Server Response from: ETNACODE01