To: vim_dev@googlegroups.com Subject: Patch 8.1.0906 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.0906 Problem: Using clumsy way to get console window handle. Solution: Use GetConsoleWindow(). (Ken Takata, closes #3940) Files: src/os_mswin.c *** ../vim-8.1.0905/src/os_mswin.c 2019-02-10 23:18:49.038187525 +0100 --- src/os_mswin.c 2019-02-12 23:10:26.877686857 +0100 *************** *** 1043,1053 **** 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; --- 1043,1048 ---- *************** *** 1061,1077 **** } # endif ! GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE); ! ! wsprintf(pszNewWindowTitle, "%s/%d/%d", ! pszOldWindowTitle, ! GetTickCount(), ! GetCurrentProcessId()); ! SetConsoleTitle(pszNewWindowTitle); ! Sleep(40); ! s_hwnd = FindWindow(NULL, pszNewWindowTitle); ! ! SetConsoleTitle(pszOldWindowTitle); } /* --- 1056,1062 ---- } # endif ! s_hwnd = GetConsoleWindow(); } /* *** ../vim-8.1.0905/src/version.c 2019-02-12 23:05:41.743869435 +0100 --- src/version.c 2019-02-12 23:12:04.368950837 +0100 *************** *** 785,786 **** --- 785,788 ---- { /* Add new patch number below this line */ + /**/ + 906, /**/ -- A M00se once bit my sister ... "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///