2016-06-15 30 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);