We help IT Professionals succeed at work.

icon names

nod31
nod31 asked
on
is it possible to change the likes of "My Computer" icon text to whatever i want in code?

if this is possible could someone PLEASE give me the code that can do this using an EDITBOX to enter in the NEW name!


thank you

nod31
Comment
Watch Question

Commented:
The name is in the registry somewhere, just open up regedit.exe and search for "My Computer", then you should find the key where it is stored. You can simply change it, however the explorer needs to be restarted, only then the effect will be visible. You can use Delphi's TRegistry object to change the value. Sorry, no time for writing code...

Regards, Madshi.
Commented:
uses
  Registry;

procedure RenameComputer(Name: string);
begin
  with TRegistry.Create do begin
    RootKey := HKEY_CURRENT_USER;
    if OpenKey('\Software\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}', true) then begin
      WriteString('', Name);
      CloseKey;
    end;
    Free;
  end;
end;

//---------------------------

This would change the name next time explorer.exe reads registry (reboot). I don't know how to force explorer to read registry. I guess you can send a close message to explorer to make it restart, but I do not recomend it.

Commented:
On Win2000 the key is
HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}
LocalizedString = @C:\WINNT\system32\shell32.dll,-9216@1033,My Computer


The Crazy One

Commented:
listening
i tried the code above but it dosen't seem to change the text on the desktops my computer icon, but it only changes it in the likes of windows explorer! why is this?

Commented:
Search in the registry. If you still see "My Computer" on your desktop (even after a reboot), there must be "My Computer" in your registry somewhere.

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