大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
HKEY hKey; DWORD dwType = REG_SZ; DWORD dwSize = 255;//须指定长度,否则第一次读取RegQueryValueEx不成功,仅返回长度 TCHAR data[MAX_PATH]; bool ret; if (RegOpenKey(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"), &hKey) == ERROR_SUCCESS) TRACE(_T("open success")); ret = RegQueryValueEx(hKey, _T("ProductName"),NULL,&dwType, (LPBYTE)data,&dwSize) == ERROR_SUCCESS; CString strWinVerName = data; AfxMessageBox(strWinVerName); RegCloseKey(hKey);