10-16-2011، 09:25 PM
کد:
function IsInSandbox(Serial: string):boolean;
var
hOpen: HKEY;
sBuff: array[0..256] of char;
BuffSize: integer;
begin
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, PChar('Software\Microsoft\Windows\CurrentVersion'), 0, KEY_QUERY_VALUE, hOpen)) = ERROR_SUCCESS then begin
BuffSize := SizeOf(sBuff);
RegQueryValueEx(hOpen, PChar('ProductId'), nil, nil, @sBuff, @BuffSize);
if sBuff = Serial then Result := True;
RegCloseKey(hOpen);
end;
end;