svnno****@sourc*****
svnno****@sourc*****
2009年 6月 13日 (土) 02:12:00 JST
Revision: 3475 http://svn.sourceforge.jp/view?root=ttssh2&view=rev&rev=3475 Author: doda Date: 2009-06-13 02:12:00 +0900 (Sat, 13 Jun 2009) Log Message: ----------- ã«ã¼ãã¦ã£ã³ãã¦ãµã¤ãºå ±åã·ã¼ã±ã³ã¹ã«å¯¾å¿ã <CSI> 19 t å¿ç: <CSI> 9 ; H ; W t H,W: ã«ã¼ãã¦ã£ã³ãã¦ã®é«ã/å¹ Modified Paths: -------------- trunk/teraterm/teraterm/vtdisp.c trunk/teraterm/teraterm/vtdisp.h trunk/teraterm/teraterm/vtterm.c -------------- next part -------------- Modified: trunk/teraterm/teraterm/vtdisp.c =================================================================== --- trunk/teraterm/teraterm/vtdisp.c 2009-06-12 15:37:04 UTC (rev 3474) +++ trunk/teraterm/teraterm/vtdisp.c 2009-06-12 17:12:00 UTC (rev 3475) @@ -3424,3 +3424,32 @@ return; } + +void DispGetRootWinSize(int *x, int *y) +{ + HMODULE mod; + HMONITOR monitor; + MONITORINFO monitorInfo; + RECT desktop, win, client; + + GetWindowRect(HVTWin, &win); + GetClientRect(HVTWin, &client); + + if (((mod = GetModuleHandle("user32.dll")) != NULL) && + (GetProcAddress(mod,"MonitorFromWindow") != NULL)) { + // }`j^ªT|[g³êÄ¢éê + monitor = MonitorFromWindow(HVTWin, MONITOR_DEFAULTTONEAREST); + monitorInfo.cbSize = sizeof(MONITORINFO); + GetMonitorInfo(monitor, &monitorInfo); + desktop = monitorInfo.rcWork; + } + else { + // }`j^ªT|[g³êĢȢê + SystemParametersInfo(SPI_GETWORKAREA, 0, &desktop, 0); + } + + *x = (desktop.right - desktop.left - (win.right - win.left - client.right)) / FontWidth; + *y = (desktop.bottom - desktop.top - (win.bottom - win.top - client.bottom)) / FontHeight; + + return; +} Modified: trunk/teraterm/teraterm/vtdisp.h =================================================================== --- trunk/teraterm/teraterm/vtdisp.h 2009-06-12 15:37:04 UTC (rev 3474) +++ trunk/teraterm/teraterm/vtdisp.h 2009-06-12 17:12:00 UTC (rev 3475) @@ -84,6 +84,7 @@ void DispResizeWin(int w, int h); BOOL DispWindowIconified(); void DispGetWindowPos(int *x, int *y); +void DispGetRootWinSize(int *x, int *y); extern int WinWidth, WinHeight; extern HFONT VTFont[AttrFontMask+1]; Modified: trunk/teraterm/teraterm/vtterm.c =================================================================== --- trunk/teraterm/teraterm/vtterm.c 2009-06-12 15:37:04 UTC (rev 3474) +++ trunk/teraterm/teraterm/vtterm.c 2009-06-12 17:12:00 UTC (rev 3475) @@ -1837,6 +1837,11 @@ len = _snprintf_s_l(Report, sizeof(Report), _TRUNCATE, "8;%u;%u;t", CLocale, NumOfLines-StatusLine, NumOfColumns); SendCSIstr(Report, len); break; + case 19: // Report display size (character) + DispGetRootWinSize(&x, &y); + len = _snprintf_s_l(Report, sizeof(Report), _TRUNCATE, "9;%d;%dt", CLocale, x, y); + SendCSIstr(Report, len); + break; } }