- btz: Internet fejlesztés országosan!
- ubyegon2: Airfryer XL XXL forrólevegős sütő gyakorlati tanácsok, ötletek, receptek
- Tomasz72: Ventilátor upgrade
- sziku69: Fűzzük össze a szavakat :)
- Luck Dragon: Asszociációs játék. :)
- sziku69: Szólánc.
- Parci: Milyen mosógépet vegyek?
- bambano: Bambanő háza tája
- sh4d0w: Árnyékos sarok
- f(x)=exp(x): A laposföld elmebaj: Vissza a jövőbe!
Ú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
Hirdetés
- Honor Magic7 Lite 8/512GB, Kártyafüggetlen
- Windows, Office licencek kedvező áron, egyenesen a Microsoft-tól - Automata kézbesítés utalással is!
- AKCIÓ! MSI B550 R7 5700X 32GB DDR4 512GB SSD RTX 3060Ti 8GB Rampage SHIVA MSI 650W
- Xiaomi Redmi Note 13 256GB, Kártyafüggetlen, 1 Év Garanciával
- ÁRGARANCIA!Épített KomPhone i5 12400F 16/32/64GB RAM RTX 3060 12GB GAMER PC termékbeszámítással
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: PC Trade Systems Kft.
Város: Szeged