![](/img/trans.png)
[英]How to get computer manufacturer and model from windows registry in C++?
[英]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不在我計算機的PATH中。 在終端中運行chrome.exe
導致找不到錯誤。 所以我不能只在我的C ++應用程序中運行它。
我也無法獲得它的圖標,因為我需要完整的路徑。
那么,如何找到完整的路徑? (如果使用Chrome, C:\\Users\\Administrator\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe
)
不要直接搞亂注冊表FindExecutable
旨在產生您想要/需要的東西。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.