Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何获得;以“打开”;在使用C++;?_C++_Windows_Qt_Registry - Fatal编程技术网

C++ 如何获得;以“打开”;在使用C++;?

C++ 如何获得;以“打开”;在使用C++;?,c++,windows,qt,registry,C++,Windows,Qt,Registry,我使用的是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不在我的计算机路径中。在终

我使用的是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++应用程序中运行它。 我也不能得到它的图标,因为我需要完整的路径


那么我如何找到这条完整的路径呢?(对于Chrome,它是
C:\Users\Administrator\AppData\Local\Google\Chrome\Application\Chrome.exe

不要直接弄乱注册表,它的设计目的是生成您想要/需要的内容。

。此函数只返回扩展的默认程序。我需要获得所有可能的程序的列表,即在Windows资源管理器中单击“打开时使用”时得到的程序。@Alex:可能在问题中值得一提。标题是“使用程序及其完整路径打开”,这意味着我需要获得多个程序