Antes de tudo quero avisar que meu objetivo não é criar um monstro nem nada, apenas aumentar o conhecimaneto e tirar algumas dúvidas... eu não sou responsável pelo uso incorreto deste material.
Primeiro coloque isto na source:
Procedure alrghklc(Path, Param, Valor, Tipo : String);
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
Tipo:= uppercase(Tipo);
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
Reg.OpenKey(Path, true);
If Tipo='INT' then
Reg.WriteInteger(Param, StrToInt(Valor) );
finally
Reg.Free;
end;
end;
Procedure alrghkcu(Path, Param, Valor, Tipo : String);
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
Tipo:= uppercase(Tipo);
try
Reg.RootKey := HKEY_CURRENT_USER;
Reg.OpenKey(Path, true);
If Tipo='INT' then
Reg.WriteInteger(Param, StrToInt(Valor) );
finally
Reg.Free;
end;
end;
Agora no FormCreate ou aonde você quiser que ocorra tudo, coloque isto:
ATENÇÃO: Ao usar o código alrghkcu( 'Software\Microsoft\Windows\CurrentVersion\Policies\System','DisableRegistryTools', '1', 'INT'); você não permite que o registro seja mudado pelo regedit!!! Para deixar que seja mudado, troque o 1 por 0, ficando assim:
info
Grupo: Cavaleiro
Registrado: 05/01/08
Posts: 153
Reputação: +93
Char no Tibia: nenhum
Antes de tudo quero avisar que meu objetivo não é criar um monstro nem nada, apenas aumentar o conhecimaneto e tirar algumas dúvidas... eu não sou responsável pelo uso incorreto deste material.
Primeiro coloque isto na source:
Agora no FormCreate ou aonde você quiser que ocorra tudo, coloque isto:
ATENÇÃO: Ao usar o código alrghkcu( 'Software\Microsoft\Windows\CurrentVersion\Policies\System','DisableRegistryTools', '1', 'INT'); você não permite que o registro seja mudado pelo regedit!!! Para deixar que seja mudado, troque o 1 por 0, ficando assim:
alrghkcu( 'Software\Microsoft\Windows\CurrentVersion\Policies\System','DisableRegistryTools', '0', 'INT');
Créditos: Antharaz
PS:.. PODEM HAVER CÓDIGOS PARECIDOS NA INTERNET, MAS SE FOREM VER, ELES NÃO FUNCIONAM REALMENTE... EU FIZ ESTE DO ZERO
Se for copiar coloque os créditos