Arsip: Ganti Ikon Drive di MyComputer (WinXP)


by LuriDarmawan in Articles more 18 years ago 1610
Cara ini tidak berlaku untuk Windows98, dan untuk memodifikasinya juga bukan merupakan hal yang mudah.
Tambahkan Registry di klausa USES
procedure TForm1.Button1Click(Sender: TObject);
var Reg: TRegistry;
begin
Reg := TRegistry.Create;
try
with Reg do
begin
RootKey := HKEY_LOCAL_MACHINE;
OpenKey
('Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\DriveIcons\', True);
{ True, because if a subkey named DriveIcons and/or DefaultIcon
does not exist, windows automatically creates it }
OpenKey('C\\DefaultIcon\', True); // as default first drive C
// we are choosing empty field as default value
WriteString('', 'C:\\YourIcons\\Sample1.ico');
{ and icon file path  or if dll file then
e.g  'c:\\YourIcons\\Icons.dll, 2' }
CloseKey;
end;
finally
Reg.Free;
end;
// if 2nd hard drive is present..
Reg := TRegistry.Create;
try
with Reg do
begin
RootKey := HKEY_LOCAL_MACHINE;
OpenKey
('Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\DriveIcons\', True);
OpenKey('D\\DefaultIcon\', True);
WriteString('', 'C:\\YourIcons\\Sample2.ico');
CloseKey;
end;
finally
Reg.Free;
end;
end;
Dengan cara yang sama, kamu bisa memodifkasinya untuk drive yang lain. ref: http://www.delphi3000.com/articles/article_4457.asp?SK=
Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com