[ttssh2-commit] [9417] hGetWindowTextW() で GetWindowTextLengthW() を使用するよう修正

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2021年 9月 14日 (火) 00:19:41 JST


Revision: 9417
          https://osdn.net/projects/ttssh2/scm/svn/commits/9417
Author:   zmatsuo
Date:     2021-09-14 00:19:41 +0900 (Tue, 14 Sep 2021)
Log Message:
-----------
hGetWindowTextW() で GetWindowTextLengthW() を使用するよう修正

- GetWindowTextLength() (GetWindowTextLengthA()) を使っていた

Modified Paths:
--------------
    trunk/teraterm/common/win32helper.cpp

-------------- next part --------------
Modified: trunk/teraterm/common/win32helper.cpp
===================================================================
--- trunk/teraterm/common/win32helper.cpp	2021-09-13 15:19:33 UTC (rev 9416)
+++ trunk/teraterm/common/win32helper.cpp	2021-09-13 15:19:41 UTC (rev 9417)
@@ -209,10 +209,15 @@
  */
 DWORD hGetWindowTextW(HWND hWnd, wchar_t **text)
 {
-	int len = GetWindowTextLength(hWnd);
+	// GetWindowTextLengthW() \x82\xAA 0 \x82\xF0\x95Ԃ\xB5\x82\xBD\x82Ƃ\xAB\x81A
+	// \x83G\x83\x89\x81[\x82Ȃ\xE7\x83G\x83\x89\x81[\x82\xAA\x83Z\x83b\x83g\x82\xB3\x82\xEA\x82邪\x81A
+	// \x83G\x83\x89\x81[\x82ł͂Ȃ\xA2\x82Ƃ\xAB(\x90\xB3\x8F\xED\x8FI\x97\xB9\x8E\x9E)\x81A\x83G\x83\x89\x81[\x82\xF0\x83N\x83\x8A\x83A\x82\xB5\x82Ȃ\xA2(\x83G\x83\x89\x81[\x82Ȃ\xB5\x82\xF0\x83Z\x83b\x83g\x82\xB5\x82Ȃ\xA2)
+	// \x82\xB1\x82\xB1\x82ŃG\x83\x89\x81[\x82\xF0\x83N\x83\x8A\x83A\x82\xB5\x82Ă\xA8\x82\xAD
+	SetLastError(NO_ERROR);
+	int len = GetWindowTextLengthW(hWnd);
 	if (len == 0) {
 		DWORD err = GetLastError();
-		if (err != 0) {
+		if (err != NO_ERROR) {
 			*text = NULL;
 			return err;
 		}


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