[Ttssh2-commit] [8517] マルチモニタ関連のAPIを直接呼ばないようにした

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2020年 1月 31日 (金) 08:42:44 JST


Revision: 8517
          https://osdn.net/projects/ttssh2/scm/svn/commits/8517
Author:   zmatsuo
Date:     2020-01-31 08:42:44 +0900 (Fri, 31 Jan 2020)
Log Message:
-----------
マルチモニタ関連のAPIを直接呼ばないようにした

- まだ使用している箇所があったので修正
- pMonitorFromRect(), pGetMonitorInfoA()
- r8504

Revision Links:
--------------
    https://osdn.net/projects/ttssh2/scm/svn/commits/8504

Modified Paths:
--------------
    trunk/teraterm/common/compat_win.cpp
    trunk/teraterm/common/compat_win.h
    trunk/teraterm/ttpcmn/ttcmn.c

-------------- next part --------------
Modified: trunk/teraterm/common/compat_win.cpp
===================================================================
--- trunk/teraterm/common/compat_win.cpp	2020-01-30 23:42:36 UTC (rev 8516)
+++ trunk/teraterm/common/compat_win.cpp	2020-01-30 23:42:44 UTC (rev 8517)
@@ -61,7 +61,6 @@
 BOOL (WINAPI *pRemoveFontResourceExA)(LPCSTR name, DWORD fl, PVOID pdv);
 BOOL (WINAPI *pRemoveFontResourceExW)(LPCWSTR name, DWORD fl, PVOID pdv);
 HRESULT (WINAPI *pGetDpiForMonitor)(HMONITOR hmonitor, MONITOR_DPI_TYPE dpiType, UINT *dpiX, UINT *dpiY);
-HMONITOR (WINAPI *pMonitorFromRect)(LPCRECT lprc, DWORD dwFlags);
 BOOL (WINAPI *pAdjustWindowRectEx)(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle);
 BOOL (WINAPI *pAdjustWindowRectExForDpi)(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle, UINT dpi);
 HWND (WINAPI *pGetConsoleWindow)(void);
@@ -76,6 +75,7 @@
 
 HMONITOR (WINAPI *pMonitorFromWindow)(HWND hwnd, DWORD dwFlags);
 HMONITOR (WINAPI *pMonitorFromPoint)(POINT pt, DWORD dwFlags);
+HMONITOR (WINAPI *pMonitorFromRect)(LPCRECT lprc, DWORD dwFlags);
 BOOL (WINAPI *pGetMonitorInfoA)(HMONITOR hMonitor, LPMONITORINFO lpmi);
 
 /**

Modified: trunk/teraterm/common/compat_win.h
===================================================================
--- trunk/teraterm/common/compat_win.h	2020-01-30 23:42:36 UTC (rev 8516)
+++ trunk/teraterm/common/compat_win.h	2020-01-30 23:42:44 UTC (rev 8517)
@@ -106,6 +106,7 @@
 extern BOOL (WINAPI *pAppendMenuW)(HMENU hMenu, UINT uFlags, UINT_PTR uIDNewItem, LPCWSTR lpNewItem);
 extern HMONITOR (WINAPI *pMonitorFromWindow)(HWND hwnd, DWORD dwFlags);
 extern HMONITOR (WINAPI *pMonitorFromPoint)(POINT pt, DWORD dwFlags);
+extern HMONITOR (WINAPI *pMonitorFromRect)(LPCRECT lprc, DWORD dwFlags);
 extern BOOL (WINAPI *pGetMonitorInfoA)(HMONITOR hMonitor, LPMONITORINFO lpmi);
 
 

Modified: trunk/teraterm/ttpcmn/ttcmn.c
===================================================================
--- trunk/teraterm/ttpcmn/ttcmn.c	2020-01-30 23:42:36 UTC (rev 8516)
+++ trunk/teraterm/ttpcmn/ttcmn.c	2020-01-30 23:42:44 UTC (rev 8517)
@@ -1098,8 +1098,6 @@
 	int i;
 	WINDOWPLACEMENT rc0;
 	RECT rc;
-	HMONITOR hMonitor;
-	MONITORINFO mi;
 	int stat = SW_RESTORE;
 	int multi_mon = 0;
 
@@ -1120,9 +1118,11 @@
 			// NT4.0, 95 \x82̓}\x83\x8B\x83`\x83\x82\x83j\x83^API\x82ɔ\xF1\x91Ή\x9E
 			if (multi_mon) {
 				// \x91Ώۃ\x82\x83j\x83^\x82̏\xEE\x95\xF1\x82\xF0\x8E擾
-				hMonitor = MonitorFromRect(&rc, MONITOR_DEFAULTTONEAREST);
+				HMONITOR hMonitor;
+				MONITORINFO mi;
+				hMonitor = pMonitorFromRect(&rc, MONITOR_DEFAULTTONEAREST);
 				mi.cbSize = sizeof(MONITORINFO);
-				GetMonitorInfo(hMonitor, &mi);
+				pGetMonitorInfoA(hMonitor, &mi);
 
 				// \x88ʒu\x95␳\x81i\x95\x9C\x8C\xB3\x91O\x8C\xE3\x82ʼn𑜓x\x82\xAA\x95ς\xED\x82\xC1\x82Ă\xA2\x82\xE9\x8Fꍇ\x82ւ̑΍\xF4\x81j
 				if (rc.right > mi.rcMonitor.right) {


Ttssh2-commit メーリングリストの案内
Back to archive index