From 9cbb88c886916204c1b573a4a2df89b7e80e42b0 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Fri, 5 Mar 2021 21:19:10 +0800 Subject: [PATCH] Open Opened Netch Window using win32 apis --- Netch/Netch.cs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/Netch/Netch.cs b/Netch/Netch.cs index 3834df35..9bba7de6 100644 --- a/Netch/Netch.cs +++ b/Netch/Netch.cs @@ -123,22 +123,8 @@ namespace Netch if (handle.IsNull) return; - ShowWindow(handle, ShowWindowCommand.SW_RESTORE); - SetWindowPos(handle, - HWND.HWND_TOPMOST, - 0, - 0, - 0, - 0, - SetWindowPosFlags.SWP_NOACTIVATE | SetWindowPosFlags.SWP_NOMOVE | SetWindowPosFlags.SWP_NOSIZE | SetWindowPosFlags.SWP_SHOWWINDOW); - - SetWindowPos(handle, - HWND.HWND_NOTOPMOST, - 0, - 0, - 0, - 0, - SetWindowPosFlags.SWP_NOACTIVATE | SetWindowPosFlags.SWP_NOMOVE | SetWindowPosFlags.SWP_NOSIZE | SetWindowPosFlags.SWP_SHOWWINDOW); + ShowWindow(handle, ShowWindowCommand.SW_NORMAL); + SwitchToThisWindow(handle, true); } } } \ No newline at end of file