MFC 操作注册表 Open QueryValue等
// 获取IEXPLORE所在路径 CRegKey reg; LPCTSTR lpszKey = _T("Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\IEXPLORE.exe"); CString strValue = _T(""); DWORD size = 1000; if(ERROR_SUCCESS == reg.Open(HKEY_LOCAL_MACHINE, lpszKey)) { reg.QueryValue(strValue.GetBuffer(MAX_PATH),_T("Path"),&size); strValue.ReleaseBuffer(); reg.Close(); }
参考:http://www.cnblogs.com/guanjinke/archive/2005/10/31/265835.html