如何从带有C++的Windows上的注册表中获取具有完整路径的"Open With"程序?
How to get "Open With" programs with their full paths from the registry on Windows with C++?
我正在使用Qt,它有一个非常有用的QSettings
类,可以轻松访问Windows注册表:
QSettings s("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\OpenWithList", QSettings::NativeFormat);
s.value("a").toString()
返回"chrome.exe"
.
Chrome 不在我计算机的路径中。在终端中运行chrome.exe
会导致"未找到"错误。所以我不能只在我的C++应用程序中运行它。
我也无法获得它的图标,因为我需要完整路径。
那么如何找到这个完整的路径呢?(如果是铬,它是C:UsersAdministratorAppDataLocalGoogleChromeApplicationchrome.exe
)
不要直接弄乱注册表 - FindExecutable
旨在产生您想要/需要的东西。
相关文章:
- 如何将更多文件夹添加到c++include路径
- 带有特殊路径部分的"std::filesystem::weakly_canonical"失败
- C++A*算法并不总是在路径中具有目标节点
- 从函数角度看ID到文件路径的内部与外部映射
- boost xml parsingl将xml的路径作为变量发送
- 对于MacOS上的G++,如何添加默认的include目录/usr/local/include和默认的库搜索路径/usr
- 如何使用cppcheck处理半相对包含路径
- 在C++中设置基于操作系统的文件路径
- 基于编译器选项的编译二进制路径
- 按边长度递归搜索图中所有可行路径
- 使用变量值作为 PlaySound 中的路径
- 如何转换真实路径 CString c++
- 从 GUID 获取 USB 卷路径
- 查找 GCD:并非所有控制路径都返回值
- C++17 文件系统::remove_all 带有通配符路径
- 在带有尾部斜杠的路径上返回 std::filesystem::create_directories() 的值
- 如何从带有C++的Windows上的注册表中获取具有完整路径的"Open With"程序?
- "Error C1083: Cannot open include file"但我有包含文件的路径
- 尽管路径设置正确,但错误"C1083 cannot open include file gecode/int.hh"
- 在VS 2010中使用"open"保存文件的默认路径C++