How can I get a custom ID/Name for my WinUI3 program with notifications? Each time I start the unpacked program through the debugger or the .exe itself from any location, it creates a random GUID like "{A67659DD-0AD9-4430-BCE0-9658AD0E69EC}" under the path:
HKEY_USERS(SID)\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\
As I want to manage the registry keys and their values, I want to have a custom ID/Name here. I see other apps like "SentinelOne.WinAgent" there. Does anyone have an idea how this is possible?
I didn't find any information or example C# code about that.
In my appxmanifest, I have the following ({MyApp} is a placeholder):
<Extensions>
<desktop:Extension Category="windows.toastNotificationActivation">
<desktop:ToastNotificationActivation ToastActivatorCLSID="EC6E9BC5-CFE6-4740-BDD8-53C497EE57CF" />
</desktop:Extension>
<!-- Register COM CLSID -->
<com:Extension Category="windows.comServer">
<com:ComServer>
<com:ExeServer Executable="{MyApp.exe}" DisplayName="{MyApp}" Arguments="--AppNotificationActivated">
<com:Class
Id="EC6E9BC5-CFE6-4740-BDD8-53C497EE57CF"
DisplayName="{MyApp}"
EnableOleDefaultHandler="true"
ProgId="{My.App}"
VersionIndependentProgId="{My.App.1}"
AutoConvertTo="00000000-0000-0000-0000-000000000000"
InsertableObject="false"/>
</com:ExeServer>
</com:ComServer>
</com:Extension>
</Extensions>
Also, I have the following set:
<Application Id="{MyApp}">
The AppNotificationManager:
public void Init()
{
AppNotificationManager notificationManager = AppNotificationManager.Default;
notificationManager.NotificationInvoked += OnNotificationInvoked;
notificationManager.Register();
m_isRegistered = true;
}
If someone need more code or Iformations just aks please!