2016-06-15 31 views
1

Microsoft page說我需要使用ms-windows-store URI方案。試過這個:使用WinAPI打開Windows應用商店(C++)

std::wstring urlStore = L"ms-windows-store://pdp/?PFN=Microsoft.Office.OneNote_8wekyb3d8bbwe"; 
::ShellExecute(GetActiveWindow(), L"open", urlStore.c_str(), NULL, NULL, SW_SHOWNORMAL); 

結果:打開商店應用程序的最後一頁,而不是在OneNote頁面上。

回答

0

好的,解決了它(在另一個應用程序能夠做到這一點使用API​​監視器)。

std::wstring urlStore = StringHelpers::format(L"ms-windows-store:PDP?PFN=%s", m_strPackageFamilyName); 
::ShellExecute(GetActiveWindow(), L"open", urlStore.c_str(), L"", L"", SW_SHOWNORMAL);