(CodeLib-Manager)
Registriert seit: 10. Jun 2002
4.648 Beiträge
Delphi XE Professional
|
Re: Gibt es die funktion StrToHKEY ?
25. Apr 2004, 14:10
Meine Funktionen sehen so aus:
Delphi-Quellcode:
const
HKEYNames: array[0..6] of string =
('HKEY_CLASSES_ROOT', 'HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE', 'HKEY_USERS',
'HKEY_PERFORMANCE_DATA', 'HKEY_CURRENT_CONFIG', 'HKEY_DYN_DATA');
function HKEYToStr(const Key: HKEY): string;
begin
if (key < $80000000) or (key > $80000006) then
Result := ''
else
Result := HKEYNames[key - $80000000];
end;
function StrToHKEY(const KEY: string): HKEY;
var
i: Byte;
begin
Result := $0;
for i := Low(HKEYNames) to High(HKEYNames) do
begin
if SameText(HKEYNames[i], KEY) then
Result := $80000000 + i;
end;
end;
Thomas
|
|
Zitat
|