获取IE的实际文件路径

 就一个函数搞定:

 

 /* 获取IE路径,分隔符转换为:/ 参数: strIEPath:[out],IE路径 返回值:无 by Ligo, 2009.2.17 */ void GetIEPath( CString &strIEPath ) { HKEY hKey = NULL; long lErr = RegOpenKeyEx( HKEY_LOCAL_MACHINE, TEXT("Software//Microsoft//Windows//CurrentVersion//App Paths//IEXPLORE.EXE"), 0, KEY_QUERY_VALUE, &hKey ); if ( lErr != ERROR_SUCCESS ) { return; } TCHAR szIEPath[80]; DWORD dwLen = sizeof(szIEPath); lErr = RegQueryValueEx( hKey, NULL, 0, NULL, (LPBYTE)szIEPath, &dwLen ); RegCloseKey( hKey ); if ( lErr != ERROR_SUCCESS ) return; strIEPath.Format( TEXT("%s"), szIEPath ); strIEPath.Replace( TCHAR('//'), TCHAR('/') ); }

你可能感兴趣的:(IE,null,query)