Hirdetés
Új hozzászólás Aktív témák
-
pIIrash
tag
unit un_RMethods;
interface
uses Windows, SysUtils, Registry;
const
CurVer = 'SOFTWARE\Microsoft\Windows\CurrentVersion\';
R_UninstPrg = CurVer + 'Uninstall';
R_RUN = CurVer + 'Run';
procedure SetStartWithWindows(AppName, AppTitle: string);
procedure SetRegistryValue(RootKey: HKEY; Key, KeyName, Value, regType: string);
implementation
procedure SetRegistryValue(RootKey: HKEY; Key, KeyName, Value, regType: string);
var
Registry: TRegistry;
begin
Registry := TRegistry.Create;
with Registry do
begin
try
RootKey := RootKey;
if OpenKey(Key, False) then
begin
if regType = 'STR' then WriteString(KeyName, Value);
if regType = 'BOL' then WriteBool(KeyName, StrToBool(Value));
if regType = 'INT' then WriteInteger(KeyName, StrToInt(Value));
end;
finally
Free;
end;
end;
end;
function GetRegistryValue(RootKey: HKEY; Key, Value, regType: string): string;
var
Registry: TRegistry;
TempValue: string;
begin
Registry := TRegistry.Create;
with Registry do
begin
try
RootKey := RootKey;
if OpenKey(Key, False) then
begin
if regType = 'STR' then TempValue := Registry.ReadString(Value);
if regType = 'BOL' then TempValue := BoolToStr(ReadBool(Value));
if regType = 'INT' then TempValue := IntToStr(ReadInteger(Value));
end;
finally
Free;
end;
end;
Result := TempValue;
end;
pl: beírás:
procedure SetStartWithWindows(AppName, AppTitle: string);
begin
SetRegistryValue(HKEY_LOCAL_MACHINE, R_RUN, <Program elérési útja>, <Program neve>, 'STR');
end;
pl: kiolvasás:
InstallPath := GetRegistryValue(HKEY_LOCAL_MACHINE, SOFTWARE\<A program neve>\, A kulcs amiből olvasni akarsz);
Remélem segít!
[Szerkesztve]
Új hozzászólás Aktív témák
- Asztali PC , i5 11400F , RTX 3060 12GB , 16GB DDR4 , 512GB NVME , 2TB HDD
- Iphone 16 plus 6db folia + ajándék tok
- iPhone 15 Pro Max 256GB Natúr titán, makulátlan, független, 2026.12.08. garancia!
- Asus Zenbook 15 OLED UM3504 - 15.6" 2.8K 120Hz - Ryzen 5 7535U - 16GB - 512GB - 2+ év garancia
- AOC 27" 27G2U Full HD 144Hz monitor eladó!
- BESZÁMÍTÁS! ASROCK B550M R9 5900X 32GB DDR4 1TB SSD RTX 3080TI 12GB ZALMAN I3 NEO GIGABYTE 850W
- Szép állapotban levő Apple iPhone 15 256GB / 12 hó jótállás
- Gamer Notebook! Acer Nitro 5! Csere-Beszámítás! I5 11400H / RTX 3050Ti / 16GB DDR4 / 500GB SSD!
- Felsőkategóriás Gamer PC-Számítógép! Csere-Beszámítás! I9 13900K / RTX 4080 / 32GB / 1TB SSD
- Honor 90 256GB, Kártyafüggetlen, 1 Év Garanciával
Állásajánlatok
Cég: FOTC
Város: Budapest