mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
20a7c85279
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.
24 lines
911 B
C#
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);
|
|
}
|
|
|
|
}
|
|
}*/
|