Apply AppUserModelID to all shortcuts, fix toast init order

This commit is contained in:
2026-06-10 09:25:37 -06:00
parent b1d8f21f2b
commit 6e72536e37
2 changed files with 13 additions and 11 deletions

View File

@@ -85,6 +85,12 @@ extern "C"
__declspec (dllexport) int
notification_backend_init (const char **error)
{
if (FAILED (Windows::Foundation::Initialize (RO_INIT_SINGLETHREADED)))
{
*error = "Error initializing Windows::Foundation.";
return 0;
}
try
{
if (!notifier)
@@ -92,6 +98,7 @@ extern "C"
}
catch (Platform::Exception ^ ex)
{
Windows::Foundation::Uninitialize ();
static char exc_message[1024];
std::string tmp = narrow(std::wstring(ex->Message->Data()));
if (SUCCEEDED(StringCchPrintfA(exc_message, _countof(exc_message), "Error (0x%x): %s", ex->HResult, tmp.c_str())))
@@ -102,16 +109,11 @@ extern "C"
}
catch (...)
{
Windows::Foundation::Uninitialize ();
*error = "Generic c++ exception.";
return 0;
}
if (FAILED (Windows::Foundation::Initialize (RO_INIT_SINGLETHREADED)))
{
*error = "Error initializing Windows::Foundation.";
return 0;
}
return 1;
}