title: Problems Reading Registry from Delphi 7 on Windows 8 (64 bit)
body: <p>I am using Delphi 7 on Windows 8.</p>
  
  <p>The program I prepared is creating a problem in the registry.</p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>procedure DoAppToRun(RunName, AppName: string);
  var
    Reg: TRegistry;
  begin
    Reg := TRegistry.Create;
    with Reg do
    begin
      RootKey := HKEY_LOCAL_MACHINE;
      OpenKey('Software\Microsoft\Windows\CurrentVersion\Run', True);
      WriteString(RunName, AppName);
      CloseKey;
      Free;
    end;
  end;
  
  procedure TForm1.Button1Click(Sender: TObject);
  begin
   DoAppToRun('MyAPP', 'C:/ProgramData/MyAPP.exe');
  end;
  </code></pre>
  
  <p><strong>I receive the following error:</strong></p>
  
  <pre><code>Error: Failed to set data for MyAPP
  </code></pre>
  
  <p>This program is running in Windows XP, but not 64 bits.</p>