Closed joshorenberg closed 1 month ago
Solution is: WinToast::instance()->setShortcutPolicy(WinToast::SHORTCUT_POLICY_IGNORE);
Without a valid shortcut including a special property installed in the Start screen or in All Programs, you cannot raise a toast notification from a desktop app. This library ensures a valid shortcut exists.
However, Microsoft recommends creating the shortcut through an installer and not through application code.
https://learn.microsoft.com/en-us/windows/win32/shell/enable-desktop-toast-with-appusermodelid
I'm closing this issue. As @ChristianGalla said, the library will attempt to create a valid shortcut by default. If your application provides a valid shortcut, the policy can be changed to avoid this step.
Hi every time I initialize WinToast using the sample initialization code from Shao Voon Wong's codeproject.com writeup it creates a shortcut in the start menu to the program exe. In my opinion this is undesirable behavior. Is there a way around this? Thanks! Sample code below.