Update the features about Notification and Cert.

This commit is contained in:
Bruce
2025-11-12 14:59:34 +08:00
parent a5d8981528
commit ce5d3af63b
25 changed files with 866 additions and 86 deletions
+27 -1
View File
@@ -628,4 +628,30 @@ HRESULT FindAppxPackage (LPCWSTR lpPackageFullName, PKGMGR_FINDENUMCALLBACK pfCa
[STAThread]
LPCWSTR GetPackageManagerLastErrorCode () { return g_swExceptionCode.c_str (); }
[STAThread]
LPCWSTR GetPackageManagerLastErrorDetailMessage () { return g_swExceptionDetail.c_str (); }
LPCWSTR GetPackageManagerLastErrorDetailMessage () { return g_swExceptionDetail.c_str (); }
HRESULT ActivateAppxApplication (LPCWSTR lpAppUserId, PDWORD pdwProcessId)
{
if (!lpAppUserId) return E_INVALIDARG;
std::wstring strAppUserModelId (L"");
if (lpAppUserId) strAppUserModelId += lpAppUserId;
IApplicationActivationManager *spAppActivationManager = nullptr;
destruct relaamgr ([&] () {
if (spAppActivationManager) spAppActivationManager->Release ();
spAppActivationManager = nullptr;
});
HRESULT hResult = E_INVALIDARG;
if (!strAppUserModelId.empty ())
{
// Instantiate IApplicationActivationManager
hResult = CoCreateInstance (CLSID_ApplicationActivationManager, NULL, CLSCTX_LOCAL_SERVER, IID_IApplicationActivationManager, (LPVOID *)&spAppActivationManager);
if (SUCCEEDED (hResult))
{
// This call ensures that the app is launched as the foreground window
hResult = CoAllowSetForegroundWindow (spAppActivationManager, NULL);
// Launch the app
if (SUCCEEDED (hResult)) hResult = spAppActivationManager->ActivateApplication (strAppUserModelId.c_str (), NULL, AO_NONE, pdwProcessId);
}
}
return hResult;
}