mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Upgrade .NET Core 3.1 to .NET 5 (#15591)
* Common.UI * ColorPicker * PT Run * File Explorer Add-ons * Awake * FZ Editor * ImageResizer * Interop * Docs * Installer * Fix test not being run - Downgrade MSTest.TestAdapter & MSTest.TestFramework * Update expect.txt * Test run fix
This commit is contained in:
@@ -46,7 +46,7 @@ namespace PowerLauncher
|
||||
[STAThread]
|
||||
public static void Main()
|
||||
{
|
||||
Log.Info($"Starting PowerToys Run with PID={Process.GetCurrentProcess().Id}", typeof(App));
|
||||
Log.Info($"Starting PowerToys Run with PID={Environment.ProcessId}", typeof(App));
|
||||
int powerToysPid = GetPowerToysPId();
|
||||
if (powerToysPid != 0)
|
||||
{
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.Toolkit.Uwp.Notifications;
|
||||
|
||||
namespace PowerLauncher.Helper
|
||||
{
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
[ComSourceInterfaces(typeof(INotificationActivationCallback))]
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
[Guid("DD5CACDA-7C2E-4997-A62A-04A597B58F76")]
|
||||
[ComVisible(true)]
|
||||
public class LauncherNotificationActivator : NotificationActivator
|
||||
{
|
||||
public override void OnActivated(string invokedArgs, NotificationUserInput userInput, string appUserModelId)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace PowerLauncher.Helper
|
||||
// get current active window
|
||||
IntPtr hWnd = NativeMethods.GetForegroundWindow();
|
||||
|
||||
if (hWnd != null && !hWnd.Equals(IntPtr.Zero))
|
||||
if (hWnd != IntPtr.Zero && !hWnd.Equals(IntPtr.Zero))
|
||||
{
|
||||
// if current active window is NOT desktop or shell
|
||||
if (!(hWnd.Equals(HWND_DESKTOP) || hWnd.Equals(HWND_SHELL)))
|
||||
@@ -144,7 +144,7 @@ namespace PowerLauncher.Helper
|
||||
{
|
||||
IntPtr hWndDesktop = NativeMethods.FindWindowEx(hWnd, IntPtr.Zero, "SHELLDLL_DefView", null);
|
||||
hWndDesktop = NativeMethods.FindWindowEx(hWndDesktop, IntPtr.Zero, "SysListView32", "FolderView");
|
||||
if (hWndDesktop != null && !hWndDesktop.Equals(IntPtr.Zero))
|
||||
if (hWndDesktop != IntPtr.Zero && !hWndDesktop.Equals(IntPtr.Zero))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\..\Version.props" />
|
||||
<PropertyGroup>
|
||||
<AssemblyTitle>PowerToys.Run</AssemblyTitle>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<StartupObject>PowerLauncher.App</StartupObject>
|
||||
@@ -100,7 +100,7 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="6.1.1" />
|
||||
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
|
||||
<PackageReference Include="ModernWpfUI" Version="0.9.4" />
|
||||
<PackageReference Include="SharpZipLib" Version="1.2.0" />
|
||||
|
||||
@@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
|
||||
<PublishDir>$(PowerToysRoot)\$(Platform)\$(Configuration)\modules\launcher</PublishDir>
|
||||
<RuntimeIdentifier>win-$(Platform)</RuntimeIdentifier>
|
||||
<SelfContained>false</SelfContained>
|
||||
|
||||
@@ -38,15 +38,9 @@ namespace Wox
|
||||
_themeManager.ThemeChanged += OnThemeChanged;
|
||||
WebRequest.RegisterPrefix("data", new DataWebRequestFactory());
|
||||
|
||||
DesktopNotificationManagerCompat.RegisterActivator<LauncherNotificationActivator>();
|
||||
try
|
||||
ToastNotificationManagerCompat.OnActivated += args =>
|
||||
{
|
||||
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)
|
||||
@@ -105,7 +99,7 @@ namespace Wox
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
var toast = new ToastNotification(builder.GetToastContent().GetXml());
|
||||
DesktopNotificationManagerCompat.CreateToastNotifier().Show(toast);
|
||||
ToastNotificationManagerCompat.CreateToastNotifier().Show(toast);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user