April 11th, 2006

о ужас

День прожит не зря!

с мира по нитке- тупому понимние API.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regqueryvalueex.asp

function GetRegistryValue(Path,Name:string):string;
var
Key :HKEY;
Val :PChar;
ValType :DWORD;
Size :DWORD;
begin
Val:=StrAlloc(MAX_PATH);
RegOpenKeyEx(HKEY_CURRENT_USER,PChar(Path),0,KEY_ALL_ACCESS,Key);
ValType:=REG_SZ;
Size:=0;
RegQueryValueEx(Key,PChar(Name),nil,@ValType,nil,@Size);
if RegQueryValueEx(Key,PChar(Name),nil,@ValType,PByte(Val),@Size)<>ERROR_SUCCESS then begin
GetRegistryValue:='';
Exit;
end;
GetRegistryValue:=String(Val);
RegCloseKey(Key);
StrDispose(Val);
end;