mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[PowerToys Run] Fix register notifications crash (#12911)
This commit is contained in:
@@ -6,6 +6,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Reflection;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
using Microsoft.PowerToys.Common.UI;
|
using Microsoft.PowerToys.Common.UI;
|
||||||
@@ -16,6 +17,7 @@ using PowerLauncher.ViewModel;
|
|||||||
using Windows.UI.Notifications;
|
using Windows.UI.Notifications;
|
||||||
using Wox.Infrastructure.Image;
|
using Wox.Infrastructure.Image;
|
||||||
using Wox.Plugin;
|
using Wox.Plugin;
|
||||||
|
using Wox.Plugin.Logger;
|
||||||
|
|
||||||
namespace Wox
|
namespace Wox
|
||||||
{
|
{
|
||||||
@@ -37,8 +39,15 @@ namespace Wox
|
|||||||
WebRequest.RegisterPrefix("data", new DataWebRequestFactory());
|
WebRequest.RegisterPrefix("data", new DataWebRequestFactory());
|
||||||
|
|
||||||
DesktopNotificationManagerCompat.RegisterActivator<LauncherNotificationActivator>();
|
DesktopNotificationManagerCompat.RegisterActivator<LauncherNotificationActivator>();
|
||||||
|
try
|
||||||
|
{
|
||||||
DesktopNotificationManagerCompat.RegisterAumidAndComServer<LauncherNotificationActivator>("PowerToysRun");
|
DesktopNotificationManagerCompat.RegisterAumidAndComServer<LauncherNotificationActivator>("PowerToysRun");
|
||||||
}
|
}
|
||||||
|
catch (System.UnauthorizedAccessException ex)
|
||||||
|
{
|
||||||
|
Log.Exception("Exception calling RegisterAumidAndComServer. Notifications not available.", ex, MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void ChangeQuery(string query, bool requery = false)
|
public void ChangeQuery(string query, bool requery = false)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user