Revert "[PowerToys Run] Update to net5 (#12434)" (#12543)

This reverts commit c651a4b36e.
This commit is contained in:
Mykhailo Pylyp
2021-07-28 14:15:47 +03:00
committed by GitHub
parent 0c02a9acd7
commit 9731cdee67
58 changed files with 402 additions and 180 deletions

View File

@@ -114,7 +114,7 @@ namespace PowerLauncher.Helper
// get current active window
IntPtr hWnd = NativeMethods.GetForegroundWindow();
if (!hWnd.Equals(IntPtr.Zero))
if (hWnd != null && !hWnd.Equals(IntPtr.Zero))
{
// if current active window is NOT desktop or shell
if (!(hWnd.Equals(HWND_DESKTOP) || hWnd.Equals(HWND_SHELL)))
@@ -142,7 +142,7 @@ namespace PowerLauncher.Helper
{
IntPtr hWndDesktop = NativeMethods.FindWindowEx(hWnd, IntPtr.Zero, "SHELLDLL_DefView", null);
hWndDesktop = NativeMethods.FindWindowEx(hWndDesktop, IntPtr.Zero, "SysListView32", "FolderView");
if (!hWndDesktop.Equals(IntPtr.Zero))
if (hWndDesktop != null && !hWndDesktop.Equals(IntPtr.Zero))
{
return false;
}