HanDs
管理员

[Delphi文章] 在Vista下读取注册表 



Delphi在Vista下读取注册表
                  function getcpu:PChar;stdcall;
                  var
                    reg:HKEY;
                    size:PDWORD;
                    info:PByte;
                  begin
                    GetMem(info,64);
                    GetMem(size,SizeOf(pdword));
                    size^:=64;
                   
                  RegOpenKeyEx(HKEY_LOCAL_MACHINE,PChar('HARDWARE\DESCRIPTION\System\CentralProcessor\0'),0,KEY_QUERY_VALUE,reg);
                   
                  RegQueryValueEx(reg,PChar('ProcessorNameString'),nil,nil,Pbyte(info),@Size);
                    Result:=PChar(info);
                    RegCloseKey(reg);
                  end;

                  procedure TForm1.Button1Click(Sender: TObject);
                  begin
                    ShowMessage(getcpu);
                  end;


学习中请遵守法律法规,本网站内容均来自于互联网,本网站不负担法律责任
Vi st a 读取 注册表
#1楼
发帖时间:2016-7-9   |   查看数:0   |   回复数:0
游客组
快速回复