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 );
其它相关函数查询msdn,基本都是以reg开头的api
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
);
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); }