From 3fd8100aa5a1e34df7659a11433cae57b07d1801 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Mon, 1 Mar 2021 23:14:38 +0800 Subject: [PATCH] Remove Win32Native.cs --- Netch/Forms/Mode/Process.cs | 3 +-- Netch/Win32Native.cs | 11 ----------- 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 Netch/Win32Native.cs diff --git a/Netch/Forms/Mode/Process.cs b/Netch/Forms/Mode/Process.cs index 658bd521..8dc46484 100644 --- a/Netch/Forms/Mode/Process.cs +++ b/Netch/Forms/Mode/Process.cs @@ -1,7 +1,6 @@ using System; using System.IO; using System.Linq; -using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Microsoft.WindowsAPICodePack.Dialogs; @@ -135,7 +134,7 @@ namespace Netch.Forms.Mode NavigateToShortcut = true }; - if (dialog.ShowDialog(Win32Native.GetForegroundWindow()) == CommonFileDialogResult.Ok) + if (dialog.ShowDialog(Handle) == CommonFileDialogResult.Ok) { ScanDirectory(dialog.FileName); MessageBoxX.Show(i18N.Translate("Scan completed")); diff --git a/Netch/Win32Native.cs b/Netch/Win32Native.cs deleted file mode 100644 index cb7da4e4..00000000 --- a/Netch/Win32Native.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace Netch -{ - public static class Win32Native - { - [DllImport("User32", CharSet = CharSet.Auto, ExactSpelling = true)] - public static extern IntPtr GetForegroundWindow(); - } -} \ No newline at end of file