提交 29950113 编写于 作者: S Sam Harwell

Remove unused code

上级 6694cda7
......@@ -197,25 +197,6 @@ public static void SetForegroundWindow(IntPtr window)
{
var activeWindow = NativeMethods.GetLastActivePopup(window);
NativeMethods.SwitchToThisWindow(activeWindow, true);
//// Make the window a top-most window so it will appear above any existing top-most windows
//NativeMethods.SetWindowPos(window, (IntPtr)NativeMethods.HWND_TOPMOST, 0, 0, 0, 0, (NativeMethods.SWP_NOSIZE | NativeMethods.SWP_NOMOVE));
//// Move the window into the foreground as it may not have been achieved by the 'SetWindowPos' call
//var success = NativeMethods.SetForegroundWindow(window);
//if (!success)
//{
// throw new InvalidOperationException("Setting the foreground window failed.");
//}
//// Ensure the window is 'Active' as it may not have been achieved by 'SetForegroundWindow'
//NativeMethods.SetActiveWindow(window);
//// Give the window the keyboard focus as it may not have been achieved by 'SetActiveWindow'
//NativeMethods.SetFocus(window);
//// Remove the 'Top-Most' qualification from the window
//NativeMethods.SetWindowPos(window, (IntPtr)NativeMethods.HWND_NOTOPMOST, 0, 0, 0, 0, (NativeMethods.SWP_NOSIZE | NativeMethods.SWP_NOMOVE));
}
public static void SendInput(NativeMethods.INPUT[] inputs)
......
......@@ -48,11 +48,6 @@ internal static class NativeMethods
public const uint GW_CHILD = 5;
public const uint GW_ENABLEDPOPUP = 6;
public const int HWND_NOTOPMOST = -2;
public const int HWND_TOPMOST = -1;
public const int HWND_TOP = 0;
public const int HWND_BOTTOM = 1;
public const uint INPUT_MOUSE = 0;
public const uint INPUT_KEYBOARD = 1;
public const uint INPUT_HARDWARE = 2;
......@@ -63,22 +58,6 @@ internal static class NativeMethods
public const uint KEYEVENTF_UNICODE = 0x0004;
public const uint KEYEVENTF_SCANCODE = 0x0008;
public const uint SWP_NOSIZE = 0x0001;
public const uint SWP_NOMOVE = 0x0002;
public const uint SWP_NOZORDER = 0x0004;
public const uint SWP_NOREDRAW = 0x008;
public const uint SWP_NOACTIVATE = 0x0010;
public const uint SWP_DRAWFRAME = 0x0020;
public const uint SWP_FRAMECHANGED = 0x0020;
public const uint SWP_SHOWWINDOW = 0x0040;
public const uint SWP_HIDEWINDOW = 0x0080;
public const uint SWP_NOCOPYBITS = 0x0100;
public const uint SWP_NOOWNERZORDER = 0x0200;
public const uint SWP_NOREPOSITION = 0x0200;
public const uint SWP_NOSENDCHANGING = 0x0400;
public const uint SWP_DEFERERASE = 0x2000;
public const uint SWP_ASYNCWINDOWPOS = 0x4000;
public const uint WM_GETTEXT = 0x000D;
public const uint WM_GETTEXTLENGTH = 0x000E;
......@@ -172,20 +151,6 @@ public struct MOUSEINPUT
[DllImport(User32, CharSet = CharSet.Unicode, SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint uMsg, IntPtr wParam, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam);
[DllImport(User32, SetLastError = true)]
public static extern IntPtr SetActiveWindow(IntPtr hWnd);
[DllImport(User32, SetLastError = true)]
public static extern IntPtr SetFocus(IntPtr hWnd);
[DllImport(User32, SetLastError = false)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport(User32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetWindowPos(IntPtr hWnd, [Optional] IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
[DllImport(User32, SetLastError = true)]
public static extern IntPtr GetLastActivePopup(IntPtr hWnd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册