Revision: 7389 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7389 Author: zmatsuo Date: 2019-01-13 18:24:11 +0900 (Sun, 13 Jan 2019) Log Message: ----------- VTWinが前面に移動しないことがあったので修正 Modified Paths: -------------- trunk/teraterm/teraterm/vtdisp.c -------------- next part -------------- Modified: trunk/teraterm/teraterm/vtdisp.c =================================================================== --- trunk/teraterm/teraterm/vtdisp.c 2019-01-11 15:20:45 UTC (rev 7388) +++ trunk/teraterm/teraterm/vtdisp.c 2019-01-13 09:24:11 UTC (rev 7389) @@ -3738,27 +3738,41 @@ } } -void DispShowWindow(int mode) { +void DispShowWindow(int mode) +{ switch (mode) { - case WINDOW_MINIMIZE: + case WINDOW_MINIMIZE: ShowWindow(HVTWin, SW_MINIMIZE); break; - case WINDOW_MAXIMIZE: + case WINDOW_MAXIMIZE: ShowWindow(HVTWin, SW_MAXIMIZE); break; - case WINDOW_RESTORE: + case WINDOW_RESTORE: ShowWindow(HVTWin, SW_RESTORE); break; - case WINDOW_RAISE: - SetWindowPos(HVTWin, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); + case WINDOW_RAISE: { + //\x89\xBD\x82\xE0\x8BN\x82\xAB\x82Ȃ\xA2\x82\xB1\x82Ƃ\xA0\x82\xE8 + // SetWindowPos(HVTWin, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); +//#define RAISE_AND_GET_FORCUS +#if defined(RAISE_AND_GET_FORCUS) + //\x83t\x83H\x81[\x83J\x83X\x82\xF0\x92D\x82\xA4 + SetForegroundWindow(HVTWin); +#else + //\x83t\x83H\x81[\x83J\x83X\x82͒D\x82킸\x8Dŏ\xE3\x96ʂɗ\x88\x82\xE9 + BringWindowToTop(HVTWin); + if (GetForegroundWindow() != HVTWin) { + FlashWindow(HVTWin, TRUE); + } +#endif + } break; - case WINDOW_LOWER: + case WINDOW_LOWER: SetWindowPos(HVTWin, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); break; - case WINDOW_REFRESH: + case WINDOW_REFRESH: InvalidateRect(HVTWin, NULL, FALSE); break; - case WINDOW_TOGGLE_MAXIMIZE: + case WINDOW_TOGGLE_MAXIMIZE: if (IsZoomed(HVTWin)) { ShowWindow(HVTWin, SW_RESTORE); }