diff --git a/src/XIVLauncher/App.xaml.cs b/src/XIVLauncher/App.xaml.cs index 5cb605b6e..011e72759 100644 --- a/src/XIVLauncher/App.xaml.cs +++ b/src/XIVLauncher/App.xaml.cs @@ -23,6 +23,7 @@ using XIVLauncher.Settings; using XIVLauncher.Settings.Parsers; using XIVLauncher.Support; +using XIVLauncher.Utilities; using XIVLauncher.Windows; using XIVLauncher.Xaml; @@ -298,6 +299,9 @@ private void App_OnStartup(object sender, StartupEventArgs e) // ignored } + // needs to be set early, and needs to be the same as what Squirrel sets for sanity's sake. + NativeFunctions.SetCurrentProcessExplicitAppUserModelID("com.squirrel.XIVLauncher.XIVLauncher"); + try { LogInit.Setup( diff --git a/src/XIVLauncher/Utilities/NativeFunctions.cs b/src/XIVLauncher/Utilities/NativeFunctions.cs new file mode 100644 index 000000000..e8fa36ab3 --- /dev/null +++ b/src/XIVLauncher/Utilities/NativeFunctions.cs @@ -0,0 +1,9 @@ +using System.Runtime.InteropServices; + +namespace XIVLauncher.Utilities; + +internal class NativeFunctions +{ + [DllImport("shell32.dll", SetLastError = true)] + internal static extern void SetCurrentProcessExplicitAppUserModelID([MarshalAs(UnmanagedType.LPWStr)] string appId); +}