[ttssh2-commit] [10275] SystemParametersInfoW() を layer for unicode に追加

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2022年 9月 20日 (火) 00:40:47 JST


Revision: 10275
          https://osdn.net/projects/ttssh2/scm/svn/commits/10275
Author:   zmatsuo
Date:     2022-09-20 00:40:47 +0900 (Tue, 20 Sep 2022)
Log Message:
-----------
SystemParametersInfoW() を layer for unicode に追加

- Tera Termで使用するメンバのみ

Modified Paths:
--------------
    trunk/teraterm/layer_for_unicode/layer_for_unicode.cpp
    trunk/teraterm/layer_for_unicode/layer_for_unicode.h
    trunk/teraterm/layer_for_unicode/symbol_list.txt

-------------- next part --------------
Modified: trunk/teraterm/layer_for_unicode/layer_for_unicode.cpp
===================================================================
--- trunk/teraterm/layer_for_unicode/layer_for_unicode.cpp	2022-09-18 16:07:06 UTC (rev 10274)
+++ trunk/teraterm/layer_for_unicode/layer_for_unicode.cpp	2022-09-19 15:40:47 UTC (rev 10275)
@@ -848,3 +848,28 @@
 	}
 	return handle;
 }
+
+static void LOGFONTAtoW(const LOGFONTA *logfontA, LOGFONTW *logfontW)
+{
+	LOGFONTA *d = (LOGFONTA *)logfontW;
+	*d = *logfontA;
+	ACPToWideChar_t(logfontA->lfFaceName, logfontW->lfFaceName, _countof(logfontW->lfFaceName));
+}
+
+BOOL WINAPI _SystemParametersInfoW(UINT uiAction, UINT uiParam,
+								   PVOID pvParam, UINT fWinIni)
+{
+	if (uiAction == SPI_GETNONCLIENTMETRICS) {
+		NONCLIENTMETRICSA ncmA = {};
+		// NONCLIENTMETRICSA \x82\xCD VISTA \x88ȍ~\x8Ag\x92\xA3\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9
+		ncmA.cbSize = CCSIZEOF_STRUCT(NONCLIENTMETRICSA, lfMessageFont);
+		BOOL r = SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, uiParam, &ncmA, 0);
+		if (r != FALSE) {
+			NONCLIENTMETRICSW *ncmW = (NONCLIENTMETRICSW *)pvParam;
+			// Tera Term \x82Ŏg\x97p\x82\xB7\x82郁\x83\x93\x83o\x82\xBE\x82\xAF\x90ݒ\xE8
+			LOGFONTAtoW(&ncmA.lfStatusFont, &ncmW->lfStatusFont);
+		}
+		return r;
+	}
+	return SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni);
+}

Modified: trunk/teraterm/layer_for_unicode/layer_for_unicode.h
===================================================================
--- trunk/teraterm/layer_for_unicode/layer_for_unicode.h	2022-09-18 16:07:06 UTC (rev 10274)
+++ trunk/teraterm/layer_for_unicode/layer_for_unicode.h	2022-09-19 15:40:47 UTC (rev 10275)
@@ -100,6 +100,8 @@
 UINT WINAPI _GetSystemDirectoryW(LPWSTR lpBuffer, UINT uSize);
 DWORD WINAPI _GetTempPathW(DWORD nBufferLength, LPWSTR lpBuffer);
 UINT WINAPI _GetTempFileNameW(LPCWSTR lpPathName, LPCWSTR lpPrefixString, UINT uUnique, LPWSTR lpTempFileName);
+BOOL WINAPI _SystemParametersInfoW(UINT uiAction, UINT uiParam,
+								   PVOID pvParam, UINT fWinIni);
 
 // gdi32.lib
 int WINAPI _AddFontResourceW(LPCWSTR lpFileName);

Modified: trunk/teraterm/layer_for_unicode/symbol_list.txt
===================================================================
--- trunk/teraterm/layer_for_unicode/symbol_list.txt	2022-09-18 16:07:06 UTC (rev 10274)
+++ trunk/teraterm/layer_for_unicode/symbol_list.txt	2022-09-19 15:40:47 UTC (rev 10275)
@@ -44,6 +44,7 @@
 kernel32 GetSystemDirectoryW @ 8
 kernel32 GetTempPathW @ 8
 kernel32 GetTempFileNameW @ 16
+kernel32 SystemParametersInfoW @ 16
 
 gdi32 AddFontResourceW @ 4
 gdi32 RemoveFontResourceW @ 4


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