DisplayMagician/DisplayMagicianShared/ShellUtils.cs
Terry MacDonald 20a7c85279 Updated toast notification to work from zip install
Used some amazing code from David Air at https://gist.github.com/davidair/c4ea207bf6eece4ef08b97ab29a3036f to enable toasts without install from a setup program. This allows me to debug toasts within VS2019.
2021-12-03 10:38:29 +13:00

24 lines
911 B
C#

//using System.Runtime.InteropServices;
/*namespace DisplayMagicianShared
{
public class ShellUtils
{
public const string AUMID = "LittleBitBig.DisplayMagician";
// Add the ability to set an Application AUMID so that Windows 10+ recognises the
// application and things like Toasts, Tasbar pinning and similar functionality
// works as intended. This DLL import avoids the need to package the app as an MSIX
// or moving to a WiX based installer at this stage, or the need to add this to the
// Windows Store.
[DllImport("shell32.dll", SetLastError = true)]
public static extern void SetCurrentProcessExplicitAppUserModelID([MarshalAs(UnmanagedType.LPWStr)] string AppID);
public static void SetDefaultProcessExplicitAppUserModelID()
{
SetCurrentProcessExplicitAppUserModelID(AUMID);
}
}
}*/