mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
9e1ef4a095
Installer works, but there are a few issues with it. - It doesn't register the DesktopBackground COM server - It doesn't create a start menu shortcut with the AUMID - It doesn't check for .Net Framework 4.8 or later - It doesn't try to install .Net Framework 4.8 or later if not there - It doesn't have any customised backgrounds... - It doesn't ask to run DisplayMagician when install is finished
24 lines
906 B
C#
24 lines
906 B
C#
using System.Runtime.InteropServices;
|
|
|
|
namespace DisplayMagicianShared
|
|
{
|
|
public class ShellUtils
|
|
{
|
|
public static 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);
|
|
}
|
|
|
|
}
|
|
}
|