Ú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
- Simagic Alpha Evo wheelbase 10nm
- Samsung S22 ultra
- Diszkrét és olcsó kasztni érdekel-e? Ingyen MPL-el? Persze itt egy Kolink Nimbus Midi Házikó
- --- KISHIBÁS --- AM4 alaplap Asrock B550m HDV Egyik ram slot nem megy! Ingyen FOX
- Yoga Pro 7 14ARP8 14.5" QHD+ IPS Ryzen 5 7535HS 16GB 512GB NVMe magyar vbill IR kam gar
- HIBÁTLAN iPhone 14 128GB Purple -1 ÉV GARANCIA - Kártyafüggetlen, MS3528, 93% Akkumulátor
- 22 GB-os RTX 2080 TI - HP OEM - garanciával
- Telefon Felvásárlás!! iPhone 14/iPhone 14 Plus/iPhone 14 Pro/iPhone 14 Pro Max
- Vállalom Xianomi Okos kamerák, szoftveres javíttását
- BESZÁMÍTÁS! MSI B450 R7 5800X 32GB DDR4 1TB SSD RTX 4070Ti 12GB Zalman S2 TG Enermax 750W
Állásajánlatok
Cég: NetGo.hu Kft.
Város: Gödöllő
Cég: Promenade Publishing House Kft.
Város: Budapest

