summaryrefslogtreecommitdiff
path: root/src/os_mswin.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-02-12 23:12:37 +0100
committerBram Moolenaar <Bram@vim.org>2019-02-12 23:12:37 +0100
commite1ed53f3f95786c744d4b6c85bda4f476f67cc91 (patch)
tree69adcb409033517250d8604f5bc21c1b5ea73aca /src/os_mswin.c
parent5567ad48b66dff13670af52a48509059acc34dfe (diff)
downloadvim-git-e1ed53f3f95786c744d4b6c85bda4f476f67cc91.tar.gz
patch 8.1.0906: using clumsy way to get console window handlev8.1.0906
Problem: Using clumsy way to get console window handle. Solution: Use GetConsoleWindow(). (Ken Takata, closes #3940)
Diffstat (limited to 'src/os_mswin.c')
-rw-r--r--src/os_mswin.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/os_mswin.c b/src/os_mswin.c
index 8d46e53cf..8dafaa35b 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -1043,11 +1043,6 @@ extern HWND g_hWnd; /* This is in os_win32.c. */
static void
GetConsoleHwnd(void)
{
-# define MY_BUFSIZE 1024 // Buffer size for console window titles.
-
- char pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated WindowTitle.
- char pszOldWindowTitle[MY_BUFSIZE]; // Contains original WindowTitle.
-
/* Skip if it's already set. */
if (s_hwnd != 0)
return;
@@ -1061,17 +1056,7 @@ GetConsoleHwnd(void)
}
# endif
- GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE);
-
- wsprintf(pszNewWindowTitle, "%s/%d/%d",
- pszOldWindowTitle,
- GetTickCount(),
- GetCurrentProcessId());
- SetConsoleTitle(pszNewWindowTitle);
- Sleep(40);
- s_hwnd = FindWindow(NULL, pszNewWindowTitle);
-
- SetConsoleTitle(pszOldWindowTitle);
+ s_hwnd = GetConsoleWindow();
}
/*