Revision: 8348 https://osdn.net/projects/ttssh2/scm/svn/commits/8348 Author: zmatsuo Date: 2019-10-30 22:32:04 +0900 (Wed, 30 Oct 2019) Log Message: ----------- マクロウィンドウをディスプレイのセンターに表示するようにした - ステータスバー分下にずれていた Modified Paths: -------------- trunk/teraterm/ttpmacro/ttmmain.cpp -------------- next part -------------- Modified: trunk/teraterm/ttpmacro/ttmmain.cpp =================================================================== --- trunk/teraterm/ttpmacro/ttmmain.cpp 2019-10-30 13:31:53 UTC (rev 8347) +++ trunk/teraterm/ttpmacro/ttmmain.cpp 2019-10-30 13:32:04 UTC (rev 8348) @@ -252,9 +252,6 @@ { IDC_CTRLPAUSESTART, "BTN_PAUSE" }, { IDC_CTRLEND, "BTN_END" }, }; - HDC TmpDC; - int CRTWidth, CRTHeight; - RECT Rect; char Temp[MAX_PATH + 8]; // MAX_PATH + "MACRO - "(8) BOOL IOption, VOption; int CmdShow; @@ -267,17 +264,6 @@ Pause = FALSE; - // \x83Z\x83\x93\x83^\x81[\x82Ɏ\x9D\x82\xC1\x82Ă\xA2\x82\xAD - TmpDC = ::GetDC(GetSafeHwnd()); - CRTWidth = ::GetDeviceCaps(TmpDC,HORZRES); - CRTHeight = ::GetDeviceCaps(TmpDC,VERTRES); - ::GetWindowRect(m_hWnd, &Rect); - ::ReleaseDC(GetSafeHwnd(), TmpDC); - ::SetWindowPos(GetSafeHwnd(),HWND_TOP, - (CRTWidth-Rect.right+Rect.left) / 2, - (CRTHeight-Rect.bottom+Rect.top) / 2, - 0,0,SWP_NOSIZE | SWP_NOZORDER); - if (IsWindowsNT4()) { fuLoad = LR_VGACOLOR; } @@ -343,6 +329,8 @@ WS_CHILD | WS_VISIBLE | CCS_BOTTOM | SBARS_SIZEGRIP, NULL, GetSafeHwnd(), 1); + CenterWindow(m_hWnd, NULL); + if (VOption) { return TRUE; }