十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
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);