rt,该用些什么函数?

解决方案 »

  1.   

    RegEnumValue
    其它相关函数查询msdn,基本都是以reg开头的api
      

  2.   

    http://www.vckbase.com/document/listdoc.asp?mclsid=13&sclsid=1317
      

  3.   

    The RegGetValue function retrieves the type and data for the specified registry value. LONG RegGetValue(
      HKEY hkey,
      LPCTSTR lpSubKey,
      LPCTSTR lpValue,
      DWORD dwFlags,
      LPDWORD pdwType,
      PVOID pvData,
      LPDWORD pcbData
    );
    The RegSetValueEx function sets the data and type of a specified value under a registry key.
    LONG RegSetValueEx(
      HKEY hKey,
      LPCTSTR lpValueName,
      DWORD Reserved,
      DWORD dwType,
      const BYTE* lpData,
      DWORD cbData
    );
      

  4.   

    例子:
    char ProcSpeed[50];
        HKEY hKey;    LONG rt = RegOpenKeyEx( HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", 0, KEY_READ, &hKey);
        if(rt == ERROR_SUCCESS)
        {
            unsigned long buflen = sizeof( ProcSpeed );
            RegQueryValueEx( hKey, "ProcessorNameString", NULL, NULL, (LPBYTE)&ProcSpeed, &buflen );
            RegCloseKey(hKey);
        }        if( 0 != ProcSpeed )
    {
    printf("处理器:%s",ProcSpeed); }