We help IT Professionals succeed at work.

editing registry

hugh34
hugh34 asked
on
how can i modify the following key in the registry?

HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}

read string

LocalizedString "@C:\WINDOWS\SYSTEM\shell32.dll,-8964@1033,Recycle Bin"

what i would like to know is how can i change the "Recyclin Bin" bit of this string in code using an editbox to enter in the new name?
Comment
Watch Question

Commented:
Use TRegistry!
Commented:
procedure TForm1.Button1Click(Sender: TObject);
var
  Reg : TRegistry;
begin
  Reg := TRegistry.Create;
  try
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    if Reg.OpenKey('SOFTWARE\CLASSES\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}',False) then begin
      Reg.WriteString('LocalizedString',Edit1.Text);
      end
    else MessageDlg('Unable to open registry key!', mtError, [mbOK], 0);
  finally
    Reg.Free;
    end;
end;

Commented:
Be carefull when you test it!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.