[Ttssh2-commit] [7998] Merge branch 'trunk' into unicode_buf

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 8月 20日 (火) 23:35:14 JST


Revision: 7998
          https://osdn.net/projects/ttssh2/scm/svn/commits/7998
Author:   zmatsuo
Date:     2019-08-20 23:35:14 +0900 (Tue, 20 Aug 2019)
Log Message:
-----------
Merge branch 'trunk' into unicode_buf

Modified Paths:
--------------
    branches/unicode_buf/CMakeLists.txt
    branches/unicode_buf/TTProxy/CMakeLists.txt
    branches/unicode_buf/TTProxy/ProxyWSockHook.h
    branches/unicode_buf/TTProxy/TTProxy.h
    branches/unicode_buf/TTProxy/TTProxy.rc
    branches/unicode_buf/TTProxy/YCL/include/YCL/Dialog.h
    branches/unicode_buf/TTProxy/YCL/include/YCL/HASHCODE.h
    branches/unicode_buf/TTProxy/YCL/include/YCL/Hashtable.h
    branches/unicode_buf/TTProxy/YCL/include/YCL/Window.h
    branches/unicode_buf/TTXKanjiMenu/CMakeLists.txt
    branches/unicode_buf/doc/en/html/about/ctrlseq.html
    branches/unicode_buf/doc/en/html/about/history.html
    branches/unicode_buf/doc/en/html/about/requirements.html
    branches/unicode_buf/doc/en/html/commandline/teraterm.html
    branches/unicode_buf/doc/en/html/commandline/ttssh.html
    branches/unicode_buf/doc/en/html/macro/command/bringupbox.html
    branches/unicode_buf/doc/en/html/macro/command/connect.html
    branches/unicode_buf/doc/en/html/macro/command/filecopy.html
    branches/unicode_buf/doc/en/html/macro/command/fileopen.html
    branches/unicode_buf/doc/en/html/macro/command/filetruncate.html
    branches/unicode_buf/doc/en/html/macro/command/index.html
    branches/unicode_buf/doc/en/html/macro/command/inputbox.html
    branches/unicode_buf/doc/en/html/macro/command/listbox.html
    branches/unicode_buf/doc/en/html/macro/command/logopen.html
    branches/unicode_buf/doc/en/html/macro/command/messagebox.html
    branches/unicode_buf/doc/en/html/macro/command/passwordbox.html
    branches/unicode_buf/doc/en/html/macro/command/setdlgpos.html
    branches/unicode_buf/doc/en/html/macro/command/statusbox.html
    branches/unicode_buf/doc/en/html/macro/command/yesnobox.html
    branches/unicode_buf/doc/en/html/macro/syntax/formats.html
    branches/unicode_buf/doc/en/html/macro/syntax/variables.html
    branches/unicode_buf/doc/en/html/menu/file-chdir.html
    branches/unicode_buf/doc/en/html/menu/file-new.html
    branches/unicode_buf/doc/en/html/menu/setup-additional.html
    branches/unicode_buf/doc/en/html/menu/setup-font.html
    branches/unicode_buf/doc/en/html/menu/setup-serialport.html
    branches/unicode_buf/doc/en/html/menu/setup-sshkeygenerator.html
    branches/unicode_buf/doc/en/html/menu/setup-window.html
    branches/unicode_buf/doc/en/html/reference/sourcecode.html
    branches/unicode_buf/doc/en/html/setup/teraterm-com.html
    branches/unicode_buf/doc/en/html/setup/teraterm-win.html
    branches/unicode_buf/doc/en/html/setup/teraterm.html
    branches/unicode_buf/doc/en/html/uninstall.html
    branches/unicode_buf/doc/en/html/usage/LogMeTT/LogMeTTTutorial.htm
    branches/unicode_buf/doc/en/html/usage/recurringcommand.html
    branches/unicode_buf/doc/en/html/usage/shortcut.html
    branches/unicode_buf/doc/en/html/usage/ttyrec.html
    branches/unicode_buf/doc/en/html/usage/unicode.html
    branches/unicode_buf/doc/ja/html/about/history.html
    branches/unicode_buf/doc/ja/html/about/requirements.html
    branches/unicode_buf/doc/ja/html/commandline/teraterm.html
    branches/unicode_buf/doc/ja/html/commandline/ttssh.html
    branches/unicode_buf/doc/ja/html/macro/command/bringupbox.html
    branches/unicode_buf/doc/ja/html/macro/command/connect.html
    branches/unicode_buf/doc/ja/html/macro/command/filecopy.html
    branches/unicode_buf/doc/ja/html/macro/command/fileopen.html
    branches/unicode_buf/doc/ja/html/macro/command/filetruncate.html
    branches/unicode_buf/doc/ja/html/macro/command/index.html
    branches/unicode_buf/doc/ja/html/macro/command/inputbox.html
    branches/unicode_buf/doc/ja/html/macro/command/kmtget.html
    branches/unicode_buf/doc/ja/html/macro/command/listbox.html
    branches/unicode_buf/doc/ja/html/macro/command/logopen.html
    branches/unicode_buf/doc/ja/html/macro/command/messagebox.html
    branches/unicode_buf/doc/ja/html/macro/command/passwordbox.html
    branches/unicode_buf/doc/ja/html/macro/command/setdlgpos.html
    branches/unicode_buf/doc/ja/html/macro/command/statusbox.html
    branches/unicode_buf/doc/ja/html/macro/command/yesnobox.html
    branches/unicode_buf/doc/ja/html/macro/howtorun.html
    branches/unicode_buf/doc/ja/html/macro/syntax/variables.html
    branches/unicode_buf/doc/ja/html/menu/file-chdir.html
    branches/unicode_buf/doc/ja/html/menu/file-new.html
    branches/unicode_buf/doc/ja/html/menu/setup-additional.html
    branches/unicode_buf/doc/ja/html/menu/setup-serialport.html
    branches/unicode_buf/doc/ja/html/menu/setup-sshkeygenerator.html
    branches/unicode_buf/doc/ja/html/menu/setup-window.html
    branches/unicode_buf/doc/ja/html/reference/sourcecode.html
    branches/unicode_buf/doc/ja/html/setup/teraterm-com.html
    branches/unicode_buf/doc/ja/html/uninstall.html
    branches/unicode_buf/doc/ja/html/usage/LogMeTT/LogMeTTTutorial.htm
    branches/unicode_buf/doc/ja/html/usage/keyboard.html
    branches/unicode_buf/doc/ja/html/usage/proxy.html
    branches/unicode_buf/doc/ja/html/usage/recurringcommand.html
    branches/unicode_buf/doc/ja/html/usage/shortcut.html
    branches/unicode_buf/doc/ja/html/usage/unicode.html
    branches/unicode_buf/installer/release/lang/English.lng
    branches/unicode_buf/installer/release/lang/French.lng
    branches/unicode_buf/installer/release/lang/German.lng
    branches/unicode_buf/installer/release/lang/Japanese.lng
    branches/unicode_buf/installer/release/lang/Korean.lng
    branches/unicode_buf/installer/release/lang/Russian.lng
    branches/unicode_buf/installer/release/lang/Simplified Chinese.lng
    branches/unicode_buf/installer/release/lang/Traditional Chinese.lng
    branches/unicode_buf/libs/SFMT.cmake
    branches/unicode_buf/libs/buildall.cmake
    branches/unicode_buf/libs/lib_zlib.cmake
    branches/unicode_buf/libs/oniguruma.cmake
    branches/unicode_buf/libs/openssl.cmake
    branches/unicode_buf/libs/zlib.cmake
    branches/unicode_buf/teraterm/CMakeLists.txt
    branches/unicode_buf/teraterm/common/codeconv.cpp
    branches/unicode_buf/teraterm/common/dlglib.c
    branches/unicode_buf/teraterm/common/dlglib.h
    branches/unicode_buf/teraterm/common/i18n.c
    branches/unicode_buf/teraterm/common/i18n.h
    branches/unicode_buf/teraterm/common/teraterm.h
    branches/unicode_buf/teraterm/common/tmfc.cpp
    branches/unicode_buf/teraterm/common/tmfc.h
    branches/unicode_buf/teraterm/common/tt_res.h
    branches/unicode_buf/teraterm/common/ttlib.c
    branches/unicode_buf/teraterm/common/tttypes.h
    branches/unicode_buf/teraterm/keycode/CMakeLists.txt
    branches/unicode_buf/teraterm/teraterm/CMakeLists.txt
    branches/unicode_buf/teraterm/teraterm/WSAAsyncGetAddrInfo.c
    branches/unicode_buf/teraterm/teraterm/WSAAsyncGetAddrInfo.h
    branches/unicode_buf/teraterm/teraterm/addsetting.cpp
    branches/unicode_buf/teraterm/teraterm/filesys.cpp
    branches/unicode_buf/teraterm/teraterm/ftdlg.cpp
    branches/unicode_buf/teraterm/teraterm/prnabort.cpp
    branches/unicode_buf/teraterm/teraterm/prnabort.h
    branches/unicode_buf/teraterm/teraterm/tekwin.cpp
    branches/unicode_buf/teraterm/teraterm/tekwin.h
    branches/unicode_buf/teraterm/teraterm/telnet.c
    branches/unicode_buf/teraterm/teraterm/teraprn.cpp
    branches/unicode_buf/teraterm/teraterm/teraterm.cpp
    branches/unicode_buf/teraterm/teraterm/teraterm.manifest
    branches/unicode_buf/teraterm/teraterm/teraterml.h
    branches/unicode_buf/teraterm/teraterm/ttdde.c
    branches/unicode_buf/teraterm/teraterm/ttermpro.rc
    branches/unicode_buf/teraterm/teraterm/ttime.c
    branches/unicode_buf/teraterm/teraterm/ttime.h
    branches/unicode_buf/teraterm/teraterm/ttplug.c
    branches/unicode_buf/teraterm/teraterm/ttwinman.c
    branches/unicode_buf/teraterm/teraterm/ttwinman.h
    branches/unicode_buf/teraterm/teraterm/vtdisp.c
    branches/unicode_buf/teraterm/teraterm/vtterm.c
    branches/unicode_buf/teraterm/teraterm/vtwin.cpp
    branches/unicode_buf/teraterm/teraterm/vtwin.h
    branches/unicode_buf/teraterm/ttpcmn/CMakeLists.txt
    branches/unicode_buf/teraterm/ttpcmn/ttcmn.c
    branches/unicode_buf/teraterm/ttpdlg/ttdlg.c
    branches/unicode_buf/teraterm/ttpfile/CMakeLists.txt
    branches/unicode_buf/teraterm/ttpfile/ttfile.c
    branches/unicode_buf/teraterm/ttpmacro/CMakeLists.txt
    branches/unicode_buf/teraterm/ttpmacro/ListDlg.cpp
    branches/unicode_buf/teraterm/ttpmacro/ListDlg.h
    branches/unicode_buf/teraterm/ttpmacro/ttl.c
    branches/unicode_buf/teraterm/ttpmacro/ttmdlg.cpp
    branches/unicode_buf/teraterm/ttpmacro/ttmdlg.h
    branches/unicode_buf/teraterm/ttpmacro/ttmmain.cpp
    branches/unicode_buf/teraterm/ttpmacro/wait4all.c
    branches/unicode_buf/teraterm/ttpset/CMakeLists.txt
    branches/unicode_buf/teraterm/ttpset/ttset.c
    branches/unicode_buf/teraterm/ttptek/CMakeLists.txt
    branches/unicode_buf/tests/gui_commands_test.ttl
    branches/unicode_buf/ttpmenu/CMakeLists.txt
    branches/unicode_buf/ttpmenu/ttpmenu.cpp
    branches/unicode_buf/ttpmenu/ttpmenu.h
    branches/unicode_buf/ttpmenu/winmisc.cpp
    branches/unicode_buf/ttssh2/ttxssh/CMakeLists.txt
    branches/unicode_buf/ttssh2/ttxssh/auth.c
    branches/unicode_buf/ttssh2/ttxssh/fwd.c
    branches/unicode_buf/ttssh2/ttxssh/fwdui.c
    branches/unicode_buf/ttssh2/ttxssh/hosts.c
    branches/unicode_buf/ttssh2/ttxssh/key.c
    branches/unicode_buf/ttssh2/ttxssh/sftp.c
    branches/unicode_buf/ttssh2/ttxssh/ssh.c
    branches/unicode_buf/ttssh2/ttxssh/ttxssh.c

Added Paths:
-----------
    branches/unicode_buf/installer/CMakeLists.txt
    branches/unicode_buf/libs/jom.cmake
    branches/unicode_buf/tests/#39452.ttl

-------------- next part --------------
Modified: branches/unicode_buf/CMakeLists.txt
===================================================================
--- branches/unicode_buf/CMakeLists.txt	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -12,6 +12,9 @@
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
 
+string(TIMESTAMP SNAPSHOT_DIR "snapshot-%Y%m%d_%H%M%S")
+set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/${SNAPSHOT_DIR}")
+
 # _WIN32_WINNT_WIN10 0x0a00
 set(_WIN32_WINNT "0x0a00")
 if(MSVC)
@@ -106,6 +109,7 @@
 if(${ENABLE_TTXSAMPLES})
   add_subdirectory(TTXSamples)
 endif()
+add_subdirectory(installer)
 
 ####
 # ソースツリー内に生成ファイルが存在していたら削除する

Modified: branches/unicode_buf/TTProxy/CMakeLists.txt
===================================================================
--- branches/unicode_buf/TTProxy/CMakeLists.txt	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/TTProxy/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -109,3 +109,9 @@
   gdi32
   comdlg32
   )
+
+install(
+  TARGETS ttproxy
+  RUNTIME
+  DESTINATION .
+  )

Modified: branches/unicode_buf/TTProxy/ProxyWSockHook.h
===================================================================
--- branches/unicode_buf/TTProxy/ProxyWSockHook.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/TTProxy/ProxyWSockHook.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -72,8 +72,8 @@
                     event = 0;
                 }
             }
-            operator int()const {
-                return window == NULL && message == 0 && event == 0 ? 0 : (int) window;
+            operator HWND() const {
+                return window == NULL && message == 0 && event == 0 ? 0 : window;
             }
         };
         Hashtable<SOCKET, AsyncSelectInfo> table;
@@ -618,12 +618,14 @@
         HANDLE getTask(ConnectionInfo* info) {
             if (info == NULL)
                 return NULL;
-            return (HANDLE) -info->addr.S_un.S_un_b.s_b4;
+			// s_b4\x82̃}\x83C\x83i\x83X\x82̒l\x82\xF0\x83n\x83\x93\x83h\x83\x8B\x82Ƃ\xB5\x82Ďg\x97p\x82\xB7\x82\xE9
+            return (HANDLE)(intptr_t)-info->addr.S_un.S_un_b.s_b4;
         }
         ConnectionInfo* get(HANDLE task) {
-            if ((DWORD) task >= 0)
+			// \x83n\x83\x93\x83h\x83\x8B\x82͐\x94\x92l\x82Ƃ\xB5\x82ă}\x83C\x83i\x83X\x82̒l\x82̂͂\xB8
+            if ((intptr_t) task >= 0)
                 return NULL;
-            return get((int) -((long) task) - 1);
+            return get((int) -((intptr_t) task) - 1);
         }
         ConnectionInfo* get(in_addr addr) {
             if (addr.S_un.S_un_b.s_b1 != 0 || addr.S_un.S_un_b.s_b2 != 0 || addr.S_un.S_un_b.s_b3 != 0)
@@ -715,9 +717,8 @@
         Window conn;
         Window erro;
         Window log;
-//      HFONT DlgFont;
     protected:
-        virtual bool dispatch(int message, int wParam, long lParam) {
+        virtual bool dispatch(UINT message, WPARAM wParam, LPARAM lParam) {
             if (message == WM_COMMAND && wParam == MAKEWPARAM(IDC_REFER, BN_CLICKED)) {
                 char buffer[1024];
                 char uimsg[MAX_UIMSG];
@@ -890,7 +891,7 @@
         EditBoxCtrl  pass;
         bool lock;
     protected:
-        virtual bool dispatch(int message, int wParam, long lParam) {
+        virtual bool dispatch(UINT message, WPARAM wParam, LPARAM lParam) {
             if (message == WM_COMMAND) {
                 switch (wParam) {
                 case MAKEWPARAM(IDC_OPTIONS, BN_CLICKED):

Modified: branches/unicode_buf/TTProxy/TTProxy.h
===================================================================
--- branches/unicode_buf/TTProxy/TTProxy.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/TTProxy/TTProxy.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -191,10 +191,6 @@
 		          getInstance().ts->UILanguageFile, _TRUNCATE);
 	}
 
-	static BOOL CALLBACK EnumProc(HMODULE, const char*, const char*, WORD langid, LONG lParam) {
-		*((WORD*) lParam) = langid;
-		return FALSE;
-	}
 	static void PASCAL TTXInit(PTTSet ts, PComVar cv) {
 		getInstance().ts = ts;
 		getInstance().cv = cv;

Modified: branches/unicode_buf/TTProxy/TTProxy.rc
===================================================================
--- branches/unicode_buf/TTProxy/TTProxy.rc	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/TTProxy/TTProxy.rc	2019-08-20 14:35:14 UTC (rev 7998)
@@ -82,8 +82,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,24
- PRODUCTVERSION 1,0,0,24
+ FILEVERSION 1,0,0,25
+ PRODUCTVERSION 1,0,0,25
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -101,12 +101,12 @@
             VALUE "Comments", "\x83v\x83\x8D\x83L\x83V\x8Co\x97R\x82ł̒ʐM\x82\xF0\x83T\x83|\x81[\x83g\x82\xB7\x82\xE9\x83v\x83\x89\x83O\x83C\x83\x93\x81B"
             VALUE "CompanyName", "\x95g\x8Eq\x89\xAE\x96{\x95\xDC, TeraTerm Project"
             VALUE "FileDescription", "\x83v\x83\x8D\x83L\x83V\x83v\x83\x89\x83O\x83C\x83\x93"
-            VALUE "FileVersion", "1, 0, 0, 24"
+            VALUE "FileVersion", "1, 0, 0, 25"
             VALUE "InternalName", "TTProxy"
-            VALUE "LegalCopyright", "Copyright (C) 2003-2006 \x95g\x8Eq\x89\xAE\x96{\x95\xDC, (C) 2004-2016 TeraTerm Project"
+            VALUE "LegalCopyright", "Copyright (C) 2003-2006 \x95g\x8Eq\x89\xAE\x96{\x95\xDC, (C) 2004-2019 TeraTerm Project"
             VALUE "OriginalFilename", "TTXProxy.dll"
             VALUE "ProductName", "\x95g\x8Eq\x89\xAE\x96{\x95܃v\x83\x8D\x83L\x83V\x83v\x83\x89\x83O\x83C\x83\x93\x8FW"
-            VALUE "ProductVersion", "1, 0, 0, 24"
+            VALUE "ProductVersion", "1, 0, 0, 25"
         END
     END
     BLOCK "VarFileInfo"
@@ -134,8 +134,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,24
- PRODUCTVERSION 1,0,0,24
+ FILEVERSION 1,0,0,25
+ PRODUCTVERSION 1,0,0,25
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -153,12 +153,12 @@
             VALUE "Comments", "Plug-in that supports communication by way of proxy"
             VALUE "CompanyName", "Yebisuya Hompo, TeraTerm Project"
             VALUE "FileDescription", "Proxy plug-in"
-            VALUE "FileVersion", "1, 0, 0, 24"
+            VALUE "FileVersion", "1, 0, 0, 25"
             VALUE "InternalName", "TTProxy"
-            VALUE "LegalCopyright", "Copyright (C) 2003-2006 Yebisuya Hompo, (C) 2004-2016 TeraTerm Project"
+            VALUE "LegalCopyright", "Copyright (C) 2003-2006 Yebisuya Hompo, (C) 2004-2019 TeraTerm Project"
             VALUE "OriginalFilename", "TTXProxy.dll"
             VALUE "ProductName", "Proxy plug-in collection of Yebisuya Hompo"
-            VALUE "ProductVersion", "1, 0, 0, 24"
+            VALUE "ProductVersion", "1, 0, 0, 25"
         END
     END
     BLOCK "VarFileInfo"
@@ -231,7 +231,7 @@
 CAPTION "About TTProxy"
 FONT 8, "Tahoma", 0, 0, 0x0
 BEGIN
-    LTEXT           "TTProxy\n%s, %d.%d.%d.%d\nCopyright (C) 2003-2006 %s\n%s: http://yebisuya.dip.jp/Software/TTProxy/\n(C) 2006-2015 TeraTerm Project\nTeraTerm Project: https://ttssh2.osdn.jp/",IDC_VERSION,7,7,212,52
+    LTEXT           "TTProxy\n%s, %d.%d.%d.%d\nCopyright (C) 2003-2006 %s\n%s: http://yebisuya.dip.jp/Software/TTProxy/\n(C) 2006-2019 TeraTerm Project\nTeraTerm Project: https://ttssh2.osdn.jp/",IDC_VERSION,7,7,212,52
     DEFPUSHBUTTON   "OK",IDOK,82,63,50,14
 END
 

Modified: branches/unicode_buf/TTProxy/YCL/include/YCL/Dialog.h
===================================================================
--- branches/unicode_buf/TTProxy/YCL/include/YCL/Dialog.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/TTProxy/YCL/include/YCL/Dialog.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -31,7 +31,7 @@
 		initializeing = next;
 		return prev;
 	}
-	static BOOL CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wParam, LPARAM lParam) {
+	static INT_PTR CALLBACK DialogProc(HWND dialog, UINT message, WPARAM wParam, LPARAM lParam) {
 		Map& map = getMap();
 		Dialog* target = map.get(dialog);
 		if (target == NULL) {
@@ -53,7 +53,7 @@
 				|| message == WM_CTLCOLORLISTBOX
 				|| message == WM_CTLCOLORSCROLLBAR
 				|| message == WM_CTLCOLORSTATIC)) {
-			result = (BOOL) ::GetWindowLong(dialog, DWL_MSGRESULT);
+			result = (BOOL) ::GetWindowLongPtr(dialog, DWLP_MSGRESULT);
 		}
 		return result;
 	}
@@ -87,7 +87,7 @@
 	}
 
 	void setResult(LRESULT result) {
-		SetWindowLong(DWL_MSGRESULT, result);
+		SetWindowLongPtr(DWLP_MSGRESULT, result);
 	}
 	int getDefID()const {
 		return LOWORD(SendMessage(DM_GETDEFID));
@@ -118,7 +118,7 @@
 #endif
 	}
 protected:
-	virtual bool dispatch(int message, int wparam, long lparam) {
+	virtual bool dispatch(UINT message, WPARAM wparam, LPARAM lparam) {
 		switch (message) {
 		case WM_INITDIALOG:
 			return onInitDialog();

Modified: branches/unicode_buf/TTProxy/YCL/include/YCL/HASHCODE.h
===================================================================
--- branches/unicode_buf/TTProxy/YCL/include/YCL/HASHCODE.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/TTProxy/YCL/include/YCL/HASHCODE.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -27,6 +27,10 @@
 	}
 	HASHCODE(const void* value):value((int)(uintptr_t) value) {
 	}
+	HASHCODE(const FARPROC value) :value((int)(uintptr_t)value) {
+	}
+	HASHCODE(SOCKET value) :value((int)(uintptr_t)value) {
+	}
 	HASHCODE(int value):value(value) {
 	}
 	operator int()const {

Modified: branches/unicode_buf/TTProxy/YCL/include/YCL/Hashtable.h
===================================================================
--- branches/unicode_buf/TTProxy/YCL/include/YCL/Hashtable.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/TTProxy/YCL/include/YCL/Hashtable.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -122,7 +122,7 @@
 	//	\x91S\x82ẴG\x83\x93\x83g\x83\x8A\x82\xAA\x90ݒ\xE8\x8Dς݂\xC5key\x82Ɠ\x99\x82\xB5\x82\xA2\x82\xE0\x82̂\xAA\x82Ȃ\xAF\x82\xEA\x82\xCE-1\x82\xF0\x95Ԃ\xB7\x81B
 	int find(const TYPE_KEY& key)const {
 		int found = -1;
-		int h = HASHCODE(&key);
+		int h = HASHCODE(key);
 		for (int i = 0; i < backetSize; i++) {
 			int index = ((unsigned) h + i) % backetSize;
 			const TYPE_KEY& bkey = backet[index].key;

Modified: branches/unicode_buf/TTProxy/YCL/include/YCL/Window.h
===================================================================
--- branches/unicode_buf/TTProxy/YCL/include/YCL/Window.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/TTProxy/YCL/include/YCL/Window.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -30,11 +30,11 @@
 		return window;
 	}
 
-	long GetWindowLong(int index)const {
-		return ::GetWindowLong(window, index);
+	LONG_PTR GetWindowLongPtr(int index)const {
+		return ::GetWindowLongPtr(window, index);
 	}
-	long SetWindowLong(int index, long data) {
-		return ::SetWindowLong(window, index, data);
+	LONG_PTR SetWindowLongPtr(int index, LONG_PTR data) {
+		return ::SetWindowLongPtr(window, index, data);
 	}
 	int GetWindowTextLength()const {
 		return ::GetWindowTextLength(window);
@@ -51,10 +51,10 @@
 	bool SetWindowText(const char* text) {
 		return ::SetWindowText(window, text) != FALSE;
 	}
-	long SendMessage(int message, int wparam = 0, long lparam = 0)const {
+	LRESULT SendMessage(UINT message, WPARAM wparam = 0, LPARAM lparam = 0)const {
 		return ::SendMessage(window, message, wparam, lparam);
 	}
-	long PostMessage(int message, int wparam = 0, long lparam = 0)const {
+	LRESULT PostMessage(UINT message, WPARAM wparam = 0, LPARAM lparam = 0)const {
 		return ::PostMessage(window, message, wparam, lparam);
 	}
 	HWND GetParent()const {
@@ -63,10 +63,10 @@
 	bool EnableWindow(bool enabled) {
 		return ::EnableWindow(window, enabled) != FALSE;
 	}
-	long DefWindowProc(int message, int wparam, long lparam) {
+	LRESULT DefWindowProc(int message, int wparam, long lparam) {
 		return ::DefWindowProc(window, message, wparam, lparam);
 	}
-	long CallWindowProc(WNDPROC proc, int message, int wParam, long lParam) {
+	LRESULT CallWindowProc(WNDPROC proc, int message, int wParam, long lParam) {
 		return ::CallWindowProc(proc, window, message, wParam, lParam);
 	}
 	bool ShowWindow(int command) {
@@ -90,7 +90,7 @@
 	bool IsZoomed()const {
 		return ::IsZoomed(window) != FALSE;
 	}
-	int SetTimer(int id, int elapse, TIMERPROC timerProc = NULL) {
+	UINT_PTR SetTimer(int id, int elapse, TIMERPROC timerProc = NULL) {
 		return ::SetTimer(window, id, elapse, timerProc);
 	}
 	bool KillTimer(int id) {
@@ -236,11 +236,11 @@
 		}
 		return MessageBox(message, top.GetWindowText(), type);
 	}
-	long GetClassLong(int index)const {
-		return ::GetClassLong(window, index);
+	ULONG_PTR GetClassLongPtr(int index)const {
+		return ::GetClassLongPtr(window, index);
 	}
-	long SetClassLong(int index, long data) {
-		return ::SetClassLong(window, index, data);
+	ULONG_PTR SetClassLongPtr(int index, LONG_PTR data) {
+		return ::SetClassLongPtr(window, index, data);
 	}
 
 	bool create(long exStyle, const char* classname, const char* title, long style, const RECT& rect, HWND parent, HMENU menu, void* param = NULL) {
@@ -266,29 +266,29 @@
 	HICON setIcon(HICON icon, bool large) {
 		return (HICON) SendMessage(WM_SETICON, large, (LPARAM) icon);
 	}
-	long getStyle()const {
-		return GetWindowLong(GWL_STYLE);
+	LONG_PTR getStyle()const {
+		return GetWindowLongPtr(GWL_STYLE);
 	}
-	long getExStyle()const {
-		return GetWindowLong(GWL_EXSTYLE);
+	LONG_PTR getExStyle()const {
+		return GetWindowLongPtr(GWL_EXSTYLE);
 	}
-	long setStyle(long style) {
-		return SetWindowLong(GWL_STYLE, style);
+	LONG_PTR setStyle(LONG_PTR style) {
+		return SetWindowLongPtr(GWL_STYLE, style);
 	}
-	long setExStyle(long exStyle) {
-		return SetWindowLong(GWL_EXSTYLE, exStyle);
+	LONG_PTR setExStyle(LONG_PTR exStyle) {
+		return SetWindowLongPtr(GWL_EXSTYLE, exStyle);
 	}
 	WNDPROC getWndProc()const {
-		return (WNDPROC) GetWindowLong(GWL_WNDPROC);
+		return (WNDPROC) GetWindowLongPtr(GWLP_WNDPROC);
 	}
 	WNDPROC setWndProc(WNDPROC proc) {
-		return (WNDPROC) SetWindowLong(GWL_WNDPROC, (long) proc);
+		return (WNDPROC) SetWindowLongPtr(GWLP_WNDPROC, (LONG_PTR) proc);
 	}
 	HWND getOwner()const {
-		return (HWND) GetWindowLong(GWL_HWNDPARENT);
+		return (HWND) GetWindowLongPtr(GWLP_HWNDPARENT);
 	}
 	HWND setOwner(HWND owner) {
-		return (HWND) SetWindowLong(GWL_HWNDPARENT, (long) owner);
+		return (HWND) SetWindowLongPtr(GWLP_HWNDPARENT, (LONG_PTR) owner);
 	}
 	HWND getChildWindow()const {
 		return GetWindow(GW_CHILD);
@@ -312,7 +312,7 @@
 #define WS_EX_LAYERED 0x80000
 #endif
 	void setAlpha(BYTE alpha) {
-		long exStyle = getExStyle();
+		LONG_PTR exStyle = getExStyle();
 		if ((exStyle & WS_EX_LAYERED) == 0)
 			setExStyle(exStyle | WS_EX_LAYERED);
 		SetLayeredWindowAttributes(alpha, 2);
@@ -322,41 +322,43 @@
 		return rect;
 	}
 	ATOM getClassAtom()const {
-		return (ATOM) GetClassLong(GCW_ATOM);
+		return (ATOM) GetClassLongPtr(GCW_ATOM);
 	}
-	long getClassExtra()const {
-		return GetClassLong(GCL_CBCLSEXTRA);
+	LONG_PTR getClassExtra()const {
+		return GetClassLongPtr(GCL_CBCLSEXTRA);
 	}
-	long getWindowExtra()const {
-		return GetClassLong(GCL_CBWNDEXTRA);
+	LONG_PTR getWindowExtra()const {
+		return GetClassLongPtr(GCL_CBWNDEXTRA);
 	}
 	HBRUSH getBackgroundBrush()const {
-		return (HBRUSH) GetClassLong(GCL_HBRBACKGROUND);
+		return (HBRUSH) GetClassLongPtr(GCLP_HBRBACKGROUND);
 	}
 	HCURSOR getClassCursor()const {
-		return (HCURSOR) GetClassLong(GCL_HCURSOR);
+		return (HCURSOR) GetClassLongPtr(GCLP_HCURSOR);
 	}
 	HICON getClassIcon()const {
-		return (HICON) GetClassLong(GCL_HICON);
+		return (HICON) GetClassLongPtr(GCLP_HICON);
 	}
 	HICON getClassSmallIcon()const {
-		return (HICON) GetClassLong(GCL_HICONSM);
+		return (HICON) GetClassLongPtr(GCLP_HICONSM);
 	}
 	HINSTANCE getClassInstance()const {
-		return (HINSTANCE) GetClassLong(GCL_HMODULE);
+		return (HINSTANCE) GetClassLongPtr(GCLP_HMODULE);
 	}
-	int getMenuResourceId()const {
-		return GetClassLong(GCL_MENUNAME);
+	LONG_PTR getMenuResourceId()const {
+		return GetClassLongPtr(GCLP_MENUNAME);
 	}
-	int getClassStyle()const {
-		return GetClassLong(GCL_STYLE);
+	LONG_PTR getClassStyle()const {
+		return GetClassLongPtr(GCL_STYLE);
 	}
 	WNDPROC getClassWindowProc()const {
-		return (WNDPROC) GetClassLong(GCL_WNDPROC);
+		return (WNDPROC) GetClassLongPtr(GCLP_WNDPROC);
 	}
 };
 
+#if defined(_MSC_VER)
 #pragma comment(lib, "user32.lib")
+#endif
 }
 
 #endif//_YCL_WINDOWS_H_

Modified: branches/unicode_buf/TTXKanjiMenu/CMakeLists.txt
===================================================================
--- branches/unicode_buf/TTXKanjiMenu/CMakeLists.txt	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/TTXKanjiMenu/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -37,4 +37,8 @@
   ws2_32
   )
 
-
+install(
+  TARGETS ttxkanjimenu
+  RUNTIME
+  DESTINATION .
+  )

Modified: branches/unicode_buf/doc/en/html/about/ctrlseq.html
===================================================================
--- branches/unicode_buf/doc/en/html/about/ctrlseq.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/about/ctrlseq.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -947,7 +947,7 @@
 <!-- tr><td> 13 </td>		<td>Change VT Window's mouse cursor color to <i>Pt</i>. Format of <i>Pt</i> is same as OSC 4's <i>spec</i>. </td></tr -->
 <!-- tr><td> 14 </td>		<td>Change VT Window's mouse cursor background color to <i>Pt</i>. Format of <i>Pt</i> is same as OSC 4's <i>spec</i>. </td></tr -->
 <tr><td> 15 </td>		<td>Change TEK Window's text color to <i>Pt</i>. Format of <i>Pt</i> is same as OSC 4's <i>spec</i>. </td></tr>
-<tr><td> 16 </td>		<td>Change TEK Window's background color to <i>Pt</i>. Format of <i>Pt</i> is same as OSC 4's <i>spec</i>. </td></tr -->
+<tr><td> 16 </td>		<td>Change TEK Window's background color to <i>Pt</i>. Format of <i>Pt</i> is same as OSC 4's <i>spec</i>. </td></tr>
 <!-- tr><td> 17 </td>		<td>Change hightlight background color to <i>Pt</i>. Format of <i>Pt</i> is same as OSC 4's <i>spec</i>. </td></tr -->
 <!-- tr><td> 18 </td>		<td>Change TEK Window's cursor color to <i>Pt</i>. Format of <i>Pt</i> is same as OSC 4's <i>spec</i>. </td></tr -->
 <!-- tr><td> 19 </td>		<td>Change hightlight text color to <i>Pt</i>. Format of <i>Pt</i> is same as OSC 4's <i>spec</i>. </td></tr -->
@@ -971,7 +971,7 @@
 <!-- tr><td> 113 </td>		<td>Reset VT Window's mouse cursor color. </td></tr -->
 <!-- tr><td> 114 </td>		<td>Reset VT Window's mouse cursor background color. </td></tr -->
 <tr><td> 115 </td>		<td>Reset TEK Window's text color. </td></tr>
-<tr><td> 116 </td>		<td>Reset TEK Window's background color. </td></tr -->
+<tr><td> 116 </td>		<td>Reset TEK Window's background color. </td></tr>
 <!-- tr><td> 117 </td>		<td>Reset hightlight background color. </td></tr -->
 <!-- tr><td> 118 </td>		<td>Reset TEK Window's cursor text color. </td></tr -->
 <!-- tr><td> 119 </td>		<td>Reset hightlight text color. </td></tr -->

Modified: branches/unicode_buf/doc/en/html/about/history.html
===================================================================
--- branches/unicode_buf/doc/en/html/about/history.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/about/history.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -35,12 +35,26 @@
 <ul class="history">
   <li>Changes
     <ul>
-      <li></li>
+      <li>MARCO: The <a href="../macro/command/fileopen.html">fileopen</a> command does not cause an error when a file can not be opened. Reverted changes in Ver 4.102.</li>
+      <li>MACRO: When <a href="../macro/command/filetruncate.html">filetruncate</a> command does not cause an error when a file can not be opened, or file size can not be changed.</li>
+      <li>The environment variable included in <a href="../menu/file-chdir.html">directory for file transfers</a> becomes to be expanded.</li>
+      <li>Unspecified string font in IME uses your defined font.</li>
+      <li>The <a href="../setup/teraterm-win.html#textselect">Disabling text selection when the window is activated by mouse</a> configuration can be set up on the <a href="../menu/setup-additional.html#SelectOnActivate">Additional settings dialog</a>.</li>
     </ul>
   </li>
   <li>Bug fixes
     <ul>
-      <li></li>
+      <li>When the Active Window Tracking is enabled, mouse cursor won't be active in Tera Term window. This bug was introduced in 4.103.</li>
+      <li>When UTF-8 characters received, 4-byte UTF-8 characters are miss-decorded.</li>
+      <li>The plugin compiled before 4.103 can not called because the DLL's calling convention is changed in Tera Term 4.103. </li>
+      <li>Displayed unspecified string font in IME changes, when you open the font setting dialog.</li>
+      <li>The session number of window title is always 1.</li>
+      <li>MACRO: <a href="../macro/command/filecopy.html">filecopy</a> command may not store the result to result system variable.</li>
+      <li>A big file can not send by using [File]/[Send file..]. This bug was introduced in 4.103.</li>
+      <li>MACRO: <a href="../macro/command/filelock.html">filelock</a> and <a href="../macro/command/fileunlock.html">fileunlock</a> command always fail. This bug was introduced in 4.101.</li>
+      <li>MACRO: When the first byte of the file is matched by using <a href="../macro/command/filestrseek2.html">filestrseek2</a> command, the file pointer is invalid. This bug was introduced in 4.101.</li>
+      <li>Cancel printing dialog can not be shown. This bug was introduced in 4.103.</li>
+      <li>When the locale setting is default(japanese) or invalid on English version of Windows, an application fault immediately occurs after starting Tera Term.</li>
     </ul>
   </li>
 
@@ -47,6 +61,7 @@
   <li>Misc
     <ul>
       <li>upgraded TTSSH to <a href="#ttssh_2.90">2.90</a>.</li>
+      <li>upgraded TTProxy to <a href="#ttproxy_1.0.0.25">1.0.0.25</a>.</li>
     </ul>
   </li>
 </ul>
@@ -3157,7 +3172,10 @@
 
   <li>Bug fixes
     <ul>
-      <li>When SSH communication is slow by using port forwarding, an application fault is occurred due to increase memory consumption.</li>
+      <li>SSH2: When SSH communication is slow by using port forwarding, an application fault is occurred due to increase memory consumption.</li>
+      <li>SSH2: When SCP transfer dialog is closed, the directory of file transfer setting and the SCP destination path setting may not be updated.</li>
+      <li>SSH1: When the destination port number is other than 22, an application fault may be occurred after the host key is newly written to known_hosts file.</li>
+      <li>SSH1: The rhosts authentication could not be performed at all.</li>
     </ul>
   </li>
 
@@ -3272,7 +3290,7 @@
         </ul></li>
       <li>The minimum group size of the Diffie-Hellman group exchange key exchange method is increased to 2048. (RFC 8270)
         <ul>
-          <li>To change to the previous behavior, set the GexMinimalGroupSize entry in teraterm.ini file to 1024.</li></li>
+          <li>To change to the previous behavior, set the GexMinimalGroupSize entry in teraterm.ini file to 1024.</li>
         </ul></li>
     </ul>
   </li>
@@ -3304,7 +3322,7 @@
           <li>aes12****@opens*****</li>
           <li>aes25****@opens*****</li>
         </ul></li>
-      <li>added support for SSH2 MAC algorithms:</li>
+      <li>added support for SSH2 MAC algorithms:
         <ul>
           <li>hmac-****@opens*****</li>
           <li>hmac-****@opens*****</li>
@@ -4771,6 +4789,11 @@
 
 <h2 id="ttproxy">TTProxy</h2>
 
+<h3 id="ttproxy_1.0.0.25">2019.xx.xx (Ver 1.0.0.25)</h3>
+<ul class="history">
+      <li>Depending on OS, it's not working correctly. This bug was introduced in 4.103.</li>
+</ul>
+
 <h3 id="ttproxy_1.0.0.24">2016.11.30 (Ver 1.0.0.24)</h3>
 <ul class="history">
       <li>When an authentication is used on HTTP proxy, Tera Term(TTProxy) will be crashed.</li>

Modified: branches/unicode_buf/doc/en/html/about/requirements.html
===================================================================
--- branches/unicode_buf/doc/en/html/about/requirements.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/about/requirements.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -34,6 +34,7 @@
 <p class="notice">
 NOTE1: Not supporting Microsoft Windows 3.1.<br>
 NOTE2: Supporting x64 and IA-64 Windows.(by WOW64)<br>
+NOTE3: Tera Term's installer does not support less than Windows 2000(version 4.95 or later).<br>
 (*1) <a href="http://support.microsoft.com/kb/182108">Windows Sockets2.0</a> requirement<br>
 (*2) Internet Explorer 5 later requirement<br>
 (*3) LogMeTT and TTLEditor can not work.<br>

Modified: branches/unicode_buf/doc/en/html/commandline/teraterm.html
===================================================================
--- branches/unicode_buf/doc/en/html/commandline/teraterm.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/commandline/teraterm.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -72,7 +72,9 @@
         <li><span class="syntax">/C=3</span> COM3</li>
         <li>:</li>
         <li><span class="syntax">/C=256</span> COM256</li>
-      </ul></dd>
+      </ul>
+      By default, maximum serial port number is 256. It is configurable in <a href="../setup/teraterm-com.html#maxport">MaxComPort</a> setting.
+      </dd>
 
 <!--
   <dt id="duplicate">/DUPLICATE</dt>
@@ -94,7 +96,7 @@
       </dd>
 
   <dt id="f">/F=<setup file></dt>
-  <dd>Setup file</a><br>
+  <dd>Setup file<br>
       <span class="syntax">/F=TERATERM.INI</span> (default)<br>
       If this value is not a full path, it is understood as a relative path from ttermpro.exe.</dd>
 
@@ -275,7 +277,7 @@
 
 <p id="note2">
 [2] If the parameter value can include the space character and semicolon, a user should put the value in quotations by using `"' character.<br />
-If the value includes the `"' character, the user should write the `"' character two times.
+If the value includes the `"' character, the user should write the `"' character two times.(version 4.63 or later)
 </p>
 
 <pre>

Modified: branches/unicode_buf/doc/en/html/commandline/ttssh.html
===================================================================
--- branches/unicode_buf/doc/en/html/commandline/ttssh.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/commandline/ttssh.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -177,9 +177,13 @@
 </dl>
 
 <p>
-If the parameter value can include the space character and semicolon, a user should put the value in quotations by using `"' character.<br />
-If the value includes the `"' character, the user should write the `"' character two times.
+If the parameter value can include the space character and semicolon, a user should put the value in quotations by using `"' character. (version 4.63(TTSSH 2.51) or later)<br />
+If the value includes the `"' character, the user should write the `"' character two times. (version 4.63(TTSSH 2.51) or later)
 </p>
+<p>
+<strong>Old specification</strong><br />
+If the value include the '@', the user should put write `@' character. If the value includes the `@' character, the user should write the `@' character two times. (version 4.10 to 4.62(TTSSH 1.08 to 2.50))
+</p>
 
 
 <h2 id="example1">Example</h2>

Modified: branches/unicode_buf/doc/en/html/macro/command/bringupbox.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/bringupbox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/bringupbox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -53,6 +53,8 @@
 <h2>See also</h2>
 <ul>
   <li><a href="statusbox.html">statusbox</a></li>
+  <li><a href="closesbox.html">closesbox</a></li>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
 </ul>
 
 </body>

Modified: branches/unicode_buf/doc/en/html/macro/command/connect.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/connect.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/connect.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -210,7 +210,7 @@
 ; authentication, and not prompt for user name and password and use private key file.
 connect '<em>myserver</em> /ssh /auth=pageant /user=<em>username</em>'
 
-; Run Tera Term and open serial port connection. Port number is x=1..256
+; Run Tera Term and open serial port connection. Port number is x=1..Maximum value(MaxComPort).
 connect '/C=x'
 
 CommandLine = '111.111.11.11'

Modified: branches/unicode_buf/doc/en/html/macro/command/filecopy.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/filecopy.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/filecopy.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -26,9 +26,42 @@
 <p>
 Copies file <file1> to file <file2>.<br>
 If <file2> already exists, it is overwritten. <file1> and <file2> must not be same.<br>
-If the file is deleted successfully, the system variable "result" is set to 0. Otherwise, "result" is set to non-zero.
+If the file is copy successfully, the system variable "result" is set to 0. Otherwise, "result" is set to non-zero. (version 4.104 or later)
 </p>
 
+<h2>Value of the system variable "result"</h2>
+
+<p>
+As a result of this command, the system variable "result" is set to one of the following values depending on the copy status:
+</p>
+
+<table>
+ <tr>
+  <th>Value</th>
+  <th>Status</th>
+ </tr>
+ <tr>
+  <td>-4</td>
+  <td>Copy failed.</td>
+ </tr>
+ <tr>
+  <td>-3</td>
+  <td>A file <file1> and file <file2> is same of name.</td>
+ </tr>
+ <tr>
+  <td>-2</td>
+  <td>Be used invalid characters to file <file2>.</td>
+ </tr>
+ <tr>
+  <td>-1</td>
+  <td>Be used invalid characters to file <file1>.</td>
+ </tr>
+ <tr>
+  <td>0</td>
+  <td>Copy succeeded.</td>
+ </tr>
+</table>
+
 <h2>Example</h2>
 
 <pre class="macro-example">

Modified: branches/unicode_buf/doc/en/html/macro/command/fileopen.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/fileopen.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/fileopen.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -26,7 +26,8 @@
 <dl>
 	<dt class="macro">integer variable <file handle></dt>
 	<dd>If the file is successfully opened, the file handle is returned in this variable.<br />
-        Otherwise, <file handle> is set to -1.</dd>
+        version 4.101 or earlier, and 4.104 or later: Otherwise, <file handle> is set to -1. The macro error does not cause.<br />
+        version 4.102 and 4.103: Otherwise, <file handle> is set to -1. The macro script is halted after the macro eror causes.</dd>
 
 	<dt class="macro">string <filename></dt>
 	<dd>Specify an opened file name<br />

Modified: branches/unicode_buf/doc/en/html/macro/command/filetruncate.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/filetruncate.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/filetruncate.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -26,8 +26,9 @@
 <p>
 Changes the <size> bytes of a <filename> file.<br>
 Null characters('\0') are appended if the file is extended.<br>
-<br>
+</p>
 
+<p>
 The system variable "result" value is set to 0 if the file size is successfully changed. 
 The system variable "result" value of -1 indicates an error.
 </p>

Modified: branches/unicode_buf/doc/en/html/macro/command/index.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/index.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/index.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -80,7 +80,7 @@
  <li><a href="waitevent.html">waitevent</a>
  <li><a href="waitln.html">waitln</a>
  <li><a href="waitn.html">waitn</a> (version 4.62 or later)
- <li><a href="waitrecv.html">waitrecv</a></a>
+ <li><a href="waitrecv.html">waitrecv</a>
  <li><a href="waitregex.html">waitregex</a> (version 4.21 or later)
  <li><a href="xmodemrecv.html">xmodemrecv</a>
  <li><a href="xmodemsend.html">xmodemsend</a>

Modified: branches/unicode_buf/doc/en/html/macro/command/inputbox.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/inputbox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/inputbox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -74,7 +74,11 @@
 
 <h2>See also</h2>
 <ul>
+  <li><a href="passwordbox.html">passwordbox</a></li>
+  <li><a href="listbox.html">listbox</a></li>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
   <li><a href="strspecial.html">strspecial</a></li>
+  <li><a href="yesnobox.html">yesnobox</a></li>
 </ul>
 
 </body>

Modified: branches/unicode_buf/doc/en/html/macro/command/listbox.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/listbox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/listbox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -109,6 +109,9 @@
 
 <h2>See also</h2>
 <ul>
+  <li><a href="inputbox.html">inputbox</a></li>
+  <li><a href="passwordbox.html">passwordbox</a></li>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
   <li><a href="yesnobox.html">yesnobox</a></li>
 </ul>
 

Modified: branches/unicode_buf/doc/en/html/macro/command/logopen.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/logopen.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/logopen.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -59,7 +59,7 @@
 <table>
   <tr>
     <th>value</th>
-    <th>Meaning</ht>
+    <th>Meaning</th>
   </tr>
 
   <tr>

Modified: branches/unicode_buf/doc/en/html/macro/command/messagebox.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/messagebox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/messagebox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -74,6 +74,8 @@
 
 <h2>See also</h2>
 <ul>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
+  <li><a href="statusbox.html">statusbox</a></li>
   <li><a href="strspecial.html">strspecial</a></li>
 </ul>
 

Modified: branches/unicode_buf/doc/en/html/macro/command/passwordbox.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/passwordbox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/passwordbox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -75,7 +75,11 @@
 
 <h2>See also</h2>
 <ul>
+  <li><a href="inputbox.html">inputbox</a></li>
+  <li><a href="listbox.html">listbox</a></li>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
   <li><a href="strspecial.html">strspecial</a></li>
+  <li><a href="yesnobox.html">yesnobox</a></li>
 </ul>
 
 </body>

Modified: branches/unicode_buf/doc/en/html/macro/command/setdlgpos.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/setdlgpos.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/setdlgpos.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -24,7 +24,7 @@
 <h2>Remarks</h2>
 
 <p>
-Changes the initial position for dialog boxes opened by the "<a href="inputbox.html">inputbox</a>", "<a href="messagebox.html">messagebox</a>", "<a href="passwordbox.html">passwordbox</a>", "<a href="statusbox.html">statusbox</a>" and "<a href="listbox.html">listbox</a>" commands. If the status dialog box is displayed, the "setdlgpos" command also moves the dialog box.<br>
+Changes the initial position for dialog boxes opened by the "<a href="inputbox.html">inputbox</a>", "<a href="listbox.html">listbox</a>", "<a href="messagebox.html">messagebox</a>", "<a href="passwordbox.html">passwordbox</a>", "<a href="statusbox.html">statusbox</a>" and "<a href="yesnobox.html">yesnobox</a>" commands. If the status dialog box is displayed, the "setdlgpos" command also moves the dialog box.<br>
 <x> and <y> specify the position (x,y) in the screen coordinate.<br>
 The origin (0,0) is upper left corner of the screen.
 </p>

Modified: branches/unicode_buf/doc/en/html/macro/command/statusbox.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/statusbox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/statusbox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -106,6 +106,7 @@
   <li><a href="strspecial.html">strspecial</a></li>
   <li><a href="closesbox.html">closesbox</a></li>
   <li><a href="bringupbox.html">bringupbox</a></li>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
 </ul>
 
 </body>

Modified: branches/unicode_buf/doc/en/html/macro/command/yesnobox.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/command/yesnobox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/command/yesnobox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -74,6 +74,10 @@
 
 <h2>See also</h2>
 <ul>
+  <li><a href="inputbox.html">inputbox</a></li>
+  <li><a href="listbox.html">listbox</a></li>
+  <li><a href="passwordbox.html">passwordbox</a></li>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
   <li><a href="strspecial.html">strspecial</a></li>
 </ul>
 

Modified: branches/unicode_buf/doc/en/html/macro/syntax/formats.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/syntax/formats.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/syntax/formats.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -34,7 +34,7 @@
 <h2>2) String-type constants</h2>
 
 <p>
-There are two ways of expressing a string-type constant.<P></P>
+There are two ways of expressing a string-type constant.
 </p>
 
 <p>

Modified: branches/unicode_buf/doc/en/html/macro/syntax/variables.html
===================================================================
--- branches/unicode_buf/doc/en/html/macro/syntax/variables.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/macro/syntax/variables.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -87,18 +87,73 @@
     <td>0</td>
     <td><a href="../command/bplusrecv.html">bplusrecv</a>,
         <a href="../command/bplussend.html">bplussend</a>,
+        <a href="../command/checksum8.html">checksum8file</a>,
+        <a href="../command/checksum16.html">checksum16file</a>,
+        <a href="../command/checksum32.html">checksum32file</a>,
+        <a href="../command/clipb2var.html">clipb2var</a>,
         <a href="../command/connect.html">connect</a>,
+        <a href="../command/crc16.html">crc16file</a>,
+        <a href="../command/crc32.html">crc32file</a>,
         <a href="../command/cygconnect.html">cygconnect</a>,
+        <a href="../command/dirnamebox.html">dirnamebox</a>,
+        <a href="../command/exec.html">exec</a>,
+        <a href="../command/fileconcat.html">fileconcat</a>,
+        <a href="../command/filecopy.html">filecopy</a>,
+        <a href="../command/filecreate.html">filecreate</a>,
+        <a href="../command/filedelete.html">filedelete</a>,
+        <a href="../command/filelock.html">filelock</a>,
+        <a href="../command/filenamebox.html">filenamebox</a>,
+        <a href="../command/fileread.html">fileread</a>,
+        <a href="../command/filereadln.html">filereadln</a>,
+        <a href="../command/filerename.html">filerename</a>,
+        <a href="../command/filesearch.html">filesearch</a>,
+        <a href="../command/filestat.html">filestat</a>,
+        <a href="../command/filestrseek.html">filestrseek</a>,
+        <a href="../command/filestrseek2.html">filestrseek2</a>,
+        <a href="../command/filetruncate.html">filetruncate</a>,
+        <a href="../command/fileunlock.html">fileunlock</a>,
+        <a href="../command/findoperations.html">findfirst</a>,
+        <a href="../command/findoperations.html">findnext</a>,
+        <a href="../command/getdate.html">getdate</a>,
+        <a href="../command/getfileattr.html">getfileattr</a>,
+        <a href="../command/getipv4addr.html">getipv4addr</a>,
+        <a href="../command/getipv6addr.html">getipv6addr</a>,
+        <a href="../command/getmodemstatus.html">getmodemstatus</a>,
+        <a href="../command/getpassword.html">getpassword</a>,
+        <a href="../command/getspecialfolder.html">getspecialfolder</a>,
+        <a href="../command/gettime.html">gettime</a>,
+        <a href="../command/getttdir.html">getttdir</a>,
+        <a href="../command/getver.html">getver</a>,
+        <a href="../command/ifdefined.html">ifdefined</a>,
+        <a href="../command/ispassword.html">ispassword</a>,
         <a href="../command/kmtfinish.html">kmtfinish</a>,
         <a href="../command/kmtget.html">kmtget</a>,
         <a href="../command/kmtrecv.html">kmtrecv</a>,
         <a href="../command/kmtsend.html">kmtsend</a>,
+        <a href="../command/listbox.html">listbox</a>,
+        <a href="../command/loginfo.html">loginfo</a>,
         <a href="../command/logopen.html">logopen</a>,
         <a href="../command/quickvanrecv.html">quickvanrecv</a>,
         <a href="../command/quickvansend.html">quickvansend</a>,
         <a href="../command/recvln.html">recvln</a>,
+        <a href="../command/setfileattr.html">foldercreate</a>,
+        <a href="../command/setfileattr.html">folderdelete</a>,
+        <a href="../command/setfileattr.html">foldersearch</a>,
+        <a href="../command/setfileattr.html">setfileattr</a>,
+        <a href="../command/setpassword.html">setpassword</a>,
+        <a href="../command/sprintf.html">sprintf</a>,
+        <a href="../command/sprintf2.html">sprintf2</a>,
+        <a href="../command/str2int.html">str2int</a>,
+        <a href="../command/strcompare.html">strcompare</a>,
+        <a href="../command/strlen.html">strlen</a>,
+        <a href="../command/strmatch.html">strmatch</a>,
+        <a href="../command/strreplace.html">strreplace</a>,
+        <a href="../command/strscan.html">strscan</a>,
+        <a href="../command/strsplit.html">strsplit</a>,
         <a href="../command/testlink.html">testlink</a>,
+        <a href="../command/var2clipb.html">var2clipb</a>,
         <a href="../command/wait.html">wait</a>,
+        <a href="../command/wait4all.html">wait4all</a>,
         <a href="../command/waitevent.html">waitevent</a>,
         <a href="../command/waitln.html">waitln</a>,
         <a href="../command/waitn.html">waitn</a>,
@@ -106,39 +161,11 @@
         <a href="../command/waitregex.html">waitregex</a>,
         <a href="../command/xmodemrecv.html">xmodemrecv</a>,
         <a href="../command/xmodemsend.html">xmodemsend</a>,
+        <a href="../command/yesnobox.html">yesnobox</a>,
+        <a href="../command/ymodemrecv.html">ymodemrecv</a>,
+        <a href="../command/ymodemsend.html">ymodemsend</a>,
         <a href="../command/zmodemrecv.html">zmodemrecv</a>,
-        <a href="../command/zmodemsend.html">zmodemsend</a>,
-        <a href="../command/sprintf.html">sprintf</a>,
-        <a href="../command/str2int.html">str2int</a>,
-        <a href="../command/strcompare.html">strcompare</a>,
-        <a href="../command/strlen.html">strlen</a>,
-        <a href="../command/strmatch.html">strmatch</a>,
-        <a href="../command/strscan.html">strscan</a>,
-        <a href="../command/fileconcat.html">fileconcat</a>,
-        <a href="../command/filecopy.html">filecopy</a>,
-        <a href="../command/filecreate.html">filecreate</a>,
-        <a href="../command/filedelete.html">filedelete</a>,
-        <a href="../command/fileread.html">fileread</a>,
-        <a href="../command/filereadln.html">filereadln</a>,
-        <a href="../command/filerename.html">filerename</a>,
-        <a href="../command/filesearch.html">filesearch</a>,
-        <a href="../command/filestrseek.html">filestrseek</a>,
-        <a href="../command/filestrseek2.html">filestrseek2</a>,
-        <a href="../command/findoperations.html">findfirst</a>,
-        <a href="../command/findoperations.html">findnext</a>,
-        <a href="../command/clipb2var.html">clipb2var</a>,
-        <a href="../command/crc32.html">crc32file</a>,
-        <a href="../command/getdate.html">getdate</a>,
-        <a href="../command/gettime.html">gettime</a>,
-        <a href="../command/getver.html">getver</a>,
-        <a href="../command/ifdefined.html">ifdefined</a>,
-        <a href="../command/var2clipb.html">var2clipb</a>,
-        <a href="../command/yesnobox.html">yesnobox</a>,
-        <a href="../command/getfileattr.html">getfileattr</a>,
-        <a href="../command/setfileattr.html">setfileattr</a>,
-        <a href="../command/setfileattr.html">foldercreate</a>,
-        <a href="../command/setfileattr.html">folderdelete</a>,
-        <a href="../command/setfileattr.html">foldersearch</a></td>
+        <a href="../command/zmodemsend.html">zmodemsend</a></td>
   </tr>
   <tr>
     <td>timeout</td>

Modified: branches/unicode_buf/doc/en/html/menu/file-chdir.html
===================================================================
--- branches/unicode_buf/doc/en/html/menu/file-chdir.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/menu/file-chdir.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -16,7 +16,8 @@
 
     <h2>"Change directory" dialog box</h2>
     <p>
-      Enter a new directory name.
+      Enter a new directory name.<br />
+      When this setting is used, the environment variable is expanded if it is included.
     </p>
   </body>
 </html>

Modified: branches/unicode_buf/doc/en/html/menu/file-new.html
===================================================================
--- branches/unicode_buf/doc/en/html/menu/file-new.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/menu/file-new.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -75,7 +75,7 @@
     <dl>
       <dt>Port</dt>
       <dd>
-	Select a port from the list.
+	Select a port from the list. By default, maximum serial port number in the list is 256. It is configurable in <a href="../setup/teraterm-com.html#maxport">MaxComPort</a> setting.
       </dd>
     </dl>
   </body>

Modified: branches/unicode_buf/doc/en/html/menu/setup-additional.html
===================================================================
--- branches/unicode_buf/doc/en/html/menu/setup-additional.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/menu/setup-additional.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -63,10 +63,10 @@
           <dd>Displays hostname or serial port name</dd>
 
           <dt>Display session number</dt>
-          <dd>Displays session number</dt>
+          <dd>Displays session number</dd>
 
           <dt>Display VT/TEK</dt>
-          <dd>Displays VT or TEK</dt>
+          <dd>Displays VT or TEK</dd>
 
           <dt>Swap hostname and title position</dt>
           <dd>Swaps the hostname and <a href="setup-window.html#Title">title text</a>, displays hostname first.</dd>
@@ -253,6 +253,11 @@
 	A user can delay to send a line data to the remote host when the user pastes multiple lines. The delay time can be specified by this option on the millisecond time scale.
       </dd>
 
+      <dt id="SelectOnActivate">Disabling text selection when the window is activated</dt>
+      <dd>
+	When an inactive window is activated by clicking the text area with the mouse, the text selection is disabled.
+      </dd>
+
     </dl>
 
 
@@ -402,7 +407,7 @@
 	</dl>
       </dd>
 
-      <dt id="LogOption">Log option</a></dt>
+      <dt id="LogOption">Log option</dt>
       <dd>
 	Specify the log type.
 	<dl>

Modified: branches/unicode_buf/doc/en/html/menu/setup-font.html
===================================================================
--- branches/unicode_buf/doc/en/html/menu/setup-font.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/menu/setup-font.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -55,5 +55,6 @@
 	When the dialog font is set to very large size and wide font, 
 	displayed font may be corrupted, and also you may not press [ok] button because the dialog goes out of screen.
       </li>
+    </ul>
   </body>
 </html>

Modified: branches/unicode_buf/doc/en/html/menu/setup-serialport.html
===================================================================
--- branches/unicode_buf/doc/en/html/menu/setup-serialport.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/menu/setup-serialport.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -15,7 +15,7 @@
     <dl>
       <dt id="ComPort">Port</dt>
       <dd>
-	Serial port to be used.
+	Serial port to be used. By default, maximum serial port number in the list is 256. It is configurable in <a href="../setup/teraterm-com.html#maxport">MaxComPort</a> setting.
       </dd>
 
       <dt id="Speed">Speed, Data, Parity, Stop bits, Flow control</dt>

Modified: branches/unicode_buf/doc/en/html/menu/setup-sshkeygenerator.html
===================================================================
--- branches/unicode_buf/doc/en/html/menu/setup-sshkeygenerator.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/menu/setup-sshkeygenerator.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -70,6 +70,6 @@
       <dd>Save private key<br />
       The private key is encrypted by the AES-128 algorithm. 
       The key is encrypted by the 3DES into the Tera Term 4.76(TTSSH 2.63) before.</dd>
-    <dl>
+    </dl>
   </body>
 </html>

Modified: branches/unicode_buf/doc/en/html/menu/setup-window.html
===================================================================
--- branches/unicode_buf/doc/en/html/menu/setup-window.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/menu/setup-window.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -108,7 +108,7 @@
 	    Specifies the RGB value of the character color.
 	  </dd>
 
-	  <dt id="UseNormalBGColor">Always use Normal text's BG</td>
+	  <dt id="UseNormalBGColor">Always use Normal text's BG</dt>
 	  <dd>
 	    If this option is ON, Tera Term uses Normal background color instead of Bold, Blink and URL's background color.
 	  </dd>

Modified: branches/unicode_buf/doc/en/html/reference/sourcecode.html
===================================================================
--- branches/unicode_buf/doc/en/html/reference/sourcecode.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/reference/sourcecode.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -515,7 +515,7 @@
 <pre class=code>
 #define WM_SEND_HEARTBEAT (WM_USER + 1)
 
-static LRESULT CALLBACK telnet_heartbeat_dlg_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
+static INT_PTR CALLBACK telnet_heartbeat_dlg_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
 {
 
 	switch (msg) {
@@ -566,11 +566,12 @@
   if (ts.TelKeepAliveInterval > 0) {
     nop_interval = ts.TelKeepAliveInterval;
 
-	keepalive_dialog = CreateDialog(hInst, MAKEINTRESOURCE(IDD_BROADCAST_DIALOG),
-               HVTWin, (DLGPROC)telnet_heartbeat_dlg_proc);
+    keepalive_dialog = CreateDialog(hInst, MAKEINTRESOURCE(IDD_BROADCAST_DIALOG),
+               HVTWin, telnet_heartbeat_dlg_proc);
 
     keepalive_thread = (HANDLE)_beginthreadex(NULL, 0, TelKeepAliveThread, NULL, 0, &tid);
-    if (keepalive_thread == (HANDLE)-1) {
+    if (keepalive_thread == 0) {
+      keepalive_thread = INVALID_HANDLE_VALUE;
       nop_interval = 0;
     }
   }

Modified: branches/unicode_buf/doc/en/html/setup/teraterm-com.html
===================================================================
--- branches/unicode_buf/doc/en/html/setup/teraterm-com.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/setup/teraterm-com.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -20,7 +20,12 @@
 </pre>
 
 <p>
-The maximum serial port number can not be less than 4 even if the actual maximum number is less than 4.
+The maximum serial port number can not be less than 4 even if the actual maximum number is less than 4. <br>
+Configurable maximum number is in the following: <br>
+  4096 (version 4.65 or later)<br>
+  256 (version 4.55 or later)<br>
+  99 (version 4.24 or later)<br>
+  16 (version less than 4.24)<br>
 </p>
 
 <pre>

Modified: branches/unicode_buf/doc/en/html/setup/teraterm-win.html
===================================================================
--- branches/unicode_buf/doc/en/html/setup/teraterm-win.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/setup/teraterm-win.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -184,7 +184,7 @@
 <h1 id="textselect">Disabling text selection when the window is activated by mouse</h1>
 
 <p>
-When the window is inactive, you can activate the window by clicking the text area of window. In the default setup, the text selection is started by this mouse clicking at the same time. To disable the text selection when the window is activated by mouse, edit the SelectOnActive line in the [Tera Term] section of the setup file like the following:
+When the window is inactive, you can activate the window by clicking the text area of window. In the default setup, the text selection is started by this mouse clicking at the same time. To disable the text selection when the window is activated by mouse, edit the SelectOnActivate line in the [Tera Term] section of the setup file like the following:
 </p>
 
 <pre>

Modified: branches/unicode_buf/doc/en/html/setup/teraterm.html
===================================================================
--- branches/unicode_buf/doc/en/html/setup/teraterm.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/setup/teraterm.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -179,7 +179,7 @@
  <li><a href="teraterm-misc.html#LogLockExclusive">Exclusive-lock log file</a></li>
  <li><a href="teraterm-misc.html#DeferredLogWriteMode">Deferred log write mode</a></li>
  <li><a href="teraterm-misc.html#LogTimestampFormat">Specify timestamp format at the start of log file's line</a></li>
- <li><a href="teraterm-misc.html#LogTimestampUTC">UTC is used at timestamp format of the start of log file's line</a></li-->
+ <li><a href="teraterm-misc.html#LogTimestampUTC">UTC is used at timestamp format of the start of log file's line</a></li>
 </ul>
 
 <h3>TTSSH</h3>

Modified: branches/unicode_buf/doc/en/html/uninstall.html
===================================================================
--- branches/unicode_buf/doc/en/html/uninstall.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/uninstall.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -10,12 +10,22 @@
 
 <h1>Uninstallation</h1>
 
+<h2>Case installed from the installer</h2>
+
 <p>
-To uninstall Tera Term, run "Programs and Features" in Control Panel, or run unins000.exe in the Tera Term directory.
+To uninstall Tera Term, run "Programs and Features" in Control Panel, or run unins000.exe in the Tera Term directory.<br>
+If the uninstaller does not work, you can uninstall Tera Term manually.<br>
 </p>
 
+<h2>Case used ZIP archive</h2>
+
 <p>
-If the uninstaller does not work, you can uninstall Tera Term Pro manually.
+Please uninstall Tera Term manually.
+</p>
+
+<h2>Manual uninstallation</h2>
+
+<p>
 Delete all Tera Term files in the Tera Term directory and remove the "Tera Special" font from "Fonts" in Control Panel.<br>
 If a user uses the Tera Term Menu, delete the HKEY_CURRENT_USER\Software\ShinpeiTools\TTermMenu registry.
 </p>

Modified: branches/unicode_buf/doc/en/html/usage/LogMeTT/LogMeTTTutorial.htm
===================================================================
--- branches/unicode_buf/doc/en/html/usage/LogMeTT/LogMeTTTutorial.htm	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/usage/LogMeTT/LogMeTTTutorial.htm	2019-08-20 14:35:14 UTC (rev 7998)
@@ -278,7 +278,6 @@
 
 <p>
 e-mail: boris****@logme***** <br>
-<a href="http://www.logmett.com/index.php?/Products/LogMeTT.html">LogMeTT web page</a>
 </p>
 
 </body>

Modified: branches/unicode_buf/doc/en/html/usage/recurringcommand.html
===================================================================
--- branches/unicode_buf/doc/en/html/usage/recurringcommand.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/usage/recurringcommand.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -48,7 +48,7 @@
 	Specify sending command(string). When the command includes below string, the string is replaced to corresponding character.
 	<table border="1">
 	    <tbody>
-		<tr><th>Sequence</th>	<th> Sending character </ht></tr>
+		<tr><th>Sequence</th>	<th> Sending character </th></tr>
 		<tr><td> \\ </td>	<td> \ </td></tr>
 		<tr><td> \n </td>	<td> Line feed (LF) </td></tr>
 		<tr><td> \t </td>	<td> Horizontal tab (HT) </td></tr>

Modified: branches/unicode_buf/doc/en/html/usage/shortcut.html
===================================================================
--- branches/unicode_buf/doc/en/html/usage/shortcut.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/usage/shortcut.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -12,7 +12,7 @@
 <h1>Shortcut</h1>
 
 <dl>
-<dt>ScrollLock</td>
+<dt>ScrollLock</dt>
 <dd>Tera Term window scroll locked or unlocked(toggle)</dd>
 
 <dt>Ctrl + Tab, Ctrl + Shift + Tab</dt>

Modified: branches/unicode_buf/doc/en/html/usage/ttyrec.html
===================================================================
--- branches/unicode_buf/doc/en/html/usage/ttyrec.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/usage/ttyrec.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -2,7 +2,7 @@
   "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
-<meta http-equiv="Content-Type" cntent="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <title>TTY Recorder and Player</title>
 <meta http-equiv="Content-Style-Type" content="text/css">
 <link rel="stylesheet" href="../style.css" type="text/css">

Modified: branches/unicode_buf/doc/en/html/usage/unicode.html
===================================================================
--- branches/unicode_buf/doc/en/html/usage/unicode.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/en/html/usage/unicode.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -45,10 +45,11 @@
 </pre>
 
 <p>
-(1): Tera Term can not support the surrogate pair and the combining character
-     <!--and the decomposed form-->
-     because the application does not convert UTF-8 byte sequence over three
-     bytes. <br>
+(1):
+Unicode information is no longer missing on decoding UTF-8 because 
+four byte UTF-8 is supported after version 4.102.<br>
+When the KanjiCode(recv) is set to UTF-8m, a part of 
+combining character are processed for Mac OS X(HFS+). <br>
 
 (2): A user must specify the locale to convert the characters between
      Unicode and MBCS.

Modified: branches/unicode_buf/doc/ja/html/about/history.html
===================================================================
--- branches/unicode_buf/doc/ja/html/about/history.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/about/history.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -35,12 +35,26 @@
 <ul class="history">
   <li>\x95ύX
     <ul>
-      <li></li>
+      <li><a href="../macro/command/fileopen.html">fileopen</a> \x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82ŁA\x83t\x83@\x83C\x83\x8B\x82\xAA\x8AJ\x82\xAF\x82Ȃ\xA2\x8Fꍇ\x82ɃG\x83\x89\x81[\x82ɂȂ\xE7\x82Ȃ\xA2\x82悤\x82ɂ\xB5\x82\xBD\x81BVer 4.102\x82ł̕ύX\x82\xF0\x8C\xB3\x82ɖ߂\xB5\x82\xBD\x81B</li>
+      <li><a href="../macro/command/filetruncate.html">filetruncate</a> \x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82ŁA\x83t\x83@\x83\x8B\x82\xAA\x8AJ\x82\xAF\x82Ȃ\xA2\x8Fꍇ\x81E\x83t\x83@\x83C\x83\x8B\x83T\x83C\x83Y\x82̕ύX\x82Ɏ\xB8\x94s\x82\xB5\x82\xBD\x8Fꍇ\x82ɃG\x83\x89\x81[\x82ɂȂ\xE7\x82Ȃ\xA2\x82悤\x82ɂ\xB5\x82\xBD\x81B</li>
+      <li><a href="../menu/file-chdir.html">\x83t\x83@\x83C\x83\x8B\x93]\x91\x97\x82̂\xBD\x82߂̃f\x83B\x83\x8C\x83N\x83g\x83\x8A</a>\x82Ɋ܂܂\xEA\x82\xE9\x8A‹\xAB\x95ϐ\x94\x82\xF0\x93W\x8AJ\x82\xB7\x82\xE9\x82悤\x82ɂ\xB5\x82\xBD\x81B</li>
+      <li>IME\x82̖\xA2\x8Am\x92蕶\x8E\x9A\x82̃t\x83H\x83\x93\x83g\x82\xAA\x8Ew\x92\xE8\x83t\x83H\x83\x93\x83g\x82Ɠ\xAF\x88\xEA\x82ɂȂ\xE9\x82悤\x82ɂ\xB5\x82\xBD\x81B</li>
+      <li><a href="../setup/teraterm-win.html#textselect">\x83}\x83E\x83X\x82ŃE\x83B\x83\x93\x83h\x83E\x82\xF0\x91I\x91\xF0\x82\xB5\x82\xBD\x82Ƃ\xAB\x82̕\xB6\x8E\x9A\x82̑I\x91\xF0\x82\xF0\x8B֎~\x82\xB7\x82\xE9</a>\x82\xF0<a href="../menu/setup-additional.html#SelectOnActivate">Additional settings\x83_\x83C\x83A\x83\x8D\x83O</a>\x82Őݒ\xE8\x82ł\xAB\x82\xE9\x82悤\x82ɂ\xB5\x82\xBD\x81B</li>
     </ul>
   </li>
   <li>\x83o\x83O\x8FC\x90\xB3
     <ul>
-      <li></li>
+      <li>Active Window Tracking \x82\xF0\x97L\x8C\xF8\x8E\x9E\x81A\x83}\x83E\x83X\x83J\x81[\x83\\x83\x8B\x82\xAA Tera Term \x82̃E\x83B\x83\x93\x83h\x83E\x93\xE0\x82Ɉړ\xAE\x82\xB5\x82Ă\xE0\x81A\x83A\x83N\x83e\x83B\x83u\x82ɂȂ\xE7\x82Ȃ\xA2\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B4.103\x82ł̃G\x83\x93\x83o\x83O\x81B</li>
+      <li>UTF-8\x8E\xF3\x90M\x8E\x9E\x81A4byte\x82\xCCUTF-8\x82̃f\x83R\x81[\x83h\x82\xF0\x8C\xEB\x82\xC1\x82Ă\xA2\x82\xBD\x82̂ŏC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
+      <li>Ver 4.103 \x82\xC5 DLL \x82̌Ăяo\x82\xB5\x8BK\x96\xF1\x82\xF0\x95ς\xA6\x82\xBD\x82\xB1\x82ƂŁA\x82\xBB\x82\xEA\x88ȑO\x82ɃR\x83\x93\x83p\x83C\x83\x8B\x82\xB3\x82ꂽ\x83v\x83\x89\x83O\x83C\x83\x93\x82\xAA\x8CĂяo\x82\xB9\x82Ȃ\xAD\x82Ȃ\xC1\x82Ă\xA2\x82\xBD\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
+      <li>IME\x82̖\xA2\x8Am\x92蕶\x8E\x9A\x82\xF0\x95\\x8E\xA6\x82\xB5\x82Ă\xA2\x82\xE9\x8F\xF3\x91ԂŃt\x83H\x83\x93\x83g\x91I\x91\xF0\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9\x82\xC6IME\x82̃t\x83H\x83\x93\x83g\x82\xAA\x95ω\xBB\x82\xB7\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
+      <li>\x83E\x83B\x83\x93\x83h\x83E\x83^\x83C\x83g\x83\x8B\x82̃Z\x83b\x83V\x83\x87\x83\x93\x94ԍ\x86\x82\xAA\x8F\xED\x82\xC91\x82ƂȂ\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
+      <li><a href="../macro/command/filecopy.html">filecopy</a> \x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82̌\x8B\x89ʂ\xAA result \x83V\x83X\x83e\x83\x80\x95ϐ\x94\x82Ɋi\x94[\x82\xB3\x82\xEA\x82Ȃ\xA2\x82\xB1\x82Ƃ\xAA\x82\xA0\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
+      <li>[File]/[Send file..]\x82\xA9\x82\xE7\x91傫\x82ȃt\x83@\x83C\x83\x8B\x82\xF0\x82\xA4\x82܂\xAD\x91\x97\x90M\x82ł\xAB\x82Ȃ\xA2\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B4.103\x82ł̃G\x83\x93\x83o\x83O\x81B</li>
+      <li><a href="../macro/command/filelock.html">filelock</a>, <a href="../macro/command/fileunlock.html">fileunlock</a> \x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82\xAA\x8F\xED\x82Ɏ\xB8\x94s\x82\xB5\x82Ă\xA2\x82\xBD\x81B4.101\x82ł̃G\x83\x93\x83o\x83O\x81B</li>
+      <li><a href="../macro/command/filestrseek2.html">filestrseek2</a>\x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h\x82ŁA\x83t\x83@\x83C\x83\x8B\x82\xCC1\x83o\x83C\x83g\x96ڂ\xAA\x88\xEA\x92v\x82\xB5\x82\xBD\x82Ƃ\xAB\x81A\x83t\x83@\x83C\x83\x8B\x83|\x83C\x83\x93\x83^\x82\xAA\x90擪\x82ɂȂ\xC1\x82Ă\xA2\x82Ȃ\xA9\x82\xC1\x82\xBD\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B4.101\x82ł̃G\x83\x93\x83o\x83O\x81B</li>
+      <li>\x88󎚒\x86\x8E~\x83_\x83C\x83A\x83\x8D\x83O\x82\xAA\x8Fo\x82Ȃ\xAD\x82Ȃ\xC1\x82Ă\xA2\x82\xBD\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B4.103\x82ł̃G\x83\x93\x83o\x83O\x81B</li>
+      <li>\x89p\x8C\xEA\x94\xC5Windows\x82ŁA\x83\x8D\x83P\x81[\x83\x8B\x90ݒ肪\x83f\x83t\x83H\x83\x8B\x83g(japanese)\x82\xE0\x82\xB5\x82\xAD\x82͕s\x93K\x90؂ȏꍇ\x81ATera Term\x82\xF0\x8BN\x93\xAE\x82\xB5\x82Ă\xB7\x82\xAE\x82ɃA\x83v\x83\x8A\x83P\x81[\x83V\x83\x87\x83\x93\x83t\x83H\x83\x8B\x83g\x82ƂȂ\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
     </ul>
   </li>
 
@@ -47,6 +61,7 @@
   <li>\x82\xBB\x82̑\xBC
     <ul>
       <li><a href="#ttssh_2.90">TTSSH(2.90)</a>\x82֍\xB7\x82\xB5\x91ւ\xA6\x82\xBD\x81B</li>
+      <li><a href="#ttproxy_1.0.0.25">TTProxy(1.0.0.25)</a>\x82֍\xB7\x82\xB5\x91ւ\xA6\x82\xBD\x81B</li>
     </ul>
   </li>
 </ul>
@@ -157,7 +172,7 @@
     <ul>
       <li>\x95\xA1\x90\x94\x83t\x83@\x83C\x83\x8B\x82̃h\x83\x89\x83b\x83O&\x83h\x83\x8D\x83b\x83v\x82ɑΉ\x9E\x82\xB5\x82\xBD\x81B</li>
       <li><a href="../usage/mouse.html#dragdropwindow">\x83t\x83@\x83C\x83\x8B\x82\xF0\x83h\x83\x89\x83b\x83O&\x83h\x83\x8D\x83b\x83v\x82\xB5\x82\xBD\x82Ƃ\xAB\x82ɕ\\x8E\xA6\x82\xB3\x82\xEA\x82\xE9\x83_\x83C\x83A\x83\x8D\x83O</a>\x82\xF0\x8B@\x94\\x8B\xAD\x89\xBB\x82\xB5\x82\xBD\x81B</li>
-      <li><a href="../menu/setup-terminal.html#TermIsWin">Term size = win size</a> \x90ݒ肪 on \x82̏ꍇ\x82́A\x83^\x83C\x83g\x83\x8B\x83o\x81[\x82\xF0\x83_\x83u\x83\x8B\x83N\x83\x8A\x83b\x83N\x82\xB5\x82\xBD\x8E\x9E\x82ɃE\x83B\x83\x93\x83h\x83E\x83T\x83C\x83Y\x82\xF0\x8Dő剻\x82\xB7\x82\xE9\x82悤\x82ɕύX\x82\xB5\x82\xBD\x81B</a>
+      <li><a href="../menu/setup-terminal.html#TermIsWin">Term size = win size</a> \x90ݒ肪 on \x82̏ꍇ\x82́A\x83^\x83C\x83g\x83\x8B\x83o\x81[\x82\xF0\x83_\x83u\x83\x8B\x83N\x83\x8A\x83b\x83N\x82\xB5\x82\xBD\x8E\x9E\x82ɃE\x83B\x83\x93\x83h\x83E\x83T\x83C\x83Y\x82\xF0\x8Dő剻\x82\xB7\x82\xE9\x82悤\x82ɕύX\x82\xB5\x82\xBD\x81B</li>
       <li><a href="../menu/setup-additional.html#TitleFormat">Additional settings\x83_\x83C\x83A\x83\x8D\x83O</a>\x82\xCC General \x83^\x83u\x82\xC9<a href="../setup/teraterm-win.html#title">\x83^\x83C\x83g\x83\x8B\x8C`\x8E\xAE\x82̐ݒ\xE8</a>\x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li>
     </ul>
   </li>
@@ -2091,7 +2106,7 @@
       <li>\x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h '<a href="../macro/command/cygconnect.html">cygconnect</a>' \x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li>
       <li>\x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h '<a href="../macro/command/getdate.html">getdate</a>, <a href="../macro/command/gettime.html">gettime</a> \x82ŁA\x8F\x91\x8E\xAE\x82\xF0\x8Ew\x92\xE8\x82ł\xAB\x82\xE9\x82悤\x82ɂ\xB5\x82\xBD\x81B</li>
       <li>\x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h '<a href="../macro/command/scpsend.html">scpsend</a>' \x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li>
-      <li>\x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h '<a href="../macro/command/scprecv.html">scpsrecv</a>' \x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li>
+      <li>\x83}\x83N\x83\x8D\x83R\x83}\x83\x93\x83h '<a href="../macro/command/scprecv.html">scprecv</a>' \x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B</li>
       <li>\x83t\x83@\x83C\x83\x8B\x82̃h\x83\x89\x83b\x83O\x83A\x83\x93\x83h\x83h\x83\x8D\x83b\x83v\x8E\x9E\x82Ɋm\x94F\x82\xB7\x82邩\x82ǂ\xA4\x82\xA9\x82\xF0\x91I\x91\xF0\x82ł\xAB\x82\xE9\x82悤\x82ɂ\xB5\x82\xBD\x81B
         <ul>
           <li>teraterm.ini \x82\xC9 <a href="../setup/teraterm-trans.html#draganddrop">ConfirmFileDragAndDrop</a> \x82\xF0\x92lj\xC1\x82\xB5\x82\xBD\x81B\x83f\x83t\x83H\x83\x8B\x83g\x82\xCDon\x81B</li>
@@ -3163,7 +3178,10 @@
 
   <li>\x83o\x83O\x8FC\x90\xB3
     <ul>
-      <li>\x83|\x81[\x83g\x93]\x91\x97\x82\xC5SSH\x92ʐM\x82\xAA\x92x\x82\xA2\x8Fꍇ\x82ɂ\xA8\x82\xA2\x82āA\x8F\xC1\x94\x83\x82\x83\x8A\x82\xAA\x94\xEC\x91剻\x82\xB5\x82ăA\x83v\x83\x8A\x82\xAA\x97\x8E\x82\xBF\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
+      <li>SSH2: \x83|\x81[\x83g\x93]\x91\x97\x82\xC5SSH\x92ʐM\x82\xAA\x92x\x82\xA2\x8Fꍇ\x82ɂ\xA8\x82\xA2\x82āA\x8F\xC1\x94\x83\x82\x83\x8A\x82\xAA\x94\xEC\x91剻\x82\xB5\x82ăA\x83v\x83\x8A\x82\xAA\x97\x8E\x82\xBF\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
+      <li>SSH2: SCP \x93]\x91\x97\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x95‚\xB6\x82\xE9\x82Ƃ\xAB\x82ɁA\x83t\x83@\x83C\x83\x8B\x93]\x91\x97\x83f\x83B\x83\x8C\x83N\x83g\x83\x8A\x90ݒ\xE8\x81ESCP\x91\x97\x90M\x90\xE6\x83p\x83X\x90ݒ肪\x8DX\x90V\x82\xB3\x82\xEA\x82Ȃ\xA2\x82\xB1\x82Ƃ\xAA\x82\xA0\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
+      <li>SSH1: \x90ڑ\xB1\x90\xE6\x82̃|\x81[\x83g\x94ԍ\x86\x82\xAA22\x88ȊO\x82ŁA\x90V\x8BK\x82\xC9known_hosts\x83t\x83@\x83C\x83\x8B\x82փz\x83X\x83g\x8C\xAE\x82\xF0\x8F\x91\x82\xAB\x8D\x9E\x82ގ\x9E\x81A\x83A\x83v\x83\x8A\x82\xAA\x97\x8E\x82\xBF\x82邱\x82Ƃ\xAA\x82\xA0\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
+      <li>SSH1: rhosts\x94F\x8F؂\xAA\x82ł\xAB\x82Ȃ\xAD\x82Ȃ\xC1\x82Ă\xA2\x82\xBD\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>
     </ul>
   </li>
 
@@ -4673,7 +4691,7 @@
 <h3 id="cygterm_1.06_02">v1.06_02 2006/02/09 (by babyd****@yahoo*****)</h3>
 <ul class="history">
       <li>CygTerm\x82̃A\x83C\x83R\x83\x93\x82\xAA\x8D쐬\x82\xB3\x82\xEA\x82܂\xB5\x82\xBD\x81B\x81i"DotWork 2.50"\x82ɂč쐬\x81j<br>
-          DotWork 2.50" \x82͉E\x8BL\x82\xCCURL\x82\xE6\x82\xE8\x93\xFC\x8E\xE8\x89”\\x82ł\xB7\x81B http://www5a.biglobe.ne.jp/~suuta/.<br>
+          DotWork 2.50 \x82͉E\x8BL\x82\xCCURL\x82\xE6\x82\xE8\x93\xFC\x8E\xE8\x89”\\x82ł\xB7\x81B http://www5a.biglobe.ne.jp/~suuta/.<br>
           \x82\xB7\x82΂炵\x82\xA2\x83\\x83t\x83g\x83E\x83F\x83A\x82\xF0\x8C\xF6\x8AJ\x82\xB5\x82Ă\xA2\x82\xBD\x82\xBE\x82\xAB\x81A"suuta at hamal dot freemal dot ne dot jp"\x82Ɋ\xB4\x8EӒv\x82\xB5\x82܂\xB7\x81B</li>
       <li>Makefile\x82\xAA\x8FC\x90\xB3\x82\xB3\x82\xEA\x82܂\xB5\x82\xBD\x81B"clean"\x83^\x81[\x83Q\x83b\x83g\x82\xC5cygterm.ico\x82\xF0\x8D폜\x82\xB5\x82Ȃ\xA2\x82悤\x82ɁB</li>
 </ul>
@@ -4776,6 +4794,11 @@
 
 <h2 id="ttproxy">TTProxy</h2>
 
+<h3 id="ttproxy_1.0.0.25">2019.xx.xx (Ver 1.0.0.25)</h3>
+<ul class="history">
+      <li>OS\x82ɂ\xE6\x82\xC1\x82Đ\xB3\x82\xB5\x82\xAD\x93\xAE\x8D삵\x82Ȃ\xA2\x95s\x8B\x82\xF0\x8FC\x90\xB3\x81B<a href="#teraterm_4.103">teraterm 4.103</a>\x82ł̃G\x83\x93\x83o\x83O\x81B</li>
+</ul>
+
 <h3 id="ttproxy_1.0.0.24">2016.11.30 (Ver 1.0.0.24)</h3>
 <ul class="history">
       <li>HTTP \x83v\x83\x8D\x83L\x83V\x82ŔF\x8F؂\xF0\x8Eg\x97p\x82\xB7\x82\xE9\x82Ɛڑ\xB1\x8E\x9E\x82ɗ\x8E\x82\xBF\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B</li>

Modified: branches/unicode_buf/doc/ja/html/about/requirements.html
===================================================================
--- branches/unicode_buf/doc/ja/html/about/requirements.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/about/requirements.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -34,6 +34,7 @@
 <p class="notice">
 \x92\x8D1: Windows 3.1 \x82̓T\x83|\x81[\x83g\x82\xB3\x82\xEA\x82Ă\xA2\x82܂\xB9\x82\xF1\x81B<br>
 \x92\x8D2: x64 \x82\xA8\x82\xE6\x82\xD1 IA-64 Windows \x82\xE0\x83T\x83|\x81[\x83g\x82\xB3\x82\xEA\x82Ă\xA2\x82܂\xB7\x81B(WOW64 \x82ɂ\xE6\x82\xE9)<br>
+\x92\x8D3: Tera Term\x82̃C\x83\x93\x83X\x83g\x81[\x83\x89\x82\xCDWindows2000\x96\xA2\x96\x9E\x82\xF0\x83T\x83|\x81[\x83g\x82\xB5\x82܂\xB9\x82\xF1\x81B(\x83o\x81[\x83W\x83\x87\x83\x934.95\x88ȍ~)<br>
 (*1) <a href="http://support.microsoft.com/kb/182108">Windows Sockets2.0</a> \x82\xAA\x95K\x97v\x82ł\xB7\x81B<br>
 (*2) Internet Explorer 5 \x88ȏオ\x95K\x97v\x82ł\xB7\x81B<br>
 (*3) LogMeTT, TTLEditor \x82͓\xAE\x82\xAB\x82܂\xB9\x82\xF1\x81B<br>

Modified: branches/unicode_buf/doc/ja/html/commandline/teraterm.html
===================================================================
--- branches/unicode_buf/doc/ja/html/commandline/teraterm.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/commandline/teraterm.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -76,7 +76,9 @@
         <li><span class="syntax">/C=3</span> COM3</li>
         <li>:</li>
         <li><span class="syntax">/C=256</span> COM256</li>
-      </ul></dd>
+      </ul>
+      \x83V\x83\x8A\x83A\x83\x8B\x83|\x81[\x83g\x94ԍ\x86\x82̍ő\xE5\x92l\x82̓f\x83t\x83H\x83\x8B\x83g\x82\xC5256\x82ƂȂ\xC1\x82Ă\xA2\x82܂\xB7\x81B<a href="../setup/teraterm-com.html#maxport">MaxComPort</a>\x82ōő\xE5\x92l\x82\xF0\x95ύX\x82ł\xAB\x82܂\xB7\x81B
+      </dd>
 
 <!--
   <dt id="duplicate">/DUPLICATE</dt>
@@ -276,7 +278,7 @@
 
 <p id="note2">
 [2] \x83p\x83\x89\x83\x81\x81[\x83^\x82̒l\x82ɃX\x83y\x81[\x83X\x82\xE2 `"' \x82\xF0\x8A܂߂邽\x82߂ɂ́A\x92l\x91S\x91̂\xF0 `"' \x82ň͂\xF1\x82ł\xAD\x82\xBE\x82\xB3\x82\xA2\x81B<br />
-\x92l\x82\xC9 " \x82\xF0\x8A܂߂邽\x82߂ɂ́A\x98A\x91\xB1\x82\xB5\x82\xBD `"'("") \x82\xF0\x8Ew\x92肵\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B
+\x92l\x82\xC9 " \x82\xF0\x8A܂߂邽\x82߂ɂ́A\x98A\x91\xB1\x82\xB5\x82\xBD `"'("") \x82\xF0\x8Ew\x92肵\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B(\x83o\x81[\x83W\x83\x87\x83\x93 4.63\x88ȍ~)
 </p>
 
 <pre>

Modified: branches/unicode_buf/doc/ja/html/commandline/ttssh.html
===================================================================
--- branches/unicode_buf/doc/ja/html/commandline/ttssh.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/commandline/ttssh.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -168,7 +168,7 @@
   <dt id="ssh-subsystem">/ssh-subsystem=<subsystem></dt>
   <dd>\x83V\x83F\x83\x8B\x82ł͂Ȃ\xAD<subsystem>\x82Ŏw\x92肵\x82\xBD\x83T\x83u\x83V\x83X\x83e\x83\x80\x82\xF0\x8BN\x93\xAE\x82\xB7\x82\xE9\x81B</dd>
 
-  <dt id="ssh-N">/ssh-N</td>
+  <dt id="ssh-N">/ssh-N</dt>
   <dd>\x90ڑ\xB1\x8E\x9E\x82ɃV\x83F\x83\x8B\x83Z\x83b\x83V\x83\x87\x83\x93\x82\xF0\x8AJ\x8En\x82\xB5\x82Ȃ\xA2\x81B</dd>
 
   <dt id="nosecuritywarning">/nosecuritywarning</dt>
@@ -177,9 +177,13 @@
 </dl>
 
 <p>
-\x83p\x83\x89\x83\x81\x81[\x83^\x82̒l\x82ɃX\x83y\x81[\x83X\x82\xE2\x83Z\x83~\x83R\x83\x8D\x83\x93\x82\xF0\x8A܂߂邽\x82߂ɂ́A\x92l\x91S\x91̂\xF0 `"' \x82ň͂\xF1\x82ł\xAD\x82\xBE\x82\xB3\x82\xA2\x81B<br />
-\x92l\x82\xC9 `"' \x82\xF0\x8A܂߂邽\x82߂ɂ́A\x98A\x91\xB1\x82\xB5\x82\xBD `"'("") \x82\xF0\x8Ew\x92肵\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B
+\x83p\x83\x89\x83\x81\x81[\x83^\x82̒l\x82ɃX\x83y\x81[\x83X\x82\xE2\x83Z\x83~\x83R\x83\x8D\x83\x93\x82\xF0\x8A܂߂邽\x82߂ɂ́A\x92l\x91S\x91̂\xF0 `"' \x82ň͂\xF1\x82ł\xAD\x82\xBE\x82\xB3\x82\xA2\x81B(\x83o\x81[\x83W\x83\x87\x83\x93 4.63(TTSSH 2.51)\x88ȍ~)<br />
+\x92l\x82\xC9 `"' \x82\xF0\x8A܂߂邽\x82߂ɂ́A\x98A\x91\xB1\x82\xB5\x82\xBD `"'("") \x82\xF0\x8Ew\x92肵\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B(\x83o\x81[\x83W\x83\x87\x83\x93 4.63(TTSSH 2.51)\x88ȍ~)
 </p>
+<p>
+<strong>\x88ȑO\x82̎d\x97l</strong><br />
+\x83p\x83\x89\x83\x81\x81[\x83^\x82̒l\x82ɃX\x83y\x81[\x83X\x82\xF0\x8A܂߂邽\x82߂ɂ́A`@' \x82\xF0\x8Ew\x92肵\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B'@' \x82\xF0\x8A܂߂邽\x82߂ɂ\xCD '@@' \x82\xF0\x8Ew\x92肵\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B(\x83o\x81[\x83W\x83\x87\x83\x93 4.10-4.62(TTSSH 1.08-2.50))
+</p>
 
 
 <h2 id="example1">\x97\xE1</h2>

Modified: branches/unicode_buf/doc/ja/html/macro/command/bringupbox.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/bringupbox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/bringupbox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -53,6 +53,8 @@
 <h2>\x8EQ\x8F\xC6</h2>
 <ul>
   <li><a href="statusbox.html">statusbox</a></li>
+  <li><a href="closesbox.html">closesbox</a></li>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
 </ul>
 
 </body>

Modified: branches/unicode_buf/doc/ja/html/macro/command/connect.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/connect.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/connect.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -78,7 +78,7 @@
  <li>COM port \x90ڑ\xB1</li>
 </ul>
 
-<h3>telnet\x90ڑ\xB1</h2>
+<h3>telnet\x90ڑ\xB1</h3>
 
 <pre class=".code">
 <code>connect '<em>myserver</em>:23 /nossh /T=1'
@@ -211,7 +211,7 @@
 connect '<em>myserver</em> /ssh /auth=pageant /user=<em>username</em>'
 
 
-; Tera Term \x82\xF0\x8BN\x93\xAE\x82\xB5\x81A\x83V\x83\x8A\x83A\x83\x8B\x83|\x81[\x83g\x90ڑ\xB1\x82\xF0\x8AJ\x82\xAD\x81B\x83|\x81[\x83g\x94ԍ\x86\x82\xCD 1 \x82\xA9\x82\xE7 256 \x82͈͓̔\xE0
+; Tera Term \x82\xF0\x8BN\x93\xAE\x82\xB5\x81A\x83V\x83\x8A\x83A\x83\x8B\x83|\x81[\x83g\x90ڑ\xB1\x82\xF0\x8AJ\x82\xAD\x81B\x83|\x81[\x83g\x94ԍ\x86\x82\xCD 1 \x82\xA9\x82\xE7 \x8Dő\xE5\x92l(MaxComPort) \x82͈͓̔\xE0\x81B
 connect '/C=x'
 
 CommandLine = '111.111.11.11'

Modified: branches/unicode_buf/doc/ja/html/macro/command/filecopy.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/filecopy.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/filecopy.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -26,9 +26,42 @@
 <p>
 \x83t\x83@\x83C\x83\x8B <file1> \x82\xF0\x83R\x83s\x81[\x82\xB5\x81A\x83t\x83@\x83C\x83\x8B <file2> \x82\xF0\x8D쐬\x82\xB7\x82\xE9\x81B<br>
 <file2> \x82\xAA\x82\xB7\x82łɑ\xB6\x8D݂\xB7\x82\xE9\x8Fꍇ\x82͏㏑\x82\xAB\x82\xB3\x82\xEA\x82\xE9\x81B<file1> \x82\xC6 <file2> \x82͈Ⴄ\x96\xBC\x91O\x82łȂ\xAF\x82\xEA\x82΂Ȃ\xE7\x82Ȃ\xA2\x81B<br>
-\x83t\x83@\x83C\x83\x8B\x82̍폜\x82\xAA\x90\xAC\x8C\x{1C2D42}\xBD\x8Fꍇ\x81A\x83V\x83X\x83e\x83\x80\x95ϐ\x94 result \x82\xC9 0 \x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B\x82\xBB\x82\xEA\x88ȊO\x82̏ꍇ, result \x82\xC9 0 \x88ȊO\x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B
+\x83t\x83@\x83C\x83\x8B\x82̃R\x83s\x81[\x82\xAA\x90\xAC\x8C\x{1C2D42}\xBD\x8Fꍇ\x81A\x83V\x83X\x83e\x83\x80\x95ϐ\x94 result \x82\xC9 0 \x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B\x82\xBB\x82\xEA\x88ȊO\x82̏ꍇ result \x82\xC9 0 \x88ȊO\x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B(\x83o\x81[\x83W\x83\x87\x83\x93 4.104 \x88ȍ~)
 </p>
 
+<h2>\x83V\x83X\x83e\x83\x80\x95ϐ\x94 result \x82̒l</h2>
+
+<p>
+\x82\xB1\x82̃R\x83}\x83\x93\x83h\x82̌\x8B\x89ʁA\x83R\x83s\x81[\x82̏\xF3\x91Ԃɉ\x9E\x82\xB6\x82Ĉȉ\xBA\x82̂\xA4\x82\xBF\x82̈\xEA\x82‚̒l\x82\xAA\x83V\x83X\x83e\x83\x80\x95ϐ\x94 result \x82Ɋi\x94[\x82\xB3\x82\xEA\x82\xE9\x81B
+</p>
+
+<table>
+ <tr>
+  <th>\x92l</th>
+  <th>\x8F\xF3\x91\xD4</th>
+ </tr>
+ <tr>
+  <td>-4</td>
+  <td>\x83R\x83s\x81[\x82Ɏ\xB8\x94s\x82\xB5\x82\xBD\x81B</td>
+ </tr>
+ <tr>
+  <td>-3</td>
+  <td>\x83t\x83@\x83C\x83\x8B <file1> \x82ƃt\x83@\x83C\x83\x8B <file2> \x82\xAA\x93\xAF\x82\xB6\x96\xBC\x91O\x82ł\xA0\x82\xE9\x81B</td>
+ </tr>
+ <tr>
+  <td>-2</td>
+  <td>\x83t\x83@\x83C\x83\x8B <file2> \x82́A\x83t\x83@\x83C\x83\x8B\x96\xBC\x82ɗ\x98\x97p\x82ł\xAB\x82Ȃ\xA2\x95\xB6\x8E\x9A\x82\xF0\x8A܂\xF1\x82ł\xA2\x82\xE9\x81B</td>
+ </tr>
+ <tr>
+  <td>-1</td>
+  <td>\x83t\x83@\x83C\x83\x8B <file1> \x82́A\x83t\x83@\x83C\x83\x8B\x96\xBC\x82ɗ\x98\x97p\x82ł\xAB\x82Ȃ\xA2\x95\xB6\x8E\x9A\x82\xF0\x8A܂\xF1\x82ł\xA2\x82\xE9\x81B</td>
+ </tr>
+ <tr>
+  <td>0</td>
+  <td>\x83R\x83s\x81[\x82ɐ\xAC\x8C\x{1C2D42}\xBD\x81B</td>
+ </tr>
+</table>
+
 <h2>\x97\xE1</h2>
 
 <pre class="macro-example">

Modified: branches/unicode_buf/doc/ja/html/macro/command/fileopen.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/fileopen.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/fileopen.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -26,7 +26,8 @@
 <dl>
 	<dt class="macro">\x90\xAE\x90\x94\x95ϐ\x94 <file handle></dt>
 	<dd>\x82\xE0\x82\xB5\x83t\x83@\x83C\x83\x8B\x82\xAA\x90\xB3\x82\xB5\x82\xAD\x83I\x81[\x83v\x83\x93\x82\xB3\x82ꂽ\x8Fꍇ\x81A\x83t\x83@\x83C\x83\x8B\x83n\x83\x93\x83h\x83\x8B\x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B<br />
-        \x82\xBB\x82\xEA\x88ȊO\x82̏ꍇ\x81A<file handle> \x82\xC9-1\x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B</dd>
+        \x83o\x81[\x83W\x83\x87\x83\x93 4.101 \x88ȑO\x82\xC6 4.104 \x88ȍ~: \x82\xBB\x82\xEA\x88ȊO\x82̏ꍇ\x81A<file handle> \x82\xC9-1\x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B\x83}\x83N\x83\x8D\x83G\x83\x89\x81[\x82Ƃ͂Ȃ\xE7\x82Ȃ\xA2\x81B<br />
+        \x83o\x81[\x83W\x83\x87\x83\x93 4.102, 4.103: \x82\xBB\x82\xEA\x88ȊO\x82̏ꍇ\x81A<file handle> \x82\xC9-1\x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B\x83}\x83N\x83\x8D\x83G\x83\x89\x81[\x82ƂȂ\xE8\x81A\x83}\x83N\x83\x8D\x82̎\xC0\x8Ds\x82\xAA\x88ꎟ\x92\xE2\x8E~\x82\xB7\x82\xE9\x81B</dd>
 
 	<dt class="macro">\x95\xB6\x8E\x9A\x97\xF1 <filename></dt>
 	<dd>\x8AJ\x82\xAD\x83t\x83@\x83C\x83\x8B\x96\xBC\x82\xF0\x8Ew\x92肷\x82\xE9\x81B<br />

Modified: branches/unicode_buf/doc/ja/html/macro/command/filetruncate.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/filetruncate.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/filetruncate.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -25,10 +25,12 @@
 
 <p>
 \x83t\x83@\x83C\x83\x8B <filename> \x82\xF0\x83T\x83C\x83Y <size> \x83o\x83C\x83g\x82̑傫\x82\xB3\x82ɕύX\x82\xB7\x82\xE9\x81B<br>
-\x8Ew\x92肵\x82\xBD\x83T\x83C\x83Y\x82\xAA\x81A\x8A\xF9\x91\xB6\x82̑傫\x82\xB3\x82𒴂\xA6\x82\xBD\x8Fꍇ\x81A\x83k\x83\x8B\x95\xB6\x8E\x9A('\0')\x82\xAA\x92lj\xC1\x82\xB3\x82\xEA\x82\xE9\x81B<br>
-<br>
+\x8Ew\x92肵\x82\xBD\x83T\x83C\x83Y\x82\xAA\x81A\x8A\xF9\x91\xB6\x82̑傫\x82\xB3\x82𒴂\xA6\x82\xBD\x8Fꍇ\x81A\x83k\x83\x8B\x95\xB6\x8E\x9A('\0')\x82\xAA\x92lj\xC1\x82\xB3\x82\xEA\x82\xE9\x81B
+</p>
 
-\x83T\x83C\x83Y\x95ύX\x82ɐ\xAC\x8C\x{1C2D42}\xBD\x8Fꍇ\x82́A\x83V\x83X\x83e\x83\x80\x95ϐ\x94 result \x82\xC9 0 \x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B\x8E\xB8\x94s\x82\xB5\x82\xBD\x8Fꍇ\x82\xCD -1 \x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B
+<p>
+\x83T\x83C\x83Y\x95ύX\x82ɐ\xAC\x8C\x{1C2D42}\xBD\x8Fꍇ\x82́A\x83V\x83X\x83e\x83\x80\x95ϐ\x94 result \x82\xC9 0 \x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B
+\x8E\xB8\x94s\x82\xB5\x82\xBD\x8Fꍇ\x82\xCD -1 \x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B
 </p>
 
 <h2>\x97\xE1</h2>

Modified: branches/unicode_buf/doc/ja/html/macro/command/index.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/index.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/index.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -80,7 +80,7 @@
  <li><a href="waitevent.html">waitevent</a>
  <li><a href="waitln.html">waitln</a>
  <li><a href="waitn.html">waitn</a> (\x83o\x81[\x83W\x83\x87\x83\x93 4.62\x88ȍ~)
- <li><a href="waitrecv.html">waitrecv</a></a>
+ <li><a href="waitrecv.html">waitrecv</a>
  <li><a href="waitregex.html">waitregex</a> (\x83o\x81[\x83W\x83\x87\x83\x93 4.21\x88ȍ~)
  <li><a href="xmodemrecv.html">xmodemrecv</a>
  <li><a href="xmodemsend.html">xmodemsend</a>

Modified: branches/unicode_buf/doc/ja/html/macro/command/inputbox.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/inputbox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/inputbox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -73,7 +73,11 @@
 
 <h2>\x8EQ\x8F\xC6</h2>
 <ul>
+  <li><a href="passwordbox.html">passwordbox</a></li>
+  <li><a href="listbox.html">listbox</a></li>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
   <li><a href="strspecial.html">strspecial</a></li>
+  <li><a href="yesnobox.html">yesnobox</a></li>
 </ul>
 
 </body>

Modified: branches/unicode_buf/doc/ja/html/macro/command/kmtget.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/kmtget.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/kmtget.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -24,7 +24,7 @@
 <h2>\x89\xF0\x90\xE0</h2>
 
 <p>
-\x83t\x83@\x83C\x83\x8B <filename> \x82\xF0 Kermit Get \x83R\x83}\x83\x93\x83h\x82\xF0\x8Eg\x97p\x82\xB5\x82ăz\x83X\x83g\x82\xA9\x82\xE7\x8E\xF3\x90M\x82\xB7\x82\xE9\x81B<br>
+\x83t\x83@\x83C\x83\x8B <filename> \x82\xF0 Kermit Get \x83R\x83}\x83\x93\x83h\x82\xF0\x8Eg\x97p\x82\xB5\x82ăz\x83X\x83g\x82\xA9\x82\xE7\x8E\xF3\x90M\x82\xB7\x82\xE9\x81B<br>
 \x83z\x83X\x83g\x82\xCD server \x8F\xF3\x91ԂłȂ\xAF\x82\xEA\x82΂Ȃ\xE7\x82Ȃ\xA2\x81B \x8E\xF3\x90M\x82\xAA\x8FI\x82\xED\x82\xE9\x82܂Ŏ\x9F\x82̃R\x83}\x83\x93\x83h\x82͎\xC0\x8Ds\x82\xB3\x82\xEA\x82Ȃ\xA2\x81B<br>
 \x83t\x83@\x83C\x83\x8B\x82\xAA\x90\xB3\x82\xB5\x82\xAD\x93]\x91\x97\x82\xB3\x82ꂽ\x8Fꍇ\x81A\x83V\x83X\x83e\x83\x80\x95ϐ\x94 result \x82\xC91\x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B\x82\xBB\x82\xEA\x88ȊO\x82̏ꍇ\x81A result \x82\xC90\x82\xAA\x8Ai\x94[\x82\xB3\x82\xEA\x82\xE9\x81B
 </p>

Modified: branches/unicode_buf/doc/ja/html/macro/command/listbox.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/listbox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/listbox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -108,6 +108,9 @@
 
 <h2>\x8EQ\x8F\xC6</h2>
 <ul>
+  <li><a href="inputbox.html">inputbox</a></li>
+  <li><a href="passwordbox.html">passwordbox</a></li>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
   <li><a href="yesnobox.html">yesnobox</a></li>
 </ul>
 

Modified: branches/unicode_buf/doc/ja/html/macro/command/logopen.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/logopen.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/logopen.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -59,7 +59,7 @@
 <table>
   <tr>
     <th>\x92l</th>
-    <th>\x88Ӗ\xA1</ht>
+    <th>\x88Ӗ\xA1</th>
   </tr>
 
   <tr>

Modified: branches/unicode_buf/doc/ja/html/macro/command/messagebox.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/messagebox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/messagebox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -75,6 +75,8 @@
 
 <h2>\x8EQ\x8F\xC6</h2>
 <ul>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
+  <li><a href="statusbox.html">statusbox</a></li>
   <li><a href="strspecial.html">strspecial</a></li>
 </ul>
 

Modified: branches/unicode_buf/doc/ja/html/macro/command/passwordbox.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/passwordbox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/passwordbox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -75,7 +75,11 @@
 
 <h2>\x8EQ\x8F\xC6</h2>
 <ul>
+  <li><a href="inputbox.html">inputbox</a></li>
+  <li><a href="listbox.html">listbox</a></li>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
   <li><a href="strspecial.html">strspecial</a></li>
+  <li><a href="yesnobox.html">yesnobox</a></li>
 </ul>
 
 </body>

Modified: branches/unicode_buf/doc/ja/html/macro/command/setdlgpos.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/setdlgpos.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/setdlgpos.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -24,7 +24,7 @@
 <h2>\x89\xF0\x90\xE0</h2>
 
 <p>
-<a href="inputbox.html">"inputbox"</a>, <a href="messagebox.html">"messagebox"</a>, <a href="passwordbox.html">"passwordbox"</a>, <a href="statusbox.html">"statusbox"</a> , <a href="listbox.html">"listbox"</a> \x83R\x83}\x83\x93\x83h\x82ŕ\\x8E\xA6\x82\xB3\x82\xEA\x82\xE9\x83_\x83C\x83A\x83\x8D\x83O\x83{\x83b\x83N\x83X\x82̏\x89\x8A\xFA\x88ʒu\x82\xF0\x95ύX\x82\xB7\x82\xE9\x81B<br>
+<a href="inputbox.html">"inputbox"</a>, <a href="listbox.html">"listbox"</a>, <a href="messagebox.html">"messagebox"</a>, <a href="passwordbox.html">"passwordbox"</a>, <a href="statusbox.html">"statusbox"</a>, <a href="yesnobox.html">"yesnobox"</a> \x83R\x83}\x83\x93\x83h\x82ŕ\\x8E\xA6\x82\xB3\x82\xEA\x82\xE9\x83_\x83C\x83A\x83\x8D\x83O\x83{\x83b\x83N\x83X\x82̏\x89\x8A\xFA\x88ʒu\x82\xF0\x95ύX\x82\xB7\x82\xE9\x81B<br>
 \x82܂\xBD\x81A\x83X\x83e\x81[\x83^\x83X\x83_\x83C\x83A\x83\x8D\x83O\x83{\x83b\x83N\x83X\x82\xAA\x95\\x8E\xA6\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9\x8Fꍇ\x81Asetdlgpos \x83R\x83}\x83\x93\x83h\x82͂\xBB\x82̃_\x83C\x83A\x83\x8D\x83O\x83{\x83b\x83N\x83X\x82\xF0\x88ړ\xAE\x82\xB3\x82\xB9\x82\xE9\x81B<br>
 <x> \x82\xC6 <y> \x82͉\xE6\x96ʂ̍\xC0\x95W (x,y) \x82\xF0\x95\\x82킷\x81B\x8C\xB4\x93_ (0,0) \x82͉\xE6\x96ʂ̍\xB6\x8F\xE3\x82̋\xF7\x82̈ʒu\x81B
 </p>

Modified: branches/unicode_buf/doc/ja/html/macro/command/statusbox.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/statusbox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/statusbox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -106,6 +106,7 @@
   <li><a href="strspecial.html">strspecial</a></li>
   <li><a href="closesbox.html">closesbox</a></li>
   <li><a href="bringupbox.html">bringupbox</a></li>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
 </ul>
 
 </body>

Modified: branches/unicode_buf/doc/ja/html/macro/command/yesnobox.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/command/yesnobox.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/command/yesnobox.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -74,6 +74,10 @@
 
 <h2>\x8EQ\x8F\xC6</h2>
 <ul>
+  <li><a href="inputbox.html">inputbox</a></li>
+  <li><a href="listbox.html">listbox</a></li>
+  <li><a href="passwordbox.html">passwordbox</a></li>
+  <li><a href="setdlgpos.html">setdlgpos</a></li>
   <li><a href="strspecial.html">strspecial</a></li>
 </ul>
 

Modified: branches/unicode_buf/doc/ja/html/macro/howtorun.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/howtorun.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/howtorun.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -6,7 +6,7 @@
 <TITLE>\x83}\x83N\x83\x8D\x8E\xC0\x8Ds\x96@</TITLE>
 <META http-equiv="Content-Style-Type" content="text/css">
 <link rel="stylesheet" href="../style.css" type="text/css">
-</HEA>
+</HEAD>
 <BODY>
 
 <h1>\x83}\x83N\x83\x8D\x8E\xC0\x8Ds\x96@</h1>

Modified: branches/unicode_buf/doc/ja/html/macro/syntax/variables.html
===================================================================
--- branches/unicode_buf/doc/ja/html/macro/syntax/variables.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/macro/syntax/variables.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -87,18 +87,73 @@
     <td>0</td>
     <td><a href="../command/bplusrecv.html">bplusrecv</a>,
         <a href="../command/bplussend.html">bplussend</a>,
+        <a href="../command/checksum8.html">checksum8file</a>,
+        <a href="../command/checksum16.html">checksum16file</a>,
+        <a href="../command/checksum32.html">checksum32file</a>,
+        <a href="../command/clipb2var.html">clipb2var</a>,
         <a href="../command/connect.html">connect</a>,
+        <a href="../command/crc16.html">crc16file</a>,
+        <a href="../command/crc32.html">crc32file</a>,
         <a href="../command/cygconnect.html">cygconnect</a>,
+        <a href="../command/dirnamebox.html">dirnamebox</a>,
+        <a href="../command/exec.html">exec</a>,
+        <a href="../command/fileconcat.html">fileconcat</a>,
+        <a href="../command/filecopy.html">filecopy</a>,
+        <a href="../command/filecreate.html">filecreate</a>,
+        <a href="../command/filedelete.html">filedelete</a>,
+        <a href="../command/filelock.html">filelock</a>,
+        <a href="../command/filenamebox.html">filenamebox</a>,
+        <a href="../command/fileread.html">fileread</a>,
+        <a href="../command/filereadln.html">filereadln</a>,
+        <a href="../command/filerename.html">filerename</a>,
+        <a href="../command/filesearch.html">filesearch</a>,
+        <a href="../command/filestat.html">filestat</a>,
+        <a href="../command/filestrseek.html">filestrseek</a>,
+        <a href="../command/filestrseek2.html">filestrseek2</a>,
+        <a href="../command/filetruncate.html">filetruncate</a>,
+        <a href="../command/fileunlock.html">fileunlock</a>,
+        <a href="../command/findoperations.html">findfirst</a>,
+        <a href="../command/findoperations.html">findnext</a>,
+        <a href="../command/getdate.html">getdate</a>,
+        <a href="../command/getfileattr.html">getfileattr</a>,
+        <a href="../command/getipv4addr.html">getipv4addr</a>,
+        <a href="../command/getipv6addr.html">getipv6addr</a>,
+        <a href="../command/getmodemstatus.html">getmodemstatus</a>,
+        <a href="../command/getpassword.html">getpassword</a>,
+        <a href="../command/getspecialfolder.html">getspecialfolder</a>,
+        <a href="../command/gettime.html">gettime</a>,
+        <a href="../command/getttdir.html">getttdir</a>,
+        <a href="../command/getver.html">getver</a>,
+        <a href="../command/ifdefined.html">ifdefined</a>,
+        <a href="../command/ispassword.html">ispassword</a>,
         <a href="../command/kmtfinish.html">kmtfinish</a>,
         <a href="../command/kmtget.html">kmtget</a>,
         <a href="../command/kmtrecv.html">kmtrecv</a>,
         <a href="../command/kmtsend.html">kmtsend</a>,
+        <a href="../command/listbox.html">listbox</a>,
+        <a href="../command/loginfo.html">loginfo</a>,
         <a href="../command/logopen.html">logopen</a>,
         <a href="../command/quickvanrecv.html">quickvanrecv</a>,
         <a href="../command/quickvansend.html">quickvansend</a>,
         <a href="../command/recvln.html">recvln</a>,
+        <a href="../command/setfileattr.html">foldercreate</a>,
+        <a href="../command/setfileattr.html">folderdelete</a>,
+        <a href="../command/setfileattr.html">foldersearch</a>,
+        <a href="../command/setfileattr.html">setfileattr</a>,
+        <a href="../command/setpassword.html">setpassword</a>,
+        <a href="../command/sprintf.html">sprintf</a>,
+        <a href="../command/sprintf2.html">sprintf2</a>,
+        <a href="../command/str2int.html">str2int</a>,
+        <a href="../command/strcompare.html">strcompare</a>,
+        <a href="../command/strlen.html">strlen</a>,
+        <a href="../command/strmatch.html">strmatch</a>,
+        <a href="../command/strreplace.html">strreplace</a>,
+        <a href="../command/strscan.html">strscan</a>,
+        <a href="../command/strsplit.html">strsplit</a>,
         <a href="../command/testlink.html">testlink</a>,
+        <a href="../command/var2clipb.html">var2clipb</a>,
         <a href="../command/wait.html">wait</a>,
+        <a href="../command/wait4all.html">wait4all</a>,
         <a href="../command/waitevent.html">waitevent</a>,
         <a href="../command/waitln.html">waitln</a>,
         <a href="../command/waitn.html">waitn</a>,
@@ -106,39 +161,11 @@
         <a href="../command/waitregex.html">waitregex</a>,
         <a href="../command/xmodemrecv.html">xmodemrecv</a>,
         <a href="../command/xmodemsend.html">xmodemsend</a>,
+        <a href="../command/yesnobox.html">yesnobox</a>,
+        <a href="../command/ymodemrecv.html">ymodemrecv</a>,
+        <a href="../command/ymodemsend.html">ymodemsend</a>,
         <a href="../command/zmodemrecv.html">zmodemrecv</a>,
-        <a href="../command/zmodemsend.html">zmodemsend</a>,
-        <a href="../command/sprintf.html">sprintf</a>,
-        <a href="../command/str2int.html">str2int</a>,
-        <a href="../command/strcompare.html">strcompare</a>,
-        <a href="../command/strlen.html">strlen</a>,
-        <a href="../command/strmatch.html">strmatch</a>,
-        <a href="../command/strscan.html">strscan</a>,
-        <a href="../command/fileconcat.html">fileconcat</a>,
-        <a href="../command/filecopy.html">filecopy</a>,
-        <a href="../command/filecreate.html">filecreate</a>,
-        <a href="../command/filedelete.html">filedelete</a>,
-        <a href="../command/fileread.html">fileread</a>,
-        <a href="../command/filereadln.html">filereadln</a>,
-        <a href="../command/filerename.html">filerename</a>,
-        <a href="../command/filesearch.html">filesearch</a>,
-        <a href="../command/filestrseek.html">filestrseek</a>,
-        <a href="../command/filestrseek2.html">filestrseek2</a>,
-        <a href="../command/findoperations.html">findfirst</a>,
-        <a href="../command/findoperations.html">findnext</a>,
-        <a href="../command/clipb2var.html">clipb2var</a>,
-        <a href="../command/crc32.html">crc32file</a>,
-        <a href="../command/getdate.html">getdate</a>,
-        <a href="../command/gettime.html">gettime</a>,
-        <a href="../command/getver.html">getver</a>,
-        <a href="../command/ifdefined.html">ifdefined</a>,
-        <a href="../command/var2clipb.html">var2clipb</a>,
-        <a href="../command/yesnobox.html">yesnobox</a>,
-        <a href="../command/getfileattr.html">getfileattr</a>,
-        <a href="../command/setfileattr.html">setfileattr</a>,
-        <a href="../command/setfileattr.html">foldercreate</a>,
-        <a href="../command/setfileattr.html">folderdelete</a>,
-        <a href="../command/setfileattr.html">foldersearch</a></td>
+        <a href="../command/zmodemsend.html">zmodemsend</a></td>
   </tr>
   <tr>
     <td>timeout</td>

Modified: branches/unicode_buf/doc/ja/html/menu/file-chdir.html
===================================================================
--- branches/unicode_buf/doc/ja/html/menu/file-chdir.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/menu/file-chdir.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -16,7 +16,8 @@
 
     <h2>"Change directory" \x83_\x83C\x83A\x83\x8D\x83O\x83{\x83b\x83N\x83X</h2>
     <p>
-      \x90V\x82\xB5\x82\xA2\x83f\x83B\x83\x8C\x83N\x83g\x83\x8A\x82\xF0\x93\xFC\x97͂\xB5\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B
+      \x90V\x82\xB5\x82\xA2\x83f\x83B\x83\x8C\x83N\x83g\x83\x8A\x82\xF0\x93\xFC\x97͂\xB5\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B<br />
+      \x82\xB1\x82̐ݒ\xE8\x92l\x82\xAA\x8Eg\x97p\x82\xB3\x82\xEA\x82\xE9\x82Ƃ\xAB\x81A\x8A‹\xAB\x95ϐ\x94\x82\xAA\x8A܂܂\xEA\x82Ă\xA2\x82\xEA\x82ΓW\x8AJ\x82\xB3\x82\xEA\x82܂\xB7\x81B
     </p>
   </body>
 </html>

Modified: branches/unicode_buf/doc/ja/html/menu/file-new.html
===================================================================
--- branches/unicode_buf/doc/ja/html/menu/file-new.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/menu/file-new.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -73,7 +73,7 @@
     <dl>
       <dt>Port</dt>
       <dd>
-	\x90ڑ\xB1\x82\xB7\x82\xE9\x83V\x83\x8A\x83A\x83\x8B\x83|\x81[\x83g\x82\xF0\x83\x8A\x83X\x83g\x82̒\x86\x82\xA9\x82\xE7\x91I\x91\xF0\x82\xB5\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B
+	\x90ڑ\xB1\x82\xB7\x82\xE9\x83V\x83\x8A\x83A\x83\x8B\x83|\x81[\x83g\x82\xF0\x83\x8A\x83X\x83g\x82̒\x86\x82\xA9\x82\xE7\x91I\x91\xF0\x82\xB5\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B\x83\x8A\x83X\x83g\x82ɕ\\x8E\xA6\x82\xB3\x82\xEA\x82\xE9\x83V\x83\x8A\x83A\x83\x8B\x83|\x81[\x83g\x94ԍ\x86\x82̍ő\xE5\x92l\x82̓f\x83t\x83H\x83\x8B\x83g\x82\xC5256\x82ƂȂ\xC1\x82Ă\xA2\x82܂\xB7\x81B<a href="../setup/teraterm-com.html#maxport">MaxComPort</a>\x82ōő\xE5\x92l\x82\xF0\x95ύX\x82ł\xAB\x82܂\xB7\x81B
       </dd>
     </dl>
   </body>

Modified: branches/unicode_buf/doc/ja/html/menu/setup-additional.html
===================================================================
--- branches/unicode_buf/doc/ja/html/menu/setup-additional.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/menu/setup-additional.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -250,6 +250,12 @@
 	\x95\xA1\x90\x94\x8Ds\x82̃f\x81[\x83^\x82\xF0\x93\\x82\xE8\x95t\x82\xAF\x82\xE9\x82Ƃ\xAB\x81A\x89\xFC\x8Ds\x82\xAA\x8C\xBB\x82\xEA\x82邲\x82ƂɃf\x81[\x83^\x82̑\x97\x90M\x82\xF0\x92x\x89\x84\x82\xB3\x82\xB9\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B\x92x\x89\x84\x82\xB7\x82鎞\x8AԂ\xF0\x83~\x83\x8A\x95b\x82Őݒ肵\x82܂\xB7\x81B
       </dd>
 
+      <dt id="SelectOnActivate">Disabling text selection when the window is activated</dt>
+      <dd>
+        \x94\xF1\x91I\x91\xF0\x8F\xF3\x91Ԃ̃E\x83B\x83\x93\x83h\x83E\x82\xF0\x81A\x95\xB6\x8E\x9A\x97̈\xE6\x82\xF0\x83}\x83E\x83X\x82ŃN\x83\x8A\x83b\x83N\x82\xB7\x82邱\x82Ƃ\xC5
+        \x91I\x91\xF0\x82\xB7\x82\xE9\x82Ƃ\xAB\x81A\x95\xB6\x8E\x9A\x82̑I\x91\xF0\x82\xF0\x8B֎~\x82\xB5\x82܂\xB7\x81B
+      </dd>
+
     </dl>
 
 

Modified: branches/unicode_buf/doc/ja/html/menu/setup-serialport.html
===================================================================
--- branches/unicode_buf/doc/ja/html/menu/setup-serialport.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/menu/setup-serialport.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -15,7 +15,7 @@
     <dl>
       <dt id="ComPort">Port</dt>
       <dd>
-	\x8Eg\x97p\x82\xB7\x82\xE9\x83|\x81[\x83g\x81B
+	\x8Eg\x97p\x82\xB7\x82\xE9\x83|\x81[\x83g\x82ł\xB7\x81B\x83\x8A\x83X\x83g\x82ɕ\\x8E\xA6\x82\xB3\x82\xEA\x82\xE9\x83V\x83\x8A\x83A\x83\x8B\x83|\x81[\x83g\x94ԍ\x86\x82̍ő\xE5\x92l\x82̓f\x83t\x83H\x83\x8B\x83g\x82\xC5256\x82ƂȂ\xC1\x82Ă\xA2\x82܂\xB7\x81B<a href="../setup/teraterm-com.html#maxport">MaxComPort</a>\x82ōő\xE5\x92l\x82\xF0\x95ύX\x82ł\xAB\x82܂\xB7\x81B
       </dd>
 
       <dt id="Speed">Speed, Data, Parity, Stop bits, Flow control</dt>

Modified: branches/unicode_buf/doc/ja/html/menu/setup-sshkeygenerator.html
===================================================================
--- branches/unicode_buf/doc/ja/html/menu/setup-sshkeygenerator.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/menu/setup-sshkeygenerator.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -70,6 +70,6 @@
       <dt id="save_private">Save private key</dt>
       <dd>\x90\xB6\x90\xAC\x82\xB5\x82\xBD\x94閧\x8C\xAE\x82\xF0\x95ۑ\xB6\x82\xB5\x82܂\xB7\x81B<br />
       \x94閧\x8C\xAE\x82\xCD AES-128 \x82ňÍ\x86\x89\xBB\x82\xB3\x82\xEA\x82܂\xB7\x81B(Tera Term 4.76(TTSSH 2.63) \x82܂ł\xCD 3DES \x82ňÍ\x86\x89\xBB\x82\xB3\x82\xEA\x82܂\xB5\x82\xBD)</dd>
-    <dl>
+    </dl>
   </body>
 </html>

Modified: branches/unicode_buf/doc/ja/html/menu/setup-window.html
===================================================================
--- branches/unicode_buf/doc/ja/html/menu/setup-window.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/menu/setup-window.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -107,7 +107,7 @@
 	    \x8Ew\x92肵\x82\xBD\x95\xB6\x8E\x9A\x91\xAE\x90\xAB\x82̐F\x82\xCCRGB\x92l\x82\xF0\x8Ew\x92肵\x82܂\xB7\x81B
 	  </dd>
 
-	  <dt id="UseNormalBGColor">Always use Normal text's BG</td>
+	  <dt id="UseNormalBGColor">Always use Normal text's BG</dt>
 	  <dd>
 	    On\x82ɂ\xB7\x82\xE9\x82ƁABold, Blink, URL\x91\xAE\x90\xAB\x82̔w\x8Ci\x90F\x82̐ݒ\xE8\x82͖\xB3\x8E\x8B\x82\xB3\x82\xEA\x81A
 	    Normal\x82̔w\x8Ci\x90F\x82\xAA\x8Eg\x82\xED\x82\xEA\x82\xE9\x82悤\x82ɂȂ\xE8\x82܂\xB7\x81B

Modified: branches/unicode_buf/doc/ja/html/reference/sourcecode.html
===================================================================
--- branches/unicode_buf/doc/ja/html/reference/sourcecode.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/reference/sourcecode.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -515,7 +515,7 @@
 <pre class=code>
 #define WM_SEND_HEARTBEAT (WM_USER + 1)
 
-static LRESULT CALLBACK telnet_heartbeat_dlg_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
+static INT_PTR CALLBACK telnet_heartbeat_dlg_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
 {
 
 	switch (msg) {
@@ -566,11 +566,12 @@
   if (ts.TelKeepAliveInterval > 0) {
     nop_interval = ts.TelKeepAliveInterval;
 
-	keepalive_dialog = CreateDialog(hInst, MAKEINTRESOURCE(IDD_BROADCAST_DIALOG),
-               HVTWin, (DLGPROC)telnet_heartbeat_dlg_proc);
+    keepalive_dialog = CreateDialog(hInst, MAKEINTRESOURCE(IDD_BROADCAST_DIALOG),
+               HVTWin, telnet_heartbeat_dlg_proc);
 
     keepalive_thread = (HANDLE)_beginthreadex(NULL, 0, TelKeepAliveThread, NULL, 0, &tid);
-    if (keepalive_thread == (HANDLE)-1) {
+    if (keepalive_thread == 0) {
+      keepalive_thread = INVALID_HANDLE_VALUE;
       nop_interval = 0;
     }
   }

Modified: branches/unicode_buf/doc/ja/html/setup/teraterm-com.html
===================================================================
--- branches/unicode_buf/doc/ja/html/setup/teraterm-com.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/setup/teraterm-com.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -20,7 +20,12 @@
 </pre>
 
 <p>
-\x82̂悤\x82ɕύX\x82\xB5\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B\x82\xBD\x82Ƃ\xA6\x8E\xC0\x8DۂɎg\x97p\x89”\\x82ȃ|\x81[\x83g\x94ԍ\x86\x82̍ő\xE5\x92l\x82\xAA4\x82\xE6\x82菬\x82\xB3\x82\xAD\x82Ă\xE0\x81A3\x88ȉ\xBA\x82̒l\x82͎w\x92\xE8\x82ł\xAB\x82܂\xB9\x82\xF1\x81B
+\x82̂悤\x82ɕύX\x82\xB5\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B\x82\xBD\x82Ƃ\xA6\x8E\xC0\x8DۂɎg\x97p\x89”\\x82ȃ|\x81[\x83g\x94ԍ\x86\x82̍ő\xE5\x92l\x82\xAA4\x82\xE6\x82菬\x82\xB3\x82\xAD\x82Ă\xE0\x81A3\x88ȉ\xBA\x82̒l\x82͎w\x92\xE8\x82ł\xAB\x82܂\xB9\x82\xF1\x81B<br>
+\x8Ew\x92\xE8\x82ł\xAB\x82\xE9\x8Dő\xE5\x92l\x82͈ȉ\xBA\x82̂Ƃ\xA8\x82\xE8\x82ł\xB7\x81B<br>
+  4096 (\x83o\x81[\x83W\x83\x87\x83\x934.65\x88ȍ~)<br>
+  256 (\x83o\x81[\x83W\x83\x87\x83\x934.55\x88ȍ~)<br>
+  99 (\x83o\x81[\x83W\x83\x87\x83\x934.24\x88ȍ~)<br>
+  16 (\x83o\x81[\x83W\x83\x87\x83\x934.24\x88ȑO)<br>
 </p>
 
 <pre>

Modified: branches/unicode_buf/doc/ja/html/uninstall.html
===================================================================
--- branches/unicode_buf/doc/ja/html/uninstall.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/uninstall.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -10,14 +10,24 @@
 
 <h1>\x83A\x83\x93\x83C\x83\x93\x83X\x83g\x81[\x83\x8B</h1>
 
+<h2>\x83C\x83\x93\x83X\x83g\x81[\x83\x89\x82\xA9\x82瓱\x93\xFC\x82\xB5\x82\xBD\x8Fꍇ</h2>
+
 <p>
-Tera Term \x82\xF0\x8D폜\x82\xB7\x82\xE9\x82ɂ́A\x83R\x83\x93\x83g\x83\x8D\x81[\x83\x8B\x83p\x83l\x83\x8B\x82́u\x83v\x83\x8D\x83O\x83\x89\x83\x80\x82Ƌ@\x94\\x81v\x82\xF0\x8E\xC0\x8Ds\x82\xB7\x82邩\x81ATera Term \x83f\x83B\x83\x8C\x83N\x83g\x83\x8A\x82ɂ\xA0\x82\xE9 unins000.exe \x82\xF0\x8E\xC0\x8Ds\x82\xB5\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B
+Tera Term \x82\xF0\x8D폜\x82\xB7\x82\xE9\x82ɂ́A\x83R\x83\x93\x83g\x83\x8D\x81[\x83\x8B\x83p\x83l\x83\x8B\x82́u\x83v\x83\x8D\x83O\x83\x89\x83\x80\x82Ƌ@\x94\\x81v\x82\xF0\x8E\xC0\x8Ds\x82\xB7\x82邩\x81ATera Term \x83f\x83B\x83\x8C\x83N\x83g\x83\x8A\x82ɂ\xA0\x82\xE9 unins000.exe \x82\xF0\x8E\xC0\x8Ds\x82\xB5\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B<br>
+\x82\xE0\x82\xB5\x82\xB1\x82̃A\x83\x93\x83C\x83\x93\x83X\x83g\x81[\x83\x89\x81[\x82\xAA\x93\xAE\x82\xA9\x82Ȃ\xA2\x8Fꍇ\x82́A\x8E蓮\x82ł\xE0Tera Term\x82\xF0\x83A\x83\x93\x83C\x83\x93\x83X\x83g\x81[\x83\x8B\x82\xB7\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B<br>
 </p>
 
+<h2>ZIP\x83A\x81[\x83J\x83C\x83u\x82\xF0\x8Eg\x97p\x82\xB5\x82\xBD\x8Fꍇ</h2>
+
 <p>
-\x82\xE0\x82\xB5\x82\xB1\x82̃A\x83\x93\x83C\x83\x93\x83X\x83g\x81[\x83\x89\x81[\x82\xAA\x93\xAD\x82\xA9\x82Ȃ\xA2\x8Fꍇ\x82́A\x8E蓮\x82ł\xE0\x83A\x83\x93\x83C\x83\x93\x83X\x83g\x81[\x83\x8B\x82\xB7\x82邱\x82Ƃ\xAA\x82ł\xAB\x82܂\xB7\x81B<br>
+\x8E蓮\x82ŃA\x83\x93\x83C\x83\x93\x83X\x83g\x81[\x83\x8B\x82\xB5\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B<br>
+</p>
+
+<h2>\x8E蓮\x83A\x83\x93\x83C\x83\x93\x83X\x83g\x81[\x83\x8B</h2>
+
+<p>
 Tera Term \x83f\x83B\x83\x8C\x83N\x83g\x83\x8A\x82ɂ\xA0\x82\xE9 Tera Term \x8A֌W\x82̃t\x83@\x83C\x83\x8B\x82\xF0\x82\xB7\x82ׂč폜\x82\xB5\x81A\x83R\x83\x93\x83g\x83\x8D\x81[\x83\x8B\x83p\x83l\x83\x8B\x82́u\x83t\x83H\x83\x93\x83g\x81v\x82\xA9\x82\xE7 "Tera Special" \x83t\x83H\x83\x93\x83g\x82\xF0\x8D폜\x82\xB5\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B<br>
-Tera Term Menu\x82\xF0\x8Eg\x97p\x82\xB5\x82Ă\xA2\x82\xBD\x8Fꍇ\x82́A\x83\x8C\x83W\x83X\x83g\x83\x8A HKEY_CURRENT_USER\Software\ShinpeiTools\TTermMenu \x82\xF0\x8D폜\x82\xB5\x82ĉ\xBA\x82\xB3\x82\xA2\x81B
+Tera Term Menu\x82\xF0\x8Eg\x97p\x82\xB5\x82Ă\xA2\x82\xBD\x8Fꍇ\x82́A\x83\x8C\x83W\x83X\x83g\x83\x8A HKEY_CURRENT_USER\Software\ShinpeiTools\TTermMenu \x82\xF0\x8D폜\x82\xB5\x82Ă\xAD\x82\xBE\x82\xB3\x82\xA2\x81B
 </p>
 
 </BODY>

Modified: branches/unicode_buf/doc/ja/html/usage/LogMeTT/LogMeTTTutorial.htm
===================================================================
--- branches/unicode_buf/doc/ja/html/usage/LogMeTT/LogMeTTTutorial.htm	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/usage/LogMeTT/LogMeTTTutorial.htm	2019-08-20 14:35:14 UTC (rev 7998)
@@ -282,7 +282,6 @@
 
 <p>
 e-mail: boris****@logme***** <br>
-<a href="http://www.logmett.com/index.php?/Products/LogMeTT.html">LogMeTT web page</a>
 </p>
 
 </body>

Modified: branches/unicode_buf/doc/ja/html/usage/keyboard.html
===================================================================
--- branches/unicode_buf/doc/ja/html/usage/keyboard.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/usage/keyboard.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -77,7 +77,7 @@
 <dd>VT window \x82Ɉړ\xAE\x82\xB5\x82܂\xB7\x81B</dd>
 
 <dt>Alt+P</dt>
-<dd>\x89\xE6\x96ʑS\x91̂܂\xBD\x82́A\x83}\x83E\x83X\x82őI\x91\xF0\x82\xB3\x82ꂽ\x97̈\xE6\x82̉摜\x82\xF0\x88\xF3\x8D\xFC\x82\xB5\x82܂\xB7\x81B</d>
+<dd>\x89\xE6\x96ʑS\x91̂܂\xBD\x82́A\x83}\x83E\x83X\x82őI\x91\xF0\x82\xB3\x82ꂽ\x97̈\xE6\x82̉摜\x82\xF0\x88\xF3\x8D\xFC\x82\xB5\x82܂\xB7\x81B</dd>
 
 <dt>Alt+Q \x82܂\xBD\x82\xCD Alt+F4</dt>
 <dd>TEK window \x82\xF0\x95‚\xB6\x82܂\xB7\x81B</dd>

Modified: branches/unicode_buf/doc/ja/html/usage/proxy.html
===================================================================
--- branches/unicode_buf/doc/ja/html/usage/proxy.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/usage/proxy.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -10,7 +10,7 @@
   </head>
 
   <body>
-    <h1>Proxy \x90ڑ\xB1</h2>
+    <h1>Proxy \x90ڑ\xB1</h1>
 
     <p>
       Tera Term \x82Ŏ\xC0\x91\x95\x82\xB3\x82ꂽ Proxy \x90ڑ\xB1\x82ɂ‚\xA2\x82ĉ\xF0\x90\xE0\x82\xB5\x82܂\xB7\x81B

Modified: branches/unicode_buf/doc/ja/html/usage/recurringcommand.html
===================================================================
--- branches/unicode_buf/doc/ja/html/usage/recurringcommand.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/usage/recurringcommand.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -48,7 +48,7 @@
 	\x91\x97\x90M\x82\xB7\x82\xE9\x83R\x83}\x83\x93\x83h(\x95\xB6\x8E\x9A\x97\xF1)\x82\xF0\x8Ew\x92肵\x82܂\xB7\x81B\x83R\x83}\x83\x93\x83h\x82Ɉȉ\xBA\x82̕\xB6\x8E\x9A\x97񂪊܂܂\xEA\x82Ă\xA2\x82\xE9\x8Fꍇ\x81A\x91Ή\x9E\x82\xB7\x82镶\x8E\x9A\x82ɒu\x82\xAB\x8A\xB7\x82\xA6\x82\xE7\x82\xEA\x82܂\xB7
 	<table border="1">
 	    <tbody>
-		<tr><th>\x83V\x81[\x83P\x83\x93\x83X</th>	<th> \x91\x97\x90M\x95\xB6\x8E\x9A </ht></tr>
+		<tr><th>\x83V\x81[\x83P\x83\x93\x83X</th>	<th> \x91\x97\x90M\x95\xB6\x8E\x9A </th></tr>
 		<tr><td> \\ </td>	<td> \ </td></tr>
 		<tr><td> \n </td>	<td> \x89\xFC\x8Ds (LF) </td></tr>
 		<tr><td> \t </td>	<td> \x90\x85\x95\xBD\x83^\x83u (HT) </td></tr>

Modified: branches/unicode_buf/doc/ja/html/usage/shortcut.html
===================================================================
--- branches/unicode_buf/doc/ja/html/usage/shortcut.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/usage/shortcut.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -12,7 +12,7 @@
 <h1>\x83V\x83\x87\x81[\x83g\x83J\x83b\x83g</h1>
 
 <dl>
-<dt>ScrollLock</td>
+<dt>ScrollLock</dt>
 <dd>Tera Term\x83E\x83B\x83\x93\x83h\x83E\x82̃X\x83N\x83\x8D\x81[\x83\x8B\x83\x8D\x83b\x83N/\x83\x8D\x83b\x83N\x89\xF0\x8F\x9C\x81i\x83g\x83O\x83\x8B\x81j</dd>
 
 <dt>Ctrl + Tab, Ctrl + Shift + Tab</dt>

Modified: branches/unicode_buf/doc/ja/html/usage/unicode.html
===================================================================
--- branches/unicode_buf/doc/ja/html/usage/unicode.html	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/doc/ja/html/usage/unicode.html	2019-08-20 14:35:14 UTC (rev 7998)
@@ -47,9 +47,11 @@
 </pre>
 
 <p>
-(1)\x82ɂ\xA8\x82\xA2\x82āAUTF-8\x82\xCD3\x83o\x83C\x83g\x82܂ł\xB5\x82\xA9\x95ϊ\xB7\x82\xB5\x82Ă\xA2\x82Ȃ\xA2\x82\xBD\x82߁A
-\x83T\x83\x8D\x83Q\x81[\x83g\x83y\x83A(surrogate pair)\x82⌋\x8D\x87\x95\xB6\x8E\x9A(combining character)<!--\x81A
-\x95\xAA\x89\xF0\x8C`\x8E\xAE(decomposed form)-->\x82Ȃǂɂ͑Ή\x9E\x82\xB5\x82Ă\xA2\x82܂\xB9\x82\xF1\x81B<br>
+(1)\x82ɂ\xA8\x82\xA2\x82āA4.102\x82\xA9\x82\xE7 4byte UTF-8 \x82ɑΉ\x9E\x82\xB5\x82\xBD\x82\xBD\x82߁AUTF-8\x82̃f\x83R\x81[\x83h\x8E\x9E\x82\xC9
+Unicode \x82̏\xEE\x95񂪌\x87\x97\x8E\x82\xB7\x82邱\x82Ƃ͂Ȃ\xAD\x82Ȃ\xE8\x82܂\xB5\x82\xBD\x81B<br>
+\x8A\xBF\x8E\x9A\x83R\x81[\x83h(\x8E\xF3\x90M) \x82\xC9 UTF-8m \x82\xAA\x91I\x91\xF0\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9\x82ƌ\x8B\x8D\x87\x95\xB6\x8E\x9A(combining
+character)\x82̏\x88\x97\x9D\x82\xAA\x88ꕔ\x82\xAA\x8Ds\x82\xED\x82\xEA\x82܂\xB7\x81BMac OS X(HFS+)\x82\xF0\x8Dl\x97\xB6\x82\xB5\x82\xBD\x82\xE0\x82̂ƂȂ\xC1
+\x82Ă\xA2\x82܂\xB7\x81B<br>
 
 (2)\x82ɂ\xA8\x82\xA2\x82āAUnicode\x82\xC6MBCS(Multiple Byte Character Set)\x82̑\x8A\x8Cݕϊ\xB7\x82\xF0\x8Ds\x82\xA4\x82\xBD\x82߂ɁA
 \x83\x8D\x83P\x81[\x83\x8B(\x8C\xBE\x8C\xEA\x8Ew\x92\xE8)\x82𐳂\xB5\x82\xAD\x90ݒ肷\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82\xE8\x82܂\xB7\x81B

Added: branches/unicode_buf/installer/CMakeLists.txt
===================================================================
--- branches/unicode_buf/installer/CMakeLists.txt	                        (rev 0)
+++ branches/unicode_buf/installer/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -0,0 +1,40 @@
+
+install(
+  DIRECTORY release/
+  DESTINATION .
+  PATTERN *~ EXCLUDE
+  PATTERN TERATERM.INI EXCLUDE
+  )
+
+install(
+  FILES release/EDITOR.CNF
+  DESTINATION .
+  RENAME KEYBOARD.CNF
+  )
+
+if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux")
+  find_program(
+    PERL perl
+    )
+else()
+  # CYGWIN / Active Perl
+  find_program(
+    PERL perl.exe
+    HINTS c:/Perl64/bin
+    HINTS c:/Perl/bin
+    HINTS c:/cygwin/usr/bin
+    HINTS c:/cygwin64/usr/bin
+    )
+endif()
+
+add_custom_target(
+  inifile ALL
+  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/TERATERM.INI
+  COMMAND ${PERL} ${CMAKE_CURRENT_SOURCE_DIR}/setini.pl ${CMAKE_CURRENT_SOURCE_DIR}/release/TERATERM.INI > "${CMAKE_CURRENT_BINARY_DIR}/TERATERM.INI"
+  COMMENT create "${CMAKE_CURRENT_BINARY_DIR}/TERATERM.INI"
+  )
+
+install(
+  FILES ${CMAKE_CURRENT_BINARY_DIR}/TERATERM.INI
+  DESTINATION .
+  )

Modified: branches/unicode_buf/installer/release/lang/English.lng
===================================================================
--- branches/unicode_buf/installer/release/lang/English.lng	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/installer/release/lang/English.lng	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-06-10)
+; Updated by TeraTerm Project (2019-08-16)
 
 [Tera Term]
 DLG_SYSTEM_FONT=System,14,0
@@ -225,6 +225,7 @@
 DLG_TAB_COPYPASTE_DELIMITER=Del&imiter characters
 DLG_TAB_COPYPASTE_PASTEDELAY=P&aste delay per line
 DLG_TAB_COPYPASTE_PASTEDELAY2=ms
+DLG_TAB_COPYPASTE_SELECT_ON_ACTIVATE=Ena&bling text selection when the window is activated by mouse
 
 DLG_TAB_VISUAL_ALPHA=Window Transparency
 DLG_TAB_VISUAL_ALPHA_ACTIVE=&Active

Modified: branches/unicode_buf/installer/release/lang/French.lng
===================================================================
--- branches/unicode_buf/installer/release/lang/French.lng	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/installer/release/lang/French.lng	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-06-10)
+; Updated by TeraTerm Project (2019-08-16)
 ; Last translated (French language) by Francois MOCQ (2010-07-21)
 
 [Tera Term]
@@ -226,6 +226,7 @@
 DLG_TAB_COPYPASTE_DELIMITER=Caract\xE8res d\xE9limiteurs
 DLG_TAB_COPYPASTE_PASTEDELAY=D\xE9lai avant de coller la ligne
 DLG_TAB_COPYPASTE_PASTEDELAY2=ms
+DLG_TAB_COPYPASTE_SELECT_ON_ACTIVATE=Ena&bling text selection when the window is activated by mouse
 
 DLG_TAB_VISUAL_ALPHA=M\xE9lange alpha
 DLG_TAB_VISUAL_ALPHA_ACTIVE=&Active

Modified: branches/unicode_buf/installer/release/lang/German.lng
===================================================================
--- branches/unicode_buf/installer/release/lang/German.lng	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/installer/release/lang/German.lng	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-06-10)
+; Updated by TeraTerm Project (2019-08-16)
 ; Last translated (German language) by Frederik Schwarzer (2010-05-17)
 
 [Tera Term]
@@ -226,6 +226,7 @@
 DLG_TAB_COPYPASTE_DELIMITER=&Begrenzungszeichen
 DLG_TAB_COPYPASTE_PASTEDELAY=P&aste delay per line
 DLG_TAB_COPYPASTE_PASTEDELAY2=ms
+DLG_TAB_COPYPASTE_SELECT_ON_ACTIVATE=Ena&bling text selection when the window is activated by mouse
 
 DLG_TAB_VISUAL_ALPHA=&Transparenz
 DLG_TAB_VISUAL_ALPHA_ACTIVE=&Active

Modified: branches/unicode_buf/installer/release/lang/Japanese.lng
===================================================================
--- branches/unicode_buf/installer/release/lang/Japanese.lng	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/installer/release/lang/Japanese.lng	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-06-10)
+; Updated by TeraTerm Project (2019-08-16)
 
 [Tera Term]
 DLG_SYSTEM_FONT=\x82l\x82r \x82o\x83S\x83V\x83b\x83N,12,128
@@ -225,6 +225,7 @@
 DLG_TAB_COPYPASTE_DELIMITER=\x8B\xE6\x90؂蕶\x8E\x9A(&I)
 DLG_TAB_COPYPASTE_PASTEDELAY=\x93\\x82\xE8\x95t\x82\xAF\x82̍s\x8AԒx\x89\x84(&A)
 DLG_TAB_COPYPASTE_PASTEDELAY2=\x83~\x83\x8A\x95b
+DLG_TAB_COPYPASTE_SELECT_ON_ACTIVATE=\x83}\x83E\x83X\x82ŃE\x83B\x83\x93\x83h\x83E\x91I\x91\xF0\x8E\x9E\x82̕\xB6\x8E\x9A\x91I\x91\xF0\x82\xF0\x97L\x8C\xF8\x82ɂ\xB7\x82\xE9(&b)
 
 DLG_TAB_VISUAL_ALPHA=\x94\xBC\x93\xA7\x96\xBE\x93x
 DLG_TAB_VISUAL_ALPHA_ACTIVE=\x83A\x83N\x83e\x83C\x83u\x8E\x9E(&A)

Modified: branches/unicode_buf/installer/release/lang/Korean.lng
===================================================================
--- branches/unicode_buf/installer/release/lang/Korean.lng	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/installer/release/lang/Korean.lng	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-06-10)
+; Updated by TeraTerm Project (2019-08-16)
 ; Last translated (Korean language) by Daehong Kim (2013-07-25)
 
 [Tera Term]
@@ -226,6 +226,7 @@
 DLG_TAB_COPYPASTE_DELIMITER=\xB1\xB8\xBA\xD0\xC0\xDA \xB9\xAE\xC0\xDA(&I)
 DLG_TAB_COPYPASTE_PASTEDELAY=\xC1ٴ\xE7 \xBAٿ\xA9\xB3ֱ\xE2 \xC1\xF6\xBF\xAC(&A)
 DLG_TAB_COPYPASTE_PASTEDELAY2=ms
+DLG_TAB_COPYPASTE_SELECT_ON_ACTIVATE=Ena&bling text selection when the window is activated by mouse
 
 DLG_TAB_VISUAL_ALPHA=\xC5\xF5\xB8\x{DD75}
 DLG_TAB_VISUAL_ALPHA_ACTIVE=&Active

Modified: branches/unicode_buf/installer/release/lang/Russian.lng
===================================================================
--- branches/unicode_buf/installer/release/lang/Russian.lng	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/installer/release/lang/Russian.lng	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-06-10)
+; Updated by TeraTerm Project (2019-08-16)
 ; Last translated (Russian language) by Ryumik Sergey (2017-07-19)
 
 [Tera Term]
@@ -226,6 +226,7 @@
 DLG_TAB_COPYPASTE_DELIMITER=&\xD0\xE0\xE7\xE4\xE5\xEB\xE8\xF2\xE5\xEB\xFC \xF1\xE8\xEC\xE2\xEE\xEB\xEE\xE2
 DLG_TAB_COPYPASTE_PASTEDELAY=&\xC2\xF1\xF2\xE0\xE2\xE8\xF2\xFC \xE7\xE0\xE4\xE5\xF0\xE6\xEA\xF3
 DLG_TAB_COPYPASTE_PASTEDELAY2=\xEC\xF1
+DLG_TAB_COPYPASTE_SELECT_ON_ACTIVATE=Ena&bling text selection when the window is activated by mouse
 
 DLG_TAB_VISUAL_ALPHA=&\xCF\xF0\xEE\xE7\xF0\xE0\xF7\xED\xFB\xE9
 DLG_TAB_VISUAL_ALPHA_ACTIVE=&Active

Modified: branches/unicode_buf/installer/release/lang/Simplified Chinese.lng
===================================================================
--- branches/unicode_buf/installer/release/lang/Simplified Chinese.lng	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/installer/release/lang/Simplified Chinese.lng	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-06-10)
+; Updated by TeraTerm Project (2019-08-16)
 ; Last translated (Simplified Chinese language) by LiShaohui (2017-04-11)
 
 [Tera Term]
@@ -226,6 +226,7 @@
 DLG_TAB_COPYPASTE_DELIMITER=\xB7ָ\xF4\xB7\xFB(&I)
 DLG_TAB_COPYPASTE_PASTEDELAY=ճ\xCC\xF9\xD0м\xE4\xD1\xD3ʱ(&A)
 DLG_TAB_COPYPASTE_PASTEDELAY2=\xBA\xC1\xC3\xEB
+DLG_TAB_COPYPASTE_SELECT_ON_ACTIVATE=Ena&bling text selection when the window is activated by mouse
 
 DLG_TAB_VISUAL_ALPHA=͸\xC3\xF7\xB6\xC8
 DLG_TAB_VISUAL_ALPHA_ACTIVE=&Active

Modified: branches/unicode_buf/installer/release/lang/Traditional Chinese.lng
===================================================================
--- branches/unicode_buf/installer/release/lang/Traditional Chinese.lng	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/installer/release/lang/Traditional Chinese.lng	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,4 +1,4 @@
-; Updated by TeraTerm Project (2019-06-10)
+; Updated by TeraTerm Project (2019-08-16)
 ; Last translated (Traditional Chinese language) by kikiqqp (2014-09-20)
 
 [Tera Term]
@@ -226,6 +226,7 @@
 DLG_TAB_COPYPASTE_DELIMITER=\xA4\xC0\xB9j\xB2\xC5(&I)
 DLG_TAB_COPYPASTE_PASTEDELAY=\xB6K\xA4W\xAEɹj\xA6橵\xAE\xC9(&A)
 DLG_TAB_COPYPASTE_PASTEDELAY2=\xB2@\xAC\xED
+DLG_TAB_COPYPASTE_SELECT_ON_ACTIVATE=Ena&bling text selection when the window is activated by mouse
 
 DLG_TAB_VISUAL_ALPHA=\xB3z\xA9\xFA\xAB\xD7
 DLG_TAB_VISUAL_ALPHA_ACTIVE=&Active

Modified: branches/unicode_buf/libs/SFMT.cmake
===================================================================
--- branches/unicode_buf/libs/SFMT.cmake	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/libs/SFMT.cmake	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,4 +1,5 @@
-# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P SFMT.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=Win32 -P oniguruma.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P SFMT.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -DCMAKE_CONFIGURATION_TYPE=Release -P SFMT.cmake
 
 ####

Modified: branches/unicode_buf/libs/buildall.cmake
===================================================================
--- branches/unicode_buf/libs/buildall.cmake	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/libs/buildall.cmake	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,6 +1,8 @@
-# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P buildall.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=Win32 -P buildall.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=x64 -P buildall.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P buildall.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 15 2017 Win64" -P buildall.cmake
-# cmake -DCMAKE_GENERATOR="Unix Makefiles" -P buildall.cmake -DCMAKE_TOOLCHAIN_FILE=../mingw.toolchain.cmake
+# cmake -DCMAKE_GENERATOR="Unix Makefiles" -P buildall.cmake
 
 if("${CMAKE_GENERATOR}" STREQUAL "")
   message(FATAL_ERROR "set CMAKE_GENERATOR!")
@@ -10,6 +12,12 @@
   set(ARCHITECTURE_OPTION -DARCHITECTURE=${ARCHITECTURE})
 endif()
 
+# install tool
+message("jom")
+execute_process(
+  COMMAND ${CMAKE_COMMAND} -P jom.cmake
+  )
+
 # build
 message("oniguruma")
 execute_process(
@@ -31,3 +39,4 @@
 execute_process(
   COMMAND ${CMAKE_COMMAND} -DCMAKE_GENERATOR=${CMAKE_GENERATOR} ${ARCHITECTURE_OPTION} -P openssl.cmake
   )
+message("done buildall.cmake")

Added: branches/unicode_buf/libs/jom.cmake
===================================================================
--- branches/unicode_buf/libs/jom.cmake	                        (rev 0)
+++ branches/unicode_buf/libs/jom.cmake	2019-08-20 14:35:14 UTC (rev 7998)
@@ -0,0 +1,29 @@
+# cmake -P jom.cmake
+
+set(SRC_ARC "jom_1_1_3.zip")
+set(SRC_URL "http://download.qt.io/official_releases/jom/jom_1_1_3.zip")
+set(SRC_ARC_HASH_SHA256 128fdd846fe24f8594eed37d1d8929a0ea78df563537c0c1b1861a635013fff8)
+set(DOWN_DIR "${CMAKE_SOURCE_DIR}/download/jom")
+set(INSTALL_DIR "${CMAKE_SOURCE_DIR}/jom")
+
+if(NOT EXISTS ${INSTALL_DIR}/nmake.exe)
+
+  file(DOWNLOAD
+    ${SRC_URL}
+    ${DOWN_DIR}/${SRC_ARC}
+    EXPECTED_HASH SHA256=${SRC_ARC_HASH_SHA256}
+    SHOW_PROGRESS
+    )
+
+  file(MAKE_DIRECTORY ${INSTALL_DIR})
+
+  execute_process(
+    COMMAND ${CMAKE_COMMAND} -E tar "xvf" ${DOWN_DIR}/${SRC_ARC}
+    WORKING_DIRECTORY ${INSTALL_DIR}
+    )
+
+  execute_process(
+    COMMAND ${CMAKE_COMMAND} -E copy ${INSTALL_DIR}/jom.exe ${INSTALL_DIR}/nmake.exe
+    )
+
+endif()

Modified: branches/unicode_buf/libs/lib_zlib.cmake
===================================================================
--- branches/unicode_buf/libs/lib_zlib.cmake	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/libs/lib_zlib.cmake	2019-08-20 14:35:14 UTC (rev 7998)
@@ -8,3 +8,13 @@
 
 set(ZLIB_INCLUDE_DIRS ${ZLIB_ROOT}/include)
 set(ZLIB_LIBRARY_DIRS ${ZLIB_ROOT}/lib)
+if(MINGW)
+  set(ZLIB_LIB
+    ${ZLIB_LIBRARY_DIRS}/libzlibstatic.a
+    )
+else()
+  set(ZLIB_LIB
+    debug ${ZLIB_LIBRARY_DIRS}/zlibstaticd.lib
+    optimized ${ZLIB_LIBRARY_DIRS}/zlibstatic.lib
+    )
+endif()

Modified: branches/unicode_buf/libs/oniguruma.cmake
===================================================================
--- branches/unicode_buf/libs/oniguruma.cmake	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/libs/oniguruma.cmake	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,4 +1,5 @@
-# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P oniguruma.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=Win32 -P oniguruma.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P oniguruma.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -DCMAKE_CONFIGURATION_TYPE=Release -P oniguruma.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=Win32 -DCMAKE_CONFIGURATION_TYPE=Release -P oniguruma.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=x64 -DCMAKE_CONFIGURATION_TYPE=Release -P oniguruma.cmake
@@ -57,14 +58,14 @@
 
 include(script_support.cmake)
 
-set(SRC_DIR_BASE "oniguruma-6.9.2")
-set(SRC_ARC "onig-6.9.2.tar.gz")
-set(SRC_URL "https://github.com/kkos/oniguruma/archive/v6.9.2.tar.gz")
-set(SRC_ARC_HASH_SHA1 bccc4ac69c91093f4894cf4564f1320b8fd6e97c)
+set(SRC_DIR_BASE "92354eea3ff8f07795c3ddb91cc6886c54578f10")
+set(SRC_ARC "${SRC_DIR_BASE}.tar.gz")
+set(SRC_URL "https://github.com/kkos/oniguruma/archive/${SRC_ARC}")
+set(SRC_ARC_HASH_SHA1 1002c56649cefdc227c37ad59b81e38bd2bc7180)
 
 set(DOWN_DIR "${CMAKE_SOURCE_DIR}/download/oniguruma")
 set(EXTRACT_DIR "${CMAKE_SOURCE_DIR}/build/oniguruma/src")
-set(SRC_DIR "${CMAKE_SOURCE_DIR}/build/oniguruma/src/${SRC_DIR_BASE}")
+set(SRC_DIR "${CMAKE_SOURCE_DIR}/build/oniguruma/src/oniguruma-92354eea3ff8f07795c3ddb91cc6886c54578f10")
 set(BUILD_DIR "${CMAKE_SOURCE_DIR}/build/oniguruma/build_${TOOLSET}")
 set(INSTALL_DIR "${CMAKE_SOURCE_DIR}/oniguruma_${TOOLSET}")
 if(("${CMAKE_GENERATOR}" MATCHES "Win64") OR ("${ARCHITECTURE}" MATCHES "x64") OR ("$ENV{MSYSTEM_CHOST}" STREQUAL "x86_64-w64-mingw32"))
@@ -110,6 +111,7 @@
 	${TOOLCHAINFILE}
 	-DCMAKE_DEBUG_POSTFIX=d
 	-DBUILD_SHARED_LIBS=OFF
+	-DMSVC_STATIC_RUNTIME=ON
 	WORKING_DIRECTORY ${BUILD_DIR}
 	RESULT_VARIABLE rv
 	)

Modified: branches/unicode_buf/libs/openssl.cmake
===================================================================
--- branches/unicode_buf/libs/openssl.cmake	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/libs/openssl.cmake	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,4 +1,5 @@
-# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P openssl.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=Win32 -P openssl.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P openssl.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -DCMAKE_CONFIGURATION_TYPE=Release -P openssl.cmake
 
 ####
@@ -10,6 +11,7 @@
       -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
       -DCMAKE_CONFIGURATION_TYPE=Release
       -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/VSToolchain.cmake
+      -DARCHITECTURE=${ARCHITECTURE}
       -P openssl.cmake
       )
     execute_process(
@@ -17,6 +19,7 @@
       -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
       -DCMAKE_CONFIGURATION_TYPE=Debug
       -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/VSToolchain.cmake
+      -DARCHITECTURE=${ARCHITECTURE}
       -P openssl.cmake
       )
     return()
@@ -63,7 +66,7 @@
 
 set(EXTRACT_DIR "${CMAKE_SOURCE_DIR}/build/openssl/src_${TOOLSET}")
 set(INSTALL_DIR "${CMAKE_SOURCE_DIR}/openssl_${TOOLSET}")
-if(("${CMAKE_GENERATOR}" MATCHES "Win64") OR ("$ENV{MSYSTEM_CHOST}" STREQUAL "x86_64-w64-mingw32"))
+if(("${CMAKE_GENERATOR}" MATCHES "Win64") OR ("$ENV{MSYSTEM_CHOST}" STREQUAL "x86_64-w64-mingw32") OR ("${ARCHITECTURE}" MATCHES "x64"))
   set(EXTRACT_DIR "${EXTRACT_DIR}_x64")
   set(INSTALL_DIR "${INSTALL_DIR}_x64")
 endif()
@@ -171,11 +174,11 @@
   else()
     message(FATAL_ERROR "CMAKE_GENERATOR ${CMAKE_GENERATOR} not supported")
   endif()
-  if(VCVARS32-NOTFOUND)
+  if(VCVARS32-NOTFOUND OR (${VCVARS32} STREQUAL "VCVARS32-NOTFOUND"))
     message(FATAL_ERROR "vcvars32.bat not found")
   endif()
 
-  if(${CMAKE_GENERATOR} MATCHES "Win64")
+  if((${CMAKE_GENERATOR} MATCHES "Win64") OR ("${ARCHITECTURE}" MATCHES "x64"))
     set(CONFIG_TARGET "VC-WIN64A")
     set(DO_MS "ms\\do_win64a.bat")
   else()
@@ -212,9 +215,15 @@
       )
   endif()
   if(${CMAKE_GENERATOR} MATCHES "Visual Studio 16 2019")
-    file(APPEND "${SRC_DIR}/build_cmake.bat"
-      "call \"${VCVARS32_N}\" x86\n"
-      )
+    if("${ARCHITECTURE}" MATCHES "x64")
+      file(APPEND "${SRC_DIR}/build_cmake.bat"
+        "call \"${VCVARS32_N}\" amd64\n"
+        )
+    else()
+      file(APPEND "${SRC_DIR}/build_cmake.bat"
+        "call \"${VCVARS32_N}\" x86\n"
+        )
+    endif()
   elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio 15 2017 Win64")
     file(APPEND "${SRC_DIR}/build_cmake.bat"
       "call \"${VCVARS32_N}\" amd64\n"
@@ -228,11 +237,18 @@
       "call \"${VCVARS32_N}\"\n"
       )
   endif()
+  # jomでビルドの高速化を試したが次のエラーが出てしまう
+  # 複数の CL.EXE が同じ .PDB ファイルに書き込む場合、/FS を使用してください。
+  # if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/jom/nmake.exe")
+  #   file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} CMAKE_CURRENT_SOURCE_DIR_N)
+  #   file(APPEND "${SRC_DIR}/build_cmake.bat"
+  #     "set PATH=${CMAKE_CURRENT_SOURCE_DIR_N}\\jom;%PATH%\n"
+  #     )
+  # endif()
   file(APPEND "${SRC_DIR}/build_cmake.bat"
     "set PATH=%PATH%;${PERL_N_PATH}\n"
     "nmake -f ms\\nt.mak install\n"
     )
-
   set(BUILD_CMAKE_BAT "${SRC_DIR}/build_cmake.bat")
   file(TO_NATIVE_PATH ${BUILD_CMAKE_BAT} BUILD_CMAKE_BAT_N)
   execute_process(

Modified: branches/unicode_buf/libs/zlib.cmake
===================================================================
--- branches/unicode_buf/libs/zlib.cmake	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/libs/zlib.cmake	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,4 +1,5 @@
-# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P zlib.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 16 2019" -DARCHITECTURE=Win32 -P zlib.cmake
+# cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -P zlib.cmake
 # cmake -DCMAKE_GENERATOR="Visual Studio 15 2017" -DCMAKE_CONFIGURATION_TYPE=Release -P zlib.cmake
 
 ####

Modified: branches/unicode_buf/teraterm/CMakeLists.txt
===================================================================
--- branches/unicode_buf/teraterm/CMakeLists.txt	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -14,13 +14,10 @@
   ttpset
   PROPERTIES FOLDER teraterm)
 
-#if((NOT(${CMAKE_GENERATOR} MATCHES "Visual Studio 8 2005" AND ${CMAKE_MAKE_PROGRAM} MATCHES "VCExpress.exe")) AND (NOT(MINGW)))
-  # MFCを使用しているため VS2005 Express ではビルドできない
-  add_subdirectory(ttpmacro)
-  set_target_properties(
-    ttpmacro
-    PROPERTIES FOLDER teraterm)
-#endif()
+add_subdirectory(ttpmacro)
+set_target_properties(
+  ttpmacro
+  PROPERTIES FOLDER teraterm)
 
 add_subdirectory(ttptek)
 set_target_properties(

Modified: branches/unicode_buf/teraterm/common/codeconv.cpp
===================================================================
--- branches/unicode_buf/teraterm/common/codeconv.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/common/codeconv.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -47,7 +47,7 @@
 typedef unsigned int	uint32_t;
 #endif
 
-#ifdef _DEBUG
+#if defined(_DEBUG) && !defined(_CRTDBG_MAP_ALLOC)
 #define malloc(l)     _malloc_dbg((l), _NORMAL_BLOCK, __FILE__, __LINE__)
 #define free(p)       _free_dbg((p), _NORMAL_BLOCK)
 #define _strdup(s)	  _strdup_dbg((s), _NORMAL_BLOCK, __FILE__, __LINE__)

Modified: branches/unicode_buf/teraterm/common/dlglib.c
===================================================================
--- branches/unicode_buf/teraterm/common/dlglib.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/common/dlglib.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -390,8 +390,8 @@
 	BYTE charset;
 } IsExistFontInfoA;
 
-int CALLBACK IsExistFontSubA(
-	ENUMLOGFONTA* lpelf, NEWTEXTMETRICA* lpntm,
+static int CALLBACK IsExistFontSubA(
+	const ENUMLOGFONTA* lpelf, const NEWTEXTMETRICA* lpntm,
 	int nFontType, LPARAM lParam)
 {
 	IsExistFontInfoA *info = (IsExistFontInfoA *)lParam;
@@ -435,22 +435,3 @@
 	ReleaseDC(NULL, hDC);
 	return info.found;
 }
-
-HFONT SetDlgFonts(HWND hDlg, const int nIDDlgItems[], int nIDDlgItemCount,
-                  const char *UILanguageFile, PCHAR key)
-{
-	HFONT hPrevFont = (HFONT)SendMessage(hDlg, WM_GETFONT, 0, 0);
-	LOGFONT logfont;
-	HFONT hNewFont;
-	if (key == NULL) key = "DLG_TAHOMA_FONT";
-	GetObject(hPrevFont, sizeof(LOGFONT), &logfont);
-	if (get_lang_font(key, hDlg, &logfont, &hNewFont, UILanguageFile)) {
-		int i;
-		for (i = 0 ; i < nIDDlgItemCount ; i++) {
-			const int nIDDlgItem = nIDDlgItems[i];
-			SendDlgItemMessage(hDlg, nIDDlgItem, WM_SETFONT, (WPARAM)hNewFont, MAKELPARAM(TRUE,0));
-		}
-	}
-	return hNewFont;
-}
-

Modified: branches/unicode_buf/teraterm/common/dlglib.h
===================================================================
--- branches/unicode_buf/teraterm/common/dlglib.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/common/dlglib.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2005-2018 TeraTerm Project
+ * (C) 2005-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -89,8 +89,6 @@
 	DLGPROC lpDialogFunc);
 void SetDialogFont(const char *FontName, int FontHeight, int FontCharSet,
 				   const char *UILanguageFile, const char *Section, const char *Key);
-HFONT SetDlgFonts(HWND hDlg, const int nIDDlgItems[], int nIDDlgItemCount,
-				  const char *UILanguageFile, PCHAR key);
 BOOL IsExistFontA(const char *face, BYTE charset, BOOL strict);
 int GetFontPointFromPixel(HWND hWnd, int pixel);
 int GetFontPixelFromPoint(HWND hWnd, int point);

Modified: branches/unicode_buf/teraterm/common/i18n.c
===================================================================
--- branches/unicode_buf/teraterm/common/i18n.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/common/i18n.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2018 TeraTerm Project
+ * Copyright (C) 2006-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,7 @@
 }
 #endif
 
-DllExport void GetI18nStr(const char *section, const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile)
+DllExport void WINAPI GetI18nStr(const char *section, const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile)
 {
 	GetPrivateProfileStringA(section, key, def, buf, buf_len, iniFile);
 	RestoreNewLine(buf);
@@ -79,7 +79,7 @@
 #endif
 }
 
-int GetI18nLogfont(const char *section, const char *key, PLOGFONTA logfont, int ppi, const char *iniFile)
+int WINAPI GetI18nLogfont(const char *section, const char *key, PLOGFONTA logfont, int ppi, const char *iniFile)
 {
 	char tmp[MAX_UIMSG];
 	char font[LF_FACESIZE];
@@ -110,7 +110,7 @@
 	return TRUE;
 }
 
-void SetI18DlgStrs(const char *section, HWND hDlgWnd,
+void WINAPI SetI18DlgStrs(const char *section, HWND hDlgWnd,
 				   const DlgTextInfo *infos, size_t infoCount, const char *UILanguageFile)
 {
 	size_t i;
@@ -135,7 +135,7 @@
 	}
 }
 
-void SetI18MenuStrs(const char *section, HMENU hMenu,
+void WINAPI SetI18MenuStrs(const char *section, HMENU hMenu,
 					const DlgTextInfo *infos, size_t infoCount, const char *UILanguageFile)
 {
 	size_t i;

Modified: branches/unicode_buf/teraterm/common/i18n.h
===================================================================
--- branches/unicode_buf/teraterm/common/i18n.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/common/i18n.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2018 TeraTerm Project
+ * Copyright (C) 2006-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,13 +47,13 @@
 } DlgTextInfo;
 
 #if defined(UNICODE)
-DllExport void GetI18nStrW(const char *section, const char *key, wchar_t *buf, int buf_len, const wchar_t *def, const char *iniFile);
+DllExport void WINAPI GetI18nStrW(const char *section, const char *key, wchar_t *buf, int buf_len, const wchar_t *def, const char *iniFile);
 #endif
-DllExport void GetI18nStr(const char *section, const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile);
-DllExport int GetI18nLogfont(const char *section, const char *key, PLOGFONTA logfont, int ppi, const char *iniFile);
-DllExport void SetI18DlgStrs(const char *section, HWND hDlgWnd,
+DllExport void WINAPI GetI18nStr(const char *section, const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile);
+DllExport int WINAPI GetI18nLogfont(const char *section, const char *key, PLOGFONTA logfont, int ppi, const char *iniFile);
+DllExport void WINAPI SetI18DlgStrs(const char *section, HWND hDlgWnd,
 							 const DlgTextInfo *infos, size_t infoCount, const char *UILanguageFile);
-DllExport void SetI18MenuStrs(const char *section, HMENU hMenu,
+DllExport void WINAPI SetI18MenuStrs(const char *section, HMENU hMenu,
 							  const DlgTextInfo *infos, size_t infoCount, const char *UILanguageFile);
 
 #if defined(_UNICODE)

Modified: branches/unicode_buf/teraterm/common/teraterm.h
===================================================================
--- branches/unicode_buf/teraterm/common/teraterm.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/common/teraterm.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2005-2017 TeraTerm Project
+ * (C) 2005-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -85,16 +85,3 @@
 	} \
 }
 
-typedef struct cygterm {
-	BOOL update_flag;
-	char term[128];
-	char term_type[80];
-	char port_start[80];
-	char port_range[80];
-	char shell[80];
-	char env1[128];
-	char env2[128];
-	BOOL login_shell;
-	BOOL home_chdir;
-	BOOL agent_proxy;
-} cygterm_t;

Modified: branches/unicode_buf/teraterm/common/tmfc.cpp
===================================================================
--- branches/unicode_buf/teraterm/common/tmfc.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/common/tmfc.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018 TeraTerm Project
+ * Copyright (C) 2018-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -508,6 +508,8 @@
  */
 INT_PTR TTCDialog::DoModal(HINSTANCE hInstance, HWND hParent, int idd)
 {
+	m_hInst = hInstance;
+	m_hParentWnd = hParent;
 	pseudoPtr = this;
 #if defined(REWRITE_TEMPLATE)
 	INT_PTR result =
@@ -514,13 +516,13 @@
 		TTDialogBoxParam(hInstance,
 						 MAKEINTRESOURCE(idd),
 						 hParent,
-						 (DLGPROC)&DlgProcStub, (LPARAM)this);
+						 &DlgProcStub, (LPARAM)this);
 #else
 	INT_PTR result =
 		DialogBoxParam(hInstance,
 					   MAKEINTRESOURCE(idd),
 					   hParent,
-					   (DLGPROC)&DlgProcStub, (LPARAM)this);
+					   &DlgProcStub, (LPARAM)this);
 #endif
 	pseudoPtr = nullptr;
 	return result;
@@ -540,7 +542,7 @@
 	HANDLE hDlgTemplate = ::LoadResource(hInstance, hResource);
 	DLGTEMPLATE *lpTemplate = (DLGTEMPLATE *)::LockResource(hDlgTemplate);
 #endif
-	DLGPROC dlgproc = (DLGPROC)DlgProcStub;
+	DLGPROC dlgproc = DlgProcStub;
 	const wchar_t *dialog_class = TTGetClassName(lpTemplate);
 	if (dialog_class != nullptr) {
 		// Modaless Dialog & Dialog application
@@ -552,17 +554,15 @@
 		hInstance, lpTemplate, hParent,
 		dlgproc, (LPARAM)this);
 	pseudoPtr = nullptr;
+#if defined(REWRITE_TEMPLATE)
+	free(lpTemplate);
+#endif
 	if (hWnd == nullptr)
 	{
 		assert(false);
 		return FALSE;
 	}
-
 	m_hWnd = hWnd;
-	m_hInst = hInstance;
-//	::EnableWindow(hParent,FALSE);
-//	::ShowWindow(hWnd, SW_SHOW);		// TODO \x8AO\x82ł\xE2\x82\xE9\x82̂\xAA\x97ǂ\xB3\x82\xBB\x82\xA4
-//	::EnableWindow(m_hWnd,TRUE);
 
 	return TRUE;
 }
@@ -571,7 +571,7 @@
  * @retval	TRUE	\x83\x81\x83b\x83Z\x81[\x83W\x82\xF0\x8F\x88\x97\x9D\x82\xB5\x82\xBD\x8E\x9E
  * @retval	FALSE	\x83\x81\x83b\x83Z\x81[\x83W\x82\xF0\x8F\x88\x97\x9D\x82\xB5\x82Ȃ\xA9\x82\xC1\x82\xBD\x8E\x9E
  */
-LRESULT CALLBACK TTCDialog::DlgProcStub(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
+INT_PTR CALLBACK TTCDialog::DlgProcStub(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
 {
 	TTCDialog *self = (TTCDialog *)::GetWindowLongPtr(hWnd, DWLP_USER);
 	if (self == nullptr) {
@@ -640,7 +640,6 @@
 	m_psp.dwFlags |= PSP_DLGINDIRECT;
 	m_psp.pResource = TTGetDlgTemplate(inst, m_psp.pszTemplate);
 #endif
-//	m_psp.pfnDlgProc = (DLGPROC)Proc;
 	m_psp.pfnDlgProc = Proc;
 	m_psp.lParam = (LPARAM)this;
 
@@ -652,6 +651,11 @@
 	free((void *)m_psp.pResource);
 }
 
+HPROPSHEETPAGE TTCPropertyPage::CreatePropertySheetPage()
+{
+	return ::CreatePropertySheetPage((PROPSHEETPAGE *)&m_psp);
+}
+
 void TTCPropertyPage::OnInitDialog()
 {
 }

Modified: branches/unicode_buf/teraterm/common/tmfc.h
===================================================================
--- branches/unicode_buf/teraterm/common/tmfc.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/common/tmfc.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018 TeraTerm Project
+ * Copyright (C) 2018-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -146,7 +146,7 @@
 	virtual BOOL PostNcDestroy();
 	virtual LRESULT DlgProc(UINT msg, WPARAM wp, LPARAM lp);
 
-	static LRESULT CALLBACK DlgProcStub(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
+	static INT_PTR CALLBACK DlgProcStub(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
 	static LRESULT CALLBACK WndProcStub(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
 private:
 
@@ -178,8 +178,10 @@
 	virtual void OnOK();
 	virtual BOOL OnCommand(WPARAM wp, LPARAM lp);
 	virtual HBRUSH OnCtlColor(HDC hDC, HWND hWnd);
-
-	PROPSHEETPAGE m_psp;
+	HPROPSHEETPAGE CreatePropertySheetPage();
+protected:
+	PROPSHEETPAGE_V1 m_psp;
+private:
 	static INT_PTR CALLBACK Proc(HWND hDlgWnd, UINT msg, WPARAM wp, LPARAM lp);
 	static UINT CALLBACK PropSheetPageProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp);
 	TTCPropertySheet *m_pSheet;

Modified: branches/unicode_buf/teraterm/common/tt_res.h
===================================================================
--- branches/unicode_buf/teraterm/common/tt_res.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/common/tt_res.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -167,7 +167,6 @@
 #define IDC_TRANS_ELAPSED               2527
 #define IDC_BGIMG_LABEL                 2527
 #define IDC_TRANS_ETIME                 2528
-#define IDC_BUTTON1                     2528
 #define IDC_BGIMG_BUTTON                2528
 #define IDC_INI_SETUPDIR_BUTTON         2528
 #define IDC_CLIPBOARD_ACCESS_LABEL      2529
@@ -237,6 +236,7 @@
 #define IDC_SAME_PROCESS_NEXTDROP_CHECK 2586
 #define IDC_DONTSHOW_CHECK              2587
 #define IDC_DAD_NOTE                    2588
+#define IDC_SELECT_ON_ACTIVATE          2589
 #define ID_ACC_SENDBREAK                50001
 #define ID_ACC_COPY                     50002
 #define ID_ACC_NEWCONNECTION            50003

Modified: branches/unicode_buf/teraterm/common/ttlib.c
===================================================================
--- branches/unicode_buf/teraterm/common/ttlib.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/common/ttlib.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1871,9 +1871,20 @@
 }
 
 /**
- *	\x8Ew\x92\xE8\x83E\x83B\x83\x93\x83h\x83E\x82̒\x86\x89\x9B\x82ɃE\x83B\x83\x93\x83h\x83E\x82\xF0\x94z\x92u\x82\xB7\x82\xE9
+ *	\x83E\x83B\x83\x93\x83h\x83E\x82𒆉\x9B\x82ɔz\x92u\x82\xB7\x82\xE9
+ *
  *	@param[in]	hWnd		\x88ʒu\x82𒲐\xAE\x82\xB7\x82\xE9\x83E\x83B\x83\x93\x83h\x83E
  *	@param[in]	hWndParent	\x82\xB1\x82̃E\x83B\x83\x93\x83h\x83E\x82̒\x86\x89\x9B\x82Ɉړ\xAE\x82\xB7\x82\xE9
+ *							(NULL\x82̏ꍇ\x83f\x83B\x83X\x83v\x83\x8C\x83C\x82̒\x86\x89\x9B)
+ *
+ *	hWndParent\x82̎w\x92肪\x82\xA0\x82\xE9\x8Fꍇ
+ *		hWndParent\x82\xAA\x95\\x8E\xA6\x8F\xF3\x91Ԃ̏ꍇ
+ *			- hWndParent\x82̒\x86\x89\x9B\x82ɔz\x92u
+ *			- \x82\xBD\x82\xBE\x82\xB5\x95\\x8E\xA6\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9\x83f\x83B\x83X\x83v\x83\x8C\x83C\x82\xA9\x82\xE7\x82͂ݏo\x82\xB7\x8Fꍇ\x82͒\xB2\x90\xAE\x82\xB3\x82\xEA\x82\xE9
+ *		hWndParent\x82\xAA\x94\xF1\x95\\x8E\xA6\x8F\xF3\x91Ԃ̏ꍇ
+ *			- hWnd\x82\xAA\x95\\x8E\xA6\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9\x83f\x83B\x83X\x83v\x83\x8C\x83C\x82̒\x86\x89\x9B\x82ɔz\x92u\x82\xB3\x82\xEA\x82\xE9
+ *	hWndParent\x82\xAANULL\x82̏ꍇ
+ *		- hWnd\x82\xAA\x95\\x8E\xA6\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9\x83f\x83B\x83X\x83v\x83\x8C\x83C\x82̒\x86\x89\x9B\x82ɔz\x92u\x82\xB3\x82\xEA\x82\xE9
  */
 void CenterWindow(HWND hWnd, HWND hWndParent)
 {
@@ -1880,7 +1891,6 @@
 	RECT rcWnd;
 	LONG WndWidth;
 	LONG WndHeight;
-	RECT rcParent;
 	int NewX;
 	int NewY;
 	RECT rcDesktop;
@@ -1890,15 +1900,28 @@
 	assert(r != FALSE); (void)r;
 	WndWidth = rcWnd.right - rcWnd.left;
 	WndHeight = rcWnd.bottom - rcWnd.top;
-	r = GetWindowRect(hWndParent, &rcParent);
-	assert(r != FALSE); (void)r;
 
-	// \x90V\x82\xB5\x82\xA2\x88ʒu
-	NewX = (rcParent.left + rcParent.right) / 2 - WndWidth / 2;
-	NewY = (rcParent.top + rcParent.bottom) / 2 - WndHeight / 2;
+	if (hWndParent == NULL || !IsWindowVisible(hWndParent) || IsIconic(hWndParent)) {
+		// \x90e\x82\xAA\x90ݒ肳\x82\xEA\x82Ă\xA2\x82Ȃ\xA2 or \x95\\x8E\xA6\x82\xB3\x82\xEA\x82Ă\xA2\x82Ȃ\xA2 or icon\x89\xBB\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9 \x8Fꍇ
+		// \x83E\x83B\x83\x93\x83h\x83E\x82̕\\x8E\xA6\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9\x83f\x83B\x83X\x83v\x83\x8C\x83C\x82̒\x86\x89\x9B\x82ɕ\\x8E\xA6\x82\xB7\x82\xE9
+		GetDesktopRect(hWnd, &rcDesktop);
 
+		// \x83f\x83X\x83N\x83g\x83b\x83v(\x95\\x8E\xA6\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9\x83f\x83B\x83X\x83v\x83\x8C\x83C)\x82̒\x86\x89\x9B
+		NewX = (rcDesktop.left + rcDesktop.right) / 2 - WndWidth / 2;
+		NewY = (rcDesktop.top + rcDesktop.bottom) / 2 - WndHeight / 2;
+	} else {
+		RECT rcParent;
+		r = GetWindowRect(hWndParent, &rcParent);
+		assert(r != FALSE); (void)r;
+
+		// hWndParent\x82̒\x86\x89\x9B
+		NewX = (rcParent.left + rcParent.right) / 2 - WndWidth / 2;
+		NewY = (rcParent.top + rcParent.bottom) / 2 - WndHeight / 2;
+
+		GetDesktopRect(hWndParent, &rcDesktop);
+	}
+
 	// \x83f\x83X\x83N\x83g\x83b\x83v\x82\xA9\x82\xE7\x82͂ݏo\x82\xB7\x8Fꍇ\x81A\x92\xB2\x90\xAE\x82\xB7\x82\xE9
-	GetDesktopRect(hWndParent, &rcDesktop);
 	if (NewX + WndWidth > rcDesktop.right)
 		NewX = rcDesktop.right - WndWidth;
 	if (NewX < rcDesktop.left)

Modified: branches/unicode_buf/teraterm/common/tttypes.h
===================================================================
--- branches/unicode_buf/teraterm/common/tttypes.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/common/tttypes.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -404,6 +404,20 @@
 	char BGThemeFile[MAX_PATH];
 } eterm_lookfeel_t;
 
+typedef struct cygterm {
+	BOOL update_flag;
+	char term[128];
+	char term_type[80];
+	char port_start[80];
+	char port_range[80];
+	char shell[80];
+	char env1[128];
+	char env2[128];
+	BOOL login_shell;
+	BOOL home_chdir;
+	BOOL agent_proxy;
+} cygterm_t;
+
 /* TTTSet */
 struct tttset {
 /*------ VTSet --------*/

Modified: branches/unicode_buf/teraterm/keycode/CMakeLists.txt
===================================================================
--- branches/unicode_buf/teraterm/keycode/CMakeLists.txt	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/keycode/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -28,3 +28,8 @@
 target_link_libraries(
   keycode
   )
+
+install(
+  TARGETS keycode
+  DESTINATION .
+  )

Modified: branches/unicode_buf/teraterm/teraterm/CMakeLists.txt
===================================================================
--- branches/unicode_buf/teraterm/teraterm/CMakeLists.txt	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -266,3 +266,8 @@
 configure_file(
   svnversion.h.in
   ../ttpdlg/svnversion.h @ONLY)
+
+install(
+  TARGETS teraterm
+  DESTINATION .
+  )

Modified: branches/unicode_buf/teraterm/teraterm/WSAAsyncGetAddrInfo.c
===================================================================
--- branches/unicode_buf/teraterm/teraterm/WSAAsyncGetAddrInfo.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/WSAAsyncGetAddrInfo.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -34,9 +34,26 @@
 #include <wspiapi.h>
 #include <windows.h>
 #include <process.h>
+#include <crtdbg.h>
 #include "WSAAsyncGetAddrInfo.h"
 #include "ttwsk.h"
 
+struct getaddrinfo_args {
+  HWND hWnd;
+  unsigned int wMsg;
+  char *hostname;
+  char *portname;
+  struct addrinfo hints;
+  struct addrinfo **res;
+  HANDLE *lpHandle;
+};
+
+#if defined(_DEBUG) && !defined(_CRTDBG_MAP_ALLOC)
+#define malloc(l)	_malloc_dbg((l), _NORMAL_BLOCK, __FILE__, __LINE__)
+#define free(p)		_free_dbg((p), _NORMAL_BLOCK)
+#define _strdup(s)	_strdup_dbg((s), _NORMAL_BLOCK, __FILE__, __LINE__)
+#endif
+
 static unsigned __stdcall getaddrinfo_thread(void * p);
 
 HANDLE PASCAL WSAAsyncGetAddrInfo(HWND hWnd, unsigned int wMsg,
@@ -73,18 +90,18 @@
 
 	/* create sub-thread running getaddrinfo() */
 	thread = (HANDLE)_beginthreadex(NULL, 0, getaddrinfo_thread, ga, CREATE_SUSPENDED, &tid);
-	*ga->lpHandle = (HANDLE)thread;
-	ResumeThread(thread);
-
-	/* return thread handle */
 	if (thread == 0) {
 		free(ga->lpHandle);
 		free(ga->hostname);
 		free(ga->portname);
 		free(ga);
-		return NULL;
-	} else
-		return (HANDLE)thread;
+		return NULL;	// return error
+	}
+
+	/* return thread handle */
+	*ga->lpHandle = thread;
+	ResumeThread(thread);
+	return thread;
 }
 
 static unsigned __stdcall getaddrinfo_thread(void * p)

Modified: branches/unicode_buf/teraterm/teraterm/WSAAsyncGetAddrInfo.h
===================================================================
--- branches/unicode_buf/teraterm/teraterm/WSAAsyncGetAddrInfo.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/WSAAsyncGetAddrInfo.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2017 TeraTerm Project
+ * Copyright (C) 2010-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -36,16 +36,6 @@
 #include <winsock2.h>
 #include <ws2tcpip.h>
 
-struct getaddrinfo_args {
-  HWND hWnd;
-  unsigned int wMsg;
-  char *hostname;
-  char *portname;
-  struct addrinfo hints;
-  struct addrinfo **res;
-  HANDLE *lpHandle;
-};
-
 HANDLE PASCAL WSAAsyncGetAddrInfo(HWND hWnd,
 			   unsigned int wMsg,
 			   const char *hostname,

Modified: branches/unicode_buf/teraterm/teraterm/addsetting.cpp
===================================================================
--- branches/unicode_buf/teraterm/teraterm/addsetting.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/addsetting.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -37,8 +37,8 @@
 #include <commctrl.h>
 #include <time.h>
 #include <tchar.h>
+#include <crtdbg.h>
 
-#include "addsetting.h"
 #include "teraterm.h"
 #include "tttypes.h"
 #include "ttwinman.h"	// for ts
@@ -46,11 +46,19 @@
 #include "ttftypes.h"
 #include "dlglib.h"
 #include "compat_win.h"
+#include "addsetting.h"
 
-#undef GetDlgItemText
-#define GetDlgItemText GetDlgItemTextA
-#undef SetDlgItemText
-#define SetDlgItemText SetDlgItemTextA
+#ifdef _DEBUG
+#define free(p)		_free_dbg((p), _NORMAL_BLOCK)
+#define _strdup(s)	_strdup_dbg((s), _NORMAL_BLOCK, __FILE__, __LINE__)
+#define _wcsdup(s)	_wcsdup_dbg((s), _NORMAL_BLOCK, __FILE__, __LINE__)
+#undef _tcsdup
+#ifdef _UNICODE
+#define _tcsdup(s)	_wcsdup_dbg((s), _NORMAL_BLOCK, __FILE__, __LINE__)
+#else
+#define _tcsdup(s)	_strdup_dbg((s), _NORMAL_BLOCK, __FILE__, __LINE__)
+#endif
+#endif
 
 const mouse_cursor_t MouseCursor[] = {
 	{"ARROW", IDC_ARROW},
@@ -419,7 +427,8 @@
 		{ IDC_CONFIRM_STRING_FILE_LABEL, "DLG_TAB_COPYPASTE_STRINGFILE" },
 		{ IDC_DELIMITER, "DLG_TAB_COPYPASTE_DELIMITER" },
 		{ IDC_PASTEDELAY_LABEL, "DLG_TAB_COPYPASTE_PASTEDELAY" },
-		{ IDC_PASTEDELAY_LABEL2, "DLG_TAB_COPYPASTE_PASTEDELAY2" }
+		{ IDC_PASTEDELAY_LABEL2, "DLG_TAB_COPYPASTE_PASTEDELAY2" },
+		{ IDC_SELECT_ON_ACTIVATE, "DLG_TAB_COPYPASTE_SELECT_ON_ACTIVATE" }
 	};
 	SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile);
 
@@ -471,6 +480,9 @@
 	_snprintf_s(buf, sizeof(buf), "%d", ts.PasteDelayPerLine);
 	SetDlgItemNum(IDC_PASTEDELAY_EDIT, ts.PasteDelayPerLine);
 
+	// (11) SelectOnActivate
+	SetCheck(IDC_SELECT_ON_ACTIVATE, ts.SelOnActive ? BST_CHECKED : BST_UNCHECKED);
+
 	// \x83_\x83C\x83A\x83\x8D\x83O\x82Ƀt\x83H\x81[\x83J\x83X\x82𓖂Ă\xE9
 	::SetFocus(::GetDlgItem(GetSafeHwnd(), IDC_LINECOPY));
 }
@@ -590,6 +602,9 @@
 	ts.PasteDelayPerLine =
 		(val < 0) ? 0 :
 		(val > 5000) ? 5000 : val;
+
+	// (11) SelectOnActivate
+	ts.SelOnActive = (GetCheck(IDC_SELECT_ON_ACTIVATE) == BST_CHECKED);
 }
 
 
@@ -1182,8 +1197,6 @@
 BOOL CLogPropPageDlg::OnCommand(WPARAM wParam, LPARAM lParam)
 {
 	char uimsg[MAX_UIMSG];
-	char buf[MAX_PATH];
-	char buf2[MAX_PATH];
 
 	switch (wParam) {
 		case IDC_VIEWLOG_PATH | (BN_CLICKED << 16):
@@ -1212,9 +1225,13 @@
 			// \x83\x8D\x83O\x83f\x83B\x83\x8C\x83N\x83g\x83\x8A\x82̑I\x91\xF0\x83_\x83C\x83A\x83\x8D\x83O
 			get_lang_msg("FILEDLG_SELECT_LOGDIR_TITLE", ts.UIMsg, sizeof(ts.UIMsg),
 			             "Select log folder", ts.UILanguageFile);
-			GetDlgItemText(IDC_DEFAULTPATH_EDITOR, buf, sizeof(buf));
-			if (doSelectFolder(GetSafeHwnd(), buf2, sizeof(buf2), buf, ts.UIMsg)) {
-				SetDlgItemText(IDC_DEFAULTPATH_EDITOR, buf2);
+			{
+				char buf[MAX_PATH];
+				char buf2[MAX_PATH];
+				GetDlgItemTextA(IDC_DEFAULTPATH_EDITOR, buf, sizeof(buf));
+				if (doSelectFolder(GetSafeHwnd(), buf2, sizeof(buf2), buf, ts.UIMsg)) {
+					SetDlgItemTextA(IDC_DEFAULTPATH_EDITOR, buf2);
+				}
 			}
 
 			return TRUE;
@@ -1278,7 +1295,7 @@
 	TCHAR uimsg2[MAX_UIMSG];
 
 	// Viewlog Editor path (2005.1.29 yutaka)
-	GetDlgItemText(IDC_VIEWLOG_EDITOR, ts.ViewlogEditor, _countof(ts.ViewlogEditor));
+	GetDlgItemTextA(IDC_VIEWLOG_EDITOR, ts.ViewlogEditor, _countof(ts.ViewlogEditor));
 
 	// Log Default File Name (2006.8.28 maya)
 	GetDlgItemTextA(IDC_DEFAULTNAME_EDITOR, buf, sizeof(buf));
@@ -1311,7 +1328,7 @@
 	strncpy_s(ts.LogDefaultName, sizeof(ts.LogDefaultName), buf, _TRUNCATE);
 
 	// Log Default File Path (2007.5.30 maya)
-	GetDlgItemText(IDC_DEFAULTPATH_EDITOR, ts.LogDefaultPath, _countof(ts.LogDefaultPath));
+	GetDlgItemTextA(IDC_DEFAULTPATH_EDITOR, ts.LogDefaultPath, _countof(ts.LogDefaultPath));
 
 	/* Auto start logging (2007.5.31 maya) */
 	ts.LogAutoStart = GetCheck(IDC_AUTOSTART);
@@ -1319,7 +1336,7 @@
 	/* Log Rotate */
 	if (GetCheck(IDC_LOG_ROTATE)) {  /* on */
 		ts.LogRotate = ROTATE_SIZE;
-		GetDlgItemText(IDC_ROTATE_SIZE_TYPE, buf, _countof(buf));
+		GetDlgItemTextA(IDC_ROTATE_SIZE_TYPE, buf, _countof(buf));
 		ts.LogRotateSizeType = 0;
 		for (int i = 0 ; i < LOG_ROTATE_SIZETYPE_NUM ; i++) {
 			if (strcmp(buf, LogRotateSizeType[i]) == 0) {
@@ -1489,13 +1506,13 @@
 	m_VisualPage = new CVisualPropPageDlg(hInstance, this);
 	m_LogPage = new CLogPropPageDlg(hInstance, this);
 	m_CygwinPage = new CCygwinPropPageDlg(hInstance, this);
-		
-	hPsp[0] = CreatePropertySheetPage(&m_GeneralPage->m_psp);
-	hPsp[1] = CreatePropertySheetPage(&m_SequencePage->m_psp);
-	hPsp[2] = CreatePropertySheetPage(&m_CopypastePage->m_psp);
-	hPsp[3] = CreatePropertySheetPage(&m_VisualPage->m_psp);
-	hPsp[4] = CreatePropertySheetPage(&m_LogPage->m_psp);
-	hPsp[5] = CreatePropertySheetPage(&m_CygwinPage->m_psp);
+
+	hPsp[0] = m_GeneralPage->CreatePropertySheetPage();
+	hPsp[1] = m_SequencePage->CreatePropertySheetPage();
+	hPsp[2] = m_CopypastePage->CreatePropertySheetPage();
+	hPsp[3] = m_VisualPage->CreatePropertySheetPage();
+	hPsp[4] = m_LogPage->CreatePropertySheetPage();
+	hPsp[5] = m_CygwinPage->CreatePropertySheetPage();
 	m_psh.nPages = 6;
 	m_psh.phpage = hPsp;
 

Modified: branches/unicode_buf/teraterm/teraterm/filesys.cpp
===================================================================
--- branches/unicode_buf/teraterm/teraterm/filesys.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/filesys.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2005-2018 TeraTerm Project
+ * (C) 2005-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -318,8 +318,10 @@
 		*fv = (PFileVar)malloc(sizeof(TFileVar));
 		if ((*fv)!=NULL)
 		{
+			char FileDirExpanded[MAX_PATH];
+			ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded));
 			memset(*fv, 0, sizeof(TFileVar));
-			strncpy_s((*fv)->FullName, sizeof((*fv)->FullName),ts.FileDir, _TRUNCATE);
+			strncpy_s((*fv)->FullName, sizeof((*fv)->FullName), FileDirExpanded, _TRUNCATE);
 			AppendSlash((*fv)->FullName,sizeof((*fv)->FullName));
 			(*fv)->DirLen = strlen((*fv)->FullName);
 			(*fv)->FileOpen = FALSE;
@@ -428,7 +430,7 @@
 	if (!ptr->FileOpen)
 		return;
 
-	if (ptr->LogThread != (HANDLE)-1) {
+	if (ptr->LogThread != INVALID_HANDLE_VALUE) {
 		// \x83X\x83\x8C\x83b\x83h\x82̏I\x97\xB9\x91҂\xBF
 		ret = PostThreadMessage(ptr->LogThreadId, WM_QUIT, 0, 0);
 		if (ret != 0) {
@@ -439,9 +441,9 @@
 			code = GetLastError();
 		}
 		CloseHandle(ptr->LogThread);
-		ptr->LogThread = (HANDLE)-1;
+		ptr->LogThread = INVALID_HANDLE_VALUE;
 	}
-	CloseHandle((HANDLE)ptr->FileHandle);
+	CloseHandle(ptr->FileHandle);
 }
 
 // \x92x\x89\x84\x8F\x91\x82\xAB\x8D\x9E\x82ݗp\x83X\x83\x8C\x83b\x83h
@@ -465,7 +467,7 @@
 			case WM_DPC_LOGTHREAD_SEND:
 				buf = (PCHAR)msg.wParam;
 				buflen = (DWORD)msg.lParam;
-				WriteFile((HANDLE)LogVar->FileHandle, buf, buflen, &wrote, NULL);
+				WriteFile(LogVar->FileHandle, buf, buflen, &wrote, NULL);
 				free(buf);   // \x82\xB1\x82\xB1\x82Ń\x81\x83\x82\x83\x8A\x89\xF0\x95\xFA
 				break;
 
@@ -490,6 +492,7 @@
 	char buf[512];
 	const char *crlf = "\r\n";
 	DWORD crlf_len = 2;
+	char FileDirExpanded[MAX_PATH];
 
 	if ((FileLog) || (BinLog)) return FALSE;
 
@@ -505,7 +508,8 @@
 		logdir = ts.LogDefaultPath;
 	}
 	else if (strlen(ts.FileDir) > 0) {
-		logdir = ts.FileDir;
+		ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded));
+		logdir = FileDirExpanded;
 	}
 	else {
 		logdir = ts.HomeDir;
@@ -689,7 +693,7 @@
 	// \x8Dŏ\x89\x82̃t\x83@\x83C\x83\x8B\x82\xAA\x90ݒ肵\x82\xBD\x83T\x83C\x83Y\x82Ń\x8D\x81[\x83e\x81[\x83g\x82\xB5\x82Ȃ\xA2\x96\xE2\x91\xE8\x82̏C\x90\xB3\x81B
 	// (2016.4.9 yutaka)
 	if (LogVar->RotateMode != ROTATE_NONE) {
-		size = GetFileSize((HANDLE)LogVar->FileHandle, NULL);
+		size = GetFileSize(LogVar->FileHandle, NULL);
 		if (size != -1)
 			LogVar->ByteCount = size;
 	}
@@ -736,8 +740,8 @@
 				PostThreadMessage(LogVar->LogThreadId, WM_DPC_LOGTHREAD_SEND, (WPARAM)pbuf, size + 2);
 			} else { // \x92\xBC\x8F\x91\x82\xAB\x81B\x83l\x83b\x83g\x83\x8F\x81[\x83N\x8Co\x97R\x82\xBE\x82ƒx\x82\xA2\x81B
 #endif
-				WriteFile((HANDLE)LogVar->FileHandle, buf, size, &written_size, NULL);
-				WriteFile((HANDLE)LogVar->FileHandle, crlf, crlf_len, &written_size, NULL);
+				WriteFile(LogVar->FileHandle, buf, size, &written_size, NULL);
+				WriteFile(LogVar->FileHandle, crlf, crlf_len, &written_size, NULL);
 #if 0
 			}
 #endif
@@ -846,8 +850,8 @@
 	}
 
 	logfile_lock();
-	WriteFile((HANDLE)LogVar->FileHandle, buf, size, &wrote, NULL);
-	WriteFile((HANDLE)LogVar->FileHandle, "\r\n", 2, &wrote, NULL); // \x89\xFC\x8Ds
+	WriteFile(LogVar->FileHandle, buf, size, &wrote, NULL);
+	WriteFile(LogVar->FileHandle, "\r\n", 2, &wrote, NULL); // \x89\xFC\x8Ds
 	/* Set Line End Flag
 		2007.05.24 Gentaro
 	*/
@@ -1054,9 +1058,9 @@
 						strtime = strelapsed(cv.ConnectedTime);
 						break;
 					}
-					WriteFile((HANDLE)LogVar->FileHandle, "[", 1, &wrote, NULL);
-					WriteFile((HANDLE)LogVar->FileHandle, strtime, strlen(strtime), &wrote, NULL);
-					WriteFile((HANDLE)LogVar->FileHandle, "] ", 2, &wrote, NULL);
+					WriteFile(LogVar->FileHandle, "[", 1, &wrote, NULL);
+					WriteFile(LogVar->FileHandle, strtime, strlen(strtime), &wrote, NULL);
+					WriteFile(LogVar->FileHandle, "] ", 2, &wrote, NULL);
 				}
 
 				/* 2007.05.24 Gentaro */
@@ -1067,7 +1071,7 @@
 					eLineEnd = Line_Other; /* clear endmark*/
 				}
 
-				WriteFile((HANDLE)LogVar->FileHandle, (PCHAR)&b, 1, &wrote, NULL);
+				WriteFile(LogVar->FileHandle, (PCHAR)&b, 1, &wrote, NULL);
 				(LogVar->ByteCount)++;
 			}
 		}
@@ -1174,11 +1178,13 @@
 
 	FSend = TRUE;
 
-	if (strlen(&(SendVar->FullName[SendVar->DirLen]))==0) {
+	if (strlen(&(SendVar->FullName[SendVar->DirLen])) == 0) {
+		char FileDirExpanded[MAX_PATH];
+		ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded));
 		if (ts.TransBin)
 			Option |= LOGDLG_BINARY;
 		SendVar->FullName[0] = 0;
-		if (! (*GetTransFname)(SendVar, ts.FileDir, GTF_SEND, &Option)) {
+		if (! (*GetTransFname)(SendVar, FileDirExpanded, GTF_SEND, &Option)) {
 			FileTransEnd(OpSendFile);
 			return;
 		}
@@ -1305,7 +1311,7 @@
 
 	do {
 		if (FileSendHandler.pos == FileSendHandler.end) {
-			ReadFile((HANDLE)SendVar->FileHandle, &(FileSendHandler.buf[0]), sizeof(FileSendHandler.buf), &read_bytes, NULL);
+			ReadFile(SendVar->FileHandle, &(FileSendHandler.buf[0]), sizeof(FileSendHandler.buf), &read_bytes, NULL);
 			fc = LOWORD(read_bytes);
 			FileSendHandler.pos = 0;
 			FileSendHandler.end = fc;
@@ -1384,12 +1390,12 @@
 			}
 		}
 		else if (! FileReadEOF) {
-			ReadFile((HANDLE)SendVar->FileHandle, &FileByte, 1, &read_bytes, NULL);
+			ReadFile(SendVar->FileHandle, &FileByte, 1, &read_bytes, NULL);
 			fc = LOWORD(read_bytes);
 			SendVar->ByteCount = SendVar->ByteCount + fc;
 
 			if (FileCRSend && (fc==1) && (FileByte==0x0A)) {
-				ReadFile((HANDLE)SendVar->FileHandle, &FileByte, 1, &read_bytes, NULL);
+				ReadFile(SendVar->FileHandle, &FileByte, 1, &read_bytes, NULL);
 				fc = LOWORD(read_bytes);
 				SendVar->ByteCount = SendVar->ByteCount + fc;
 			}
@@ -1632,7 +1638,9 @@
 			FileVar->OpId = OpKmtSend;
 			if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)
 			{
-				if (! (*GetMultiFname)(FileVar,ts.FileDir,GMF_KERMIT,&w) ||
+				char FileDirExpanded[MAX_PATH];
+				ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded));
+				if (!(*GetMultiFname)(FileVar, FileDirExpanded, GMF_KERMIT, &w) ||
 				    (FileVar->NumFname==0))
 				{
 					ProtoEnd();
@@ -1690,9 +1698,11 @@
 
 	if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)
 	{
+		char FileDirExpanded[MAX_PATH];
+		ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded));
 		Option = MAKELONG(ts.XmodemBin,ts.XmodemOpt);
 		if (! (*GetXFname)(FileVar->HMainWin,
-		                   mode==IdXReceive,&Option,FileVar,ts.FileDir))
+		                   mode==IdXReceive,&Option,FileVar,FileDirExpanded))
 		{
 			ProtoEnd();
 			return;
@@ -1769,6 +1779,9 @@
 
 	if (mode==IdYSend)
 	{
+		char FileDirExpanded[MAX_PATH];
+		ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded));
+
 		// \x83t\x83@\x83C\x83\x8B\x93]\x91\x97\x8E\x9E\x82̃I\x83v\x83V\x83\x87\x83\x93\x82\xCD"Yopt1K"\x82Ɍ\x88\x82ߑł\xBF\x81B
 		// TODO: "Yopt1K", "YoptG", "YoptSingle"\x82\xF0\x8B\xE6\x95ʂ\xB5\x82\xBD\x82\xA2\x82Ȃ\xE7\x82΁AIDD_FOPT\x82\xF0\x8Ag\x92\xA3\x82\xB7\x82\xE9\x95K\x97v\x82\xA0\x82\xE8\x81B
 		Opt = Yopt1K;
@@ -1775,7 +1788,7 @@
 		FileVar->OpId = OpYSend;
 		if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)
 		{
-			if (! (*GetMultiFname)(FileVar,ts.FileDir,GMF_Y,&Opt) ||
+			if (! (*GetMultiFname)(FileVar,FileDirExpanded,GMF_Y,&Opt) ||
 			    (FileVar->NumFname==0))
 			{
 				ProtoEnd();
@@ -1815,7 +1828,9 @@
 		FileVar->OpId = OpZSend;
 		if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)
 		{
-			if (! (*GetMultiFname)(FileVar,ts.FileDir,GMF_Z,&Opt) ||
+			char FileDirExpanded[MAX_PATH];
+			ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded));
+			if (! (*GetMultiFname)(FileVar,FileDirExpanded,GMF_Z,&Opt) ||
 			    (FileVar->NumFname==0))
 			{
 				if (mode == IdZAutoS) {
@@ -1852,8 +1867,10 @@
 		FileVar->OpId = OpBPSend;
 		if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)
 		{
+			char FileDirExpanded[MAX_PATH];
+			ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded));
 			FileVar->FullName[0] = 0;
-			if (! (*GetTransFname)(FileVar, ts.FileDir, GTF_BP, &Option))
+			if (! (*GetTransFname)(FileVar, FileDirExpanded, GTF_BP, &Option))
 			{
 				ProtoEnd();
 				return;
@@ -1886,7 +1903,9 @@
 		FileVar->OpId = OpQVSend;
 		if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0)
 		{
-			if (! (*GetMultiFname)(FileVar,ts.FileDir,GMF_QV, &W) ||
+			char FileDirExpanded[MAX_PATH];
+			ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded));
+			if (! (*GetMultiFname)(FileVar,FileDirExpanded,GMF_QV, &W) ||
 			    (FileVar->NumFname==0))
 			{
 				ProtoEnd();

Modified: branches/unicode_buf/teraterm/teraterm/ftdlg.cpp
===================================================================
--- branches/unicode_buf/teraterm/teraterm/ftdlg.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/ftdlg.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -44,12 +44,6 @@
 #include "ftdlg.h"
 #include "teraterml.h"
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CFileTransDlg dialog
 
@@ -201,7 +195,7 @@
 	::PostMessage(GetSafeHwnd(), WM_SETICON, ICON_BIG,
 				  (LPARAM)BigIcon);
 
-	AddModalHandle(m_hWnd);
+	AddModelessHandle(m_hWnd);
 
 	return TRUE;
 }
@@ -244,7 +238,7 @@
 		BigIcon = NULL;
 	}
 
-	RemoveModalHandle(m_hWnd);
+	RemoveModelessHandle(m_hWnd);
 
 	delete this;
 	return TRUE;

Modified: branches/unicode_buf/teraterm/teraterm/prnabort.cpp
===================================================================
--- branches/unicode_buf/teraterm/teraterm/prnabort.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/prnabort.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2007-2018 TeraTerm Project
+ * (C) 2007-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -82,12 +82,13 @@
 	m_hParentWnd = hParent;
 	m_ts = pts;
 
-	HRSRC hResource = ::FindResource(hInstance, MAKEINTRESOURCE(IDD_PRNABORTDLG), RT_DIALOG);
-	HANDLE hDlgTemplate = ::LoadResource(hInstance, hResource);
-	DLGTEMPLATE *lpTemplate = (DLGTEMPLATE *)::LockResource(hDlgTemplate);
-	HWND hWnd = ::CreateDialogIndirectParam(	
+	SetDialogFont(m_ts->DialogFontName, m_ts->DialogFontPoint, m_ts->DialogFontCharSet,
+				  m_ts->UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
+	DLGTEMPLATE *lpTemplate = TTGetDlgTemplate(hInstance, MAKEINTRESOURCE(IDD_PRNABORTDLG));
+	HWND hWnd = ::CreateDialogIndirectParam(
 		hInstance, lpTemplate, hParent,
 		(DLGPROC)OnDlgProc, (LPARAM)this);
+	free(lpTemplate);
 	if (hWnd == NULL)
 	{
 		return FALSE;

Modified: branches/unicode_buf/teraterm/teraterm/prnabort.h
===================================================================
--- branches/unicode_buf/teraterm/teraterm/prnabort.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/prnabort.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2007-2018 TeraTerm Project
+ * (C) 2007-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,6 @@
 class CPrnAbortDlg
 {
 public:
-	HWND m_hWnd;
 	HWND GetSafeHwnd() const {return m_hWnd;}
 	BOOL Create(HINSTANCE hInstance, HWND hParent, PBOOL AbortFlag, PTTSet pts);
 	BOOL DestroyWindow();
@@ -44,6 +43,7 @@
 private:
 	void OnCancel();
 	void PostNcDestroy();
+	HWND m_hWnd;
 	HWND m_hParentWnd;
 	BOOL *m_pAbort;
 	TTTSet *m_ts;

Modified: branches/unicode_buf/teraterm/teraterm/tekwin.cpp
===================================================================
--- branches/unicode_buf/teraterm/teraterm/tekwin.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/tekwin.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -49,20 +49,16 @@
 
 #define TEKClassName _T("TEKWin32")
 
-static HINSTANCE AfxGetInstanceHandle()
-{
-	return hInst;
-}
-
 /////////////////////////////////////////////////////////////////////////////
 // CTEKWindow
 
-CTEKWindow::CTEKWindow()
+CTEKWindow::CTEKWindow(HINSTANCE hInstance)
 {
 	WNDCLASS wc;
 	RECT rect;
 	DWORD Style;
 	int fuLoad = LR_DEFAULTCOLOR;
+	m_hInst = hInstance;
 
 	if (! LoadTTTEK()) {
 		return;
@@ -81,7 +77,7 @@
 	wc.lpfnWndProc = (WNDPROC)ProcStub;
 	wc.cbClsExtra = 0;
 	wc.cbWndExtra = 0;
-	wc.hInstance = AfxGetInstanceHandle();
+	wc.hInstance = hInstance;
 	wc.hIcon = NULL;
 	wc.hCursor = LoadCursor(NULL,IDC_ARROW);
 	wc.hbrBackground = NULL;
@@ -99,7 +95,7 @@
 		rect.right = rect.left + 640; //temporary width
 		rect.bottom = rect.top + 400; //temporary height
 	}
-	Create(hInst, TEKClassName, _T("Tera Term"), Style, rect, ::GetDesktopWindow(), NULL);
+	Create(hInstance, TEKClassName, _T("Tera Term"), Style, rect, ::GetDesktopWindow(), NULL);
 //--------------------------------------------------------
 	HTEKWin = GetSafeHwnd();
 	if (HTEKWin == NULL) {
@@ -113,11 +109,11 @@
 		fuLoad = LR_VGACOLOR;
 	}
 	::PostMessage(HTEKWin,WM_SETICON,ICON_SMALL,
-	              (LPARAM)LoadImage(AfxGetInstanceHandle(),
+	              (LPARAM)LoadImage(hInstance,
 	                                MAKEINTRESOURCE((ts.TEKIcon!=IdIconDefault)?ts.TEKIcon:IDI_TEK),
 	                                IMAGE_ICON,16,16,fuLoad));
 	::PostMessage(HTEKWin,WM_SETICON,ICON_BIG,
-	              (LPARAM)LoadImage(AfxGetInstanceHandle(),
+	              (LPARAM)LoadImage(hInstance,
 	                                MAKEINTRESOURCE((ts.TEKIcon!=IdIconDefault)?ts.TEKIcon:IDI_TEK),
 	                                IMAGE_ICON, 0, 0, fuLoad));
 
@@ -180,7 +176,7 @@
 		{ ID_TEKHELP_ABOUT, "TEKMENU_HELP_ABOUT" },
 	};
 
-	*Menu = ::LoadMenu(AfxGetInstanceHandle(),
+	*Menu = ::LoadMenu(m_hInst,
 	                   MAKEINTRESOURCE(IDR_TEKMENU));
 	FileMenu = GetSubMenu(*Menu,0);
 	EditMenu = GetSubMenu(*Menu,1);
@@ -352,7 +348,7 @@
 
 				AppendMenu(PopupBase,
 				           submenu != NULL ? LOBYTE(state) | MF_POPUP : state,
-				           submenu != NULL ? (UINT)submenu : GetMenuItemID(PopupMenu, i),
+				           submenu != NULL ? (UINT_PTR)submenu : GetMenuItemID(PopupMenu, i),
 				           itemText);
 			}
 		}

Modified: branches/unicode_buf/teraterm/teraterm/tekwin.h
===================================================================
--- branches/unicode_buf/teraterm/teraterm/tekwin.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/tekwin.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -40,7 +40,7 @@
     FileMenu, SetupMenu, HelpMenu;
 
 public:
-	CTEKWindow();
+	CTEKWindow(HINSTANCE hInstance);
 	int Parse();
 	void RestoreSetup();
 	void InitMenu(HMENU *Menu);

Modified: branches/unicode_buf/teraterm/teraterm/telnet.c
===================================================================
--- branches/unicode_buf/teraterm/teraterm/telnet.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/telnet.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -69,7 +69,7 @@
 
 static TelRec tr;
 
-static HANDLE keepalive_thread = (HANDLE)-1L;
+static HANDLE keepalive_thread = INVALID_HANDLE_VALUE;
 static HWND keepalive_dialog = NULL;
 int nop_interval = 0;
 
@@ -796,7 +796,7 @@
 
 #define WM_SEND_HEARTBEAT (WM_USER + 1)
 
-static LRESULT CALLBACK telnet_heartbeat_dlg_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
+static INT_PTR CALLBACK telnet_heartbeat_dlg_proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
 {
 	switch (msg) {
 	case WM_INITDIALOG:
@@ -857,12 +857,13 @@
 	if (ts.TelKeepAliveInterval > 0) {
 		nop_interval = ts.TelKeepAliveInterval;
 
-	// \x83\x82\x81[\x83h\x83\x8C\x83X\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x92lj\xC1 (2007.12.26 yutaka)
-	keepalive_dialog = CreateDialog(hInst, MAKEINTRESOURCE(IDD_BROADCAST_DIALOG),
-	                                HVTWin, (DLGPROC)telnet_heartbeat_dlg_proc);
+		// \x83\x82\x81[\x83h\x83\x8C\x83X\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x92lj\xC1 (2007.12.26 yutaka)
+		keepalive_dialog = CreateDialog(hInst, MAKEINTRESOURCE(IDD_BROADCAST_DIALOG),
+										HVTWin, telnet_heartbeat_dlg_proc);
 
 		keepalive_thread = (HANDLE)_beginthreadex(NULL, 0, TelKeepAliveThread, NULL, 0, &tid);
-		if (keepalive_thread == (HANDLE)-1) {
+		if (keepalive_thread == 0) {
+			keepalive_thread = INVALID_HANDLE_VALUE;
 			nop_interval = 0;
 		}
 	}
@@ -869,11 +870,11 @@
 }
 
 void TelStopKeepAliveThread() {
-	if (keepalive_thread != (HANDLE)-1L) {
+	if (keepalive_thread != INVALID_HANDLE_VALUE) {
 		nop_interval = 0;
 		WaitForSingleObject(keepalive_thread, INFINITE);
 		CloseHandle(keepalive_thread);
-		keepalive_thread = (HANDLE)-1L;
+		keepalive_thread = INVALID_HANDLE_VALUE;
 
 		DestroyWindow(keepalive_dialog);
 	}
@@ -881,9 +882,9 @@
 
 void TelUpdateKeepAliveInterval() {
 	if (cv.Open && cv.TelFlag && ts.TCPPort==ts.TelPort) {
-		if (ts.TelKeepAliveInterval > 0 && keepalive_thread == (HANDLE)-1)
+		if (ts.TelKeepAliveInterval > 0 && keepalive_thread == INVALID_HANDLE_VALUE)
 			TelStartKeepAliveThread();
-		else if (ts.TelKeepAliveInterval == 0 && keepalive_thread != (HANDLE)-1)
+		else if (ts.TelKeepAliveInterval == 0 && keepalive_thread != INVALID_HANDLE_VALUE)
 			TelStopKeepAliveThread();
 		else
 			nop_interval = ts.TelKeepAliveInterval;

Modified: branches/unicode_buf/teraterm/teraterm/teraprn.cpp
===================================================================
--- branches/unicode_buf/teraterm/teraterm/teraprn.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/teraprn.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -32,6 +32,7 @@
 #include "tttypes.h"
 #include <commdlg.h>
 #include <stdio.h>
+#include <crtdbg.h>
 
 #include "ttwinman.h"
 #include "commlib.h"
@@ -45,14 +46,12 @@
 
 #include "teraprn.h"
 
-#if 0 //def _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
+#ifdef _DEBUG
+#if defined(_MSC_VER)
+#define new		::new(_NORMAL_BLOCK, __FILE__, __LINE__)
 #endif
+#endif
 
-#define CWnd TTCWnd
-
 static PRINTDLG PrnDlg;
 
 static HDC PrintDC;
@@ -78,7 +77,7 @@
 static HWND HPrnAbortDlg;
 
 /* Print Abortion Call Back Function */
-BOOL CALLBACK PrnAbortProc(HDC PDC, int Code)
+static BOOL CALLBACK PrnAbortProc(HDC PDC, int Code)
 {
 	MSG m;
 
@@ -128,7 +127,7 @@
 {
 	DOCINFOA Doc;
 	char DocName[50];
-	CWnd* pParent;
+	HWND hParent;
 
 	Printing = FALSE;
 	PrintAbortFlag = FALSE;
@@ -138,12 +137,12 @@
 		return FALSE;
 	}
 	if (ActiveWin==IdVT) {
-		pParent = (CWnd*)pVTWin;
+		hParent = HVTWin;
 	}
 	else {
-		pParent = (CWnd*)pTEKWin;
+		hParent = HTEKWin;
 	}
-	PrnAbortDlg->Create(hInst, pParent->GetSafeHwnd(),&PrintAbortFlag,&ts);
+	PrnAbortDlg->Create(hInst,hParent,&PrintAbortFlag,&ts);
 	HPrnAbortDlg = PrnAbortDlg->GetSafeHwnd();
 
 	SetAbortProc(PrintDC,PrnAbortProc);
@@ -559,7 +558,7 @@
 
 void PrintFileDirect()
 {
-	CWnd* pParent;
+	HWND hParent;
 
 	PrnAbortDlg = new CPrnAbortDlg();
 	if (PrnAbortDlg==NULL) {
@@ -568,12 +567,12 @@
 		return;
 	}
 	if (ActiveWin==IdVT) {
-		pParent = (CWnd*)pVTWin;
+		hParent = HVTWin;
 	}
 	else {
-		pParent = (CWnd*)pTEKWin;
+		hParent = HTEKWin;
 	}
-	PrnAbortDlg->Create(hInst, pParent->GetSafeHwnd(),&PrintAbortFlag,&ts);
+	PrnAbortDlg->Create(hInst,hParent,&PrintAbortFlag,&ts);
 	HPrnAbortDlg = PrnAbortDlg->GetSafeHwnd();
 
 	HPrnFile = _lopen(PrnFName,OF_READ);

Modified: branches/unicode_buf/teraterm/teraterm/teraterm.cpp
===================================================================
--- branches/unicode_buf/teraterm/teraterm/teraterm.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/teraterm.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -63,6 +63,7 @@
 
 static BOOL AddFontFlag;
 static TCHAR TSpecialFont[MAX_PATH];
+static CVTWindow* pVTWin;
 
 static void LoadSpecialFont()
 {
@@ -147,7 +148,7 @@
 			else {
 				switch (ActiveWin) {
 				case IdVT:
-					Change =  ((CVTWindow*)pVTWin)->Parse();
+					Change = pVTWin->Parse();
 					// TEK window\x82̃A\x83N\x83e\x83B\x83u\x92\x86\x82\xC9 pause \x82\xF0\x8Eg\x82\xA4\x82ƁACPU\x8Eg\x97p\x97\xA6100%\x82ƂȂ\xE9
 					// \x8C\xBB\x8Fۂւ̎b\x92\xE8\x91Ώ\x88\x81B(2006.2.6 yutaka)
 					// \x91҂\xBF\x8E\x9E\x8AԂ\xF0\x82Ȃ\xAD\x82\xB5\x81A\x83R\x83\x93\x83e\x83L\x83X\x83g\x83X\x83C\x83b\x83`\x82\xBE\x82\xAF\x82ɂ\xB7\x82\xE9\x81B(2006.3.20 yutaka)
@@ -175,7 +176,7 @@
 						VTActivate();
 						break;
 					case IdTEK:
-						((CVTWindow*)pVTWin)->OpenTEK();
+						pVTWin->OpenTEK();
 						break;
 				}
 			}
@@ -245,11 +246,6 @@
 	return OnIdle(lCount);
 }
 
-HINSTANCE GetInstance()
-{
-	return hInst;
-}
-
 static HWND main_window;
 HWND GetHWND()
 {
@@ -256,21 +252,57 @@
 	return main_window;
 }
 
-static HWND hModalWnd;
+static HWND hModelessDlg;
 
-void AddModalHandle(HWND hWnd)
+void AddModelessHandle(HWND hWnd)
 {
-	hModalWnd = hWnd;
+	hModelessDlg = hWnd;
 }
 
-void RemoveModalHandle(HWND hWnd)
+void RemoveModelessHandle(HWND hWnd)
 {
-	hModalWnd = 0;
+	(void)hWnd;
+	hModelessDlg = 0;
 }
 
+static UINT nMsgLast;
+static POINT ptCursorLast;
+
+/**
+ *	idle\x8F\xF3\x91Ԃɓ\xFC\x82邩\x94\xBB\x92肷\x82\xE9
+ */
+static BOOL IsIdleMessage(const MSG* pMsg)
+{
+	if (pMsg->message == WM_MOUSEMOVE ||
+		pMsg->message == WM_NCMOUSEMOVE)
+	{
+		if (pMsg->message == nMsgLast &&
+			pMsg->pt.x == ptCursorLast.x &&
+			pMsg->pt.y == ptCursorLast.y)
+		{	// \x93\xAF\x82\xB6\x88ʒu\x82\xBE\x82\xC1\x82\xBD\x82\xE7idle\x82ɂ͂\xA2\x82\xE7\x82Ȃ\xA2
+			return FALSE;
+		}
+
+		ptCursorLast = pMsg->pt;
+		nMsgLast = pMsg->message;
+		return TRUE;
+	}
+
+	if (pMsg->message == WM_PAINT ||
+		pMsg->message == 0x0118/*WM_SYSTIMER*/)
+	{
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInst,
                    LPSTR lpszCmdLine, int nCmdShow)
 {
+	(void)hPreInst;
+	(void)lpszCmdLine;
+	(void)nCmdShow;
 #ifdef _DEBUG
 	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
 #endif
@@ -283,11 +315,9 @@
 	}
 #endif
 
-	LONG lCount = 0;
-	DWORD SleepTick = 1;
 	init();
 	hInst = hInstance;
-	CVTWindow *m_pMainWnd = new CVTWindow();
+	CVTWindow *m_pMainWnd = new CVTWindow(hInstance);
 	pVTWin = m_pMainWnd;
 	main_window = m_pMainWnd->m_hWnd;
 	// [Tera Term]\x83Z\x83N\x83V\x83\x87\x83\x93\x82\xCCDLG_SYSTEM_FONT\x82\xF0\x82Ƃ肠\x82\xA6\x82\xB8\x83Z\x83b\x83g\x82\xB7\x82\xE9
@@ -294,47 +324,68 @@
 	SetDialogFont(ts.DialogFontName, ts.DialogFontPoint, ts.DialogFontCharSet,
 				  ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
 
+	BOOL bIdle = TRUE;	// idle\x8F\xF3\x91Ԃ\xA9?
+	LONG lCount = 0;
 	MSG msg;
-	while (GetMessage(&msg, NULL, 0, 0)) {
-		if (hModalWnd != 0) {
-			if (IsDialogMessage(hModalWnd, &msg)) {
-				continue;
+	for (;;) {
+		// idle\x8F\xF3\x91ԂŃ\x81\x83b\x83Z\x81[\x83W\x82\xAA\x82Ȃ\xA2\x8Fꍇ
+		while (bIdle) {
+			if (::PeekMessage(&msg, NULL, NULL, NULL, PM_NOREMOVE) != FALSE) {
+				// \x83\x81\x83b\x83Z\x81[\x83W\x82\xAA\x91\xB6\x8D݂\xB7\x82\xE9
+				break;
 			}
+
+			const BOOL continue_idle = OnIdle(lCount++);
+			if (!continue_idle) {
+				// FALSE\x82\xAA\x96߂\xC1\x82Ă\xAB\x82\xBD\x82\xE7idle\x8F\x88\x97\x9D\x82͕s\x97v
+				bIdle = FALSE;
+				break;
+			}
 		}
 
-		bool message_processed = false;
+		// \x83\x81\x83b\x83Z\x81[\x83W\x82\xAA\x8B\xF3\x82ɂȂ\xE9\x82܂ŏ\x88\x97\x9D\x82\xB7\x82\xE9
+		for(;;) {
+			// \x83\x81\x83b\x83Z\x81[\x83W\x82\xAA\x89\xBD\x82\xE0\x82Ȃ\xA2\x8Fꍇ\x81AGetMessage()\x82Ńu\x83\x8D\x83b\x83N\x82\xB7\x82邱\x82Ƃ\xAA\x82\xA0\x82\xE9
+			if (::GetMessage(&msg, NULL, 0, 0) == FALSE) {
+				// WM_QUIT
+				goto exit_message_loop;
+			}
 
-		if (m_pMainWnd->m_hAccel != NULL) {
-			if (!MetaKey(ts.MetaKey)) {
-				// matakey\x82\xAA\x89\x9F\x82\xB3\x82\xEA\x82Ă\xA2\x82Ȃ\xA2
-				if (TranslateAccelerator(m_pMainWnd->m_hWnd , m_pMainWnd->m_hAccel, &msg)) {
-					// \x83A\x83N\x83Z\x83\x89\x83\x8C\x81[\x83^\x81[\x83L\x81[\x82\xF0\x8F\x88\x97\x9D\x82\xB5\x82\xBD
-					message_processed = true;
+			if (hModelessDlg == 0 ||
+				::IsDialogMessage(hModelessDlg, &msg) == FALSE)
+			{
+				bool message_processed = false;
+
+				if (m_pMainWnd->m_hAccel != NULL) {
+					if (!MetaKey(ts.MetaKey)) {
+						// matakey\x82\xAA\x89\x9F\x82\xB3\x82\xEA\x82Ă\xA2\x82Ȃ\xA2
+						if (::TranslateAccelerator(m_pMainWnd->m_hWnd , m_pMainWnd->m_hAccel, &msg)) {
+							// \x83A\x83N\x83Z\x83\x89\x83\x8C\x81[\x83^\x81[\x83L\x81[\x82\xF0\x8F\x88\x97\x9D\x82\xB5\x82\xBD
+							message_processed = true;
+						}
+					}
 				}
+
+				if (!message_processed) {
+					::TranslateMessage(&msg);
+					::DispatchMessage(&msg);
+				}
 			}
-		}
 
-		if (!message_processed) {
-			TranslateMessage(&msg);
-			DispatchMessage(&msg);
-		}
-
-		while (!PeekMessage(&msg, NULL, NULL, NULL, PM_NOREMOVE)) {
-			// \x83\x81\x83b\x83Z\x81[\x83W\x82\xAA\x82Ȃ\xA2
-			if (!OnIdle(lCount)) {
-				// idle\x95s\x97v
-				if (SleepTick < 500) {	// \x8Dő\xE5 501ms\x96\xA2\x96\x9E
-					SleepTick += 2;
-				}
+			// idle\x8F\xF3\x91Ԃɓ\xFC\x82邩?
+			if (IsIdleMessage(&msg)) {
+				bIdle = TRUE;
 				lCount = 0;
-				Sleep(SleepTick);
-			} else {
-				// \x97vidle
-				SleepTick = 0;
-				lCount++;
 			}
+
+			if (::PeekMessage(&msg, NULL, NULL, NULL, PM_NOREMOVE) == FALSE) {
+				// \x83\x81\x83b\x83Z\x81[\x83W\x82\xAA\x82Ȃ\xAD\x82Ȃ\xC1\x82\xBD
+				break;
+			}
 		}
 	}
+exit_message_loop:
+
 	delete m_pMainWnd;
 	m_pMainWnd = NULL;
 
@@ -341,5 +392,5 @@
 	UnloadSpecialFont();
 	DLLExit();
 
-    return msg.wParam;
+    return (int)msg.wParam;
 }

Modified: branches/unicode_buf/teraterm/teraterm/teraterm.manifest
===================================================================
--- branches/unicode_buf/teraterm/teraterm/teraterm.manifest	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/teraterm.manifest	2019-08-20 14:35:14 UTC (rev 7998)
@@ -9,7 +9,7 @@
         type="win32"
         name="Microsoft.Windows.Common-Controls"
         version="6.0.0.0"
-        processorArchitecture="X86"
+        processorArchitecture="*"
         publicKeyToken="6595b64144ccf1df"
         language="*"
       />

Modified: branches/unicode_buf/teraterm/teraterm/teraterml.h
===================================================================
--- branches/unicode_buf/teraterm/teraterm/teraterml.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/teraterml.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -29,5 +29,5 @@
 /* teraterm local header   */
 /*	teraterm/ folder only  */
 
-void AddModalHandle(HWND hWnd);
-void RemoveModalHandle(HWND hWnd);
+void AddModelessHandle(HWND hWnd);
+void RemoveModelessHandle(HWND hWnd);

Modified: branches/unicode_buf/teraterm/teraterm/ttdde.c
===================================================================
--- branches/unicode_buf/teraterm/teraterm/ttdde.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/ttdde.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2004-2017 TeraTerm Project
+ * (C) 2004-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -565,7 +565,7 @@
 		if (LogVar != NULL)
 		{
 			DWORD wrote;
-			WriteFile((HANDLE)LogVar->FileHandle, ParamFileName, strlen(ParamFileName), &wrote, NULL);
+			WriteFile(LogVar->FileHandle, ParamFileName, strlen(ParamFileName), &wrote, NULL);
 			LogVar->ByteCount =
 				LogVar->ByteCount + strlen(ParamFileName);
 			FLogRefreshNum();

Modified: branches/unicode_buf/teraterm/teraterm/ttermpro.rc
===================================================================
--- branches/unicode_buf/teraterm/teraterm/ttermpro.rc	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/ttermpro.rc	2019-08-20 14:35:14 UTC (rev 7998)
@@ -118,7 +118,7 @@
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,130,220,10
 END
 
-IDD_TABSHEET_COPYPASTE DIALOGEX 0, 0, 258, 188
+IDD_TABSHEET_COPYPASTE DIALOGEX 0, 0, 258, 194
 STYLE DS_SETFONT | DS_CONTROL | WS_CHILD | WS_SYSMENU
 FONT 8, "Tahoma", 0, 0, 0x0
 BEGIN
@@ -143,6 +143,7 @@
     LTEXT           "P&aste delay per line",IDC_PASTEDELAY_LABEL,11,160,70,10
     EDITTEXT        IDC_PASTEDELAY_EDIT,95,158,24,12,ES_AUTOHSCROLL | ES_NUMBER
     LTEXT           "ms",IDC_PASTEDELAY_LABEL2,123,160,23,10
+    CONTROL         "Ena&bling text selection when the window is activated by mouse",IDC_SELECT_ON_ACTIVATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,173,200,10
 END
 
 IDD_TABSHEET_VISUAL DIALOGEX 0, 0, 258, 188
@@ -395,7 +396,7 @@
         LEFTMARGIN, 5
         RIGHTMARGIN, 252
         TOPMARGIN, 5
-        BOTTOMMARGIN, 185
+        BOTTOMMARGIN, 191
     END
 
     IDD_TABSHEET_VISUAL, DIALOG
@@ -577,11 +578,11 @@
     BEGIN
         MENUITEM "&Terminal...",                ID_SETUP_TERMINAL
         MENUITEM "&Window...",                  ID_SETUP_WINDOW
-		POPUP "&Font"
+        POPUP "&Font"
         BEGIN
-			MENUITEM "&Font...",                ID_SETUP_FONT
-			MENUITEM "&Dialog Font...",         ID_SETUP_DLG_FONT
-	END
+            MENUITEM "&Font...",                    ID_SETUP_FONT
+            MENUITEM "&Dialog Font...",             ID_SETUP_DLG_FONT
+        END
         MENUITEM "&Keyboard...",                ID_SETUP_KEYBOARD
         MENUITEM "S&erial port...",             ID_SETUP_SERIALPORT
         MENUITEM "T&CP/IP...",                  ID_SETUP_TCPIP

Modified: branches/unicode_buf/teraterm/teraterm/ttime.c
===================================================================
--- branches/unicode_buf/teraterm/teraterm/ttime.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/ttime.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -34,7 +34,6 @@
 #include <string.h>
 #include <imm.h>
 #include <crtdbg.h>
-#include <stdio.h>
 #include <assert.h>
 
 #include "ttime.h"
@@ -45,21 +44,6 @@
 #define free(p)		_free_dbg((p), _NORMAL_BLOCK)
 #endif
 
-// imm.h \x82\xAA include \x82ł\xAB\x82\xEA\x82\xCE _IMM_ \x82\xAA define \x82\xB3\x82\xEA\x82\xE9 \x81\xA8 \x82\xB1\x82̃u\x83\x8D\x83b\x83N\x95s\x97v?
-#ifndef _IMM_
-  #define _IMM_
-
-  typedef DWORD HIMC;
-
-  typedef struct tagCOMPOSITIONFORM {
-    DWORD dwStyle;
-    POINT ptCurrentPos;
-    RECT  rcArea;
-  } COMPOSITIONFORM, *PCOMPOSITIONFORM, NEAR *NPCOMPOSITIONFORM, *LPCOMPOSITIONFORM;
-
-#define GCS_RESULTSTR 0x0800
-#endif //_IMM_
-
 // #define ENABLE_DUMP	1
 
 typedef LONG (WINAPI *TImmGetCompositionStringA)(HIMC, DWORD, LPVOID, DWORD);
@@ -66,7 +50,8 @@
 typedef LONG (WINAPI *TImmGetCompositionStringW)(HIMC, DWORD, LPVOID, DWORD);
 typedef HIMC (WINAPI *TImmGetContext)(HWND);
 typedef BOOL (WINAPI *TImmReleaseContext)(HWND, HIMC);
-typedef BOOL (WINAPI *TImmSetCompositionFont)(HIMC, LPLOGFONTA);
+typedef BOOL (WINAPI *TImmSetCompositionFontA)(HIMC, LPLOGFONTA);
+typedef BOOL (WINAPI *TImmSetCompositionFontW)(HIMC, LPLOGFONTW);
 typedef BOOL (WINAPI *TImmSetCompositionWindow)(HIMC, LPCOMPOSITIONFORM);
 typedef BOOL (WINAPI *TImmGetOpenStatus)(HIMC);
 typedef BOOL (WINAPI *TImmSetOpenStatus)(HIMC, BOOL);
@@ -75,7 +60,8 @@
 static TImmGetCompositionStringA PImmGetCompositionStringA;
 static TImmGetContext PImmGetContext;
 static TImmReleaseContext PImmReleaseContext;
-static TImmSetCompositionFont PImmSetCompositionFont;
+static TImmSetCompositionFontA PImmSetCompositionFontA;
+static TImmSetCompositionFontW PImmSetCompositionFontW;
 static TImmSetCompositionWindow PImmSetCompositionWindow;
 static TImmGetOpenStatus PImmGetOpenStatus;
 static TImmSetOpenStatus PImmSetOpenStatus;
@@ -82,7 +68,8 @@
 
 
 static HANDLE HIMEDLL = NULL;
-static LOGFONTA lfIME;
+static LOGFONTA IMELogFontA;
+static LOGFONTW IMELogFontW;
 
 BOOL LoadIME(void)
 {
@@ -117,10 +104,13 @@
 	HIMEDLL, "ImmReleaseContext");
   if (PImmReleaseContext==NULL) Err = TRUE;
 
-  PImmSetCompositionFont = (TImmSetCompositionFont)GetProcAddress(
+  PImmSetCompositionFontA = (TImmSetCompositionFontA)GetProcAddress(
 	HIMEDLL, "ImmSetCompositionFontA");
-  if (PImmSetCompositionFont==NULL) Err = TRUE;
+  if (PImmSetCompositionFontA==NULL) Err = TRUE;
 
+  PImmSetCompositionFontW = (TImmSetCompositionFontW)GetProcAddress(
+	HIMEDLL, "ImmSetCompositionFontW");
+
   PImmSetCompositionWindow = (TImmSetCompositionWindow)GetProcAddress(
 	HIMEDLL, "ImmSetCompositionWindow");
   if (PImmSetCompositionWindow==NULL) Err = TRUE;
@@ -182,17 +172,51 @@
   (*PImmReleaseContext)(HWnd,hIMC);
 }
 
-void SetConversionLogFont(HWND HWnd, PLOGFONTA lf)
+void ResetConversionLogFont(HWND HWnd)
 {
-  HIMC	hIMC;
-  if (HIMEDLL == NULL) return;
+	HIMC	hIMC;
+	if (HIMEDLL == NULL) return;
 
-  memcpy(&lfIME,lf,sizeof(LOGFONT));
+	hIMC = PImmGetContext(HWnd);
+	if (hIMC != NULL) {
+		BOOL result = FALSE;
+		if (PImmSetCompositionFontW != NULL) {
+			// ImmSetCompositionFontA()\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9\x82\xC6
+			// \x96\xA2\x95ϊ\xB7\x95\xB6\x8E\x9A\x97񂪎w\x92\xE8\x83t\x83H\x83\x93\x83g\x82ŕ\\x8E\xA6\x82\xB3\x82\xEA\x82Ȃ\xA2\x82\xB1\x82Ƃ\xAA\x82\xA0\x82\xE9
+			result = PImmSetCompositionFontW(hIMC, &IMELogFontW);
+		}
+		if (result == FALSE) {
+			// ImmSetCompositionFontW() \x82\xAA\x83G\x83\x89\x81[\x82\xF0\x95Ԃ\xB5\x82Ă\xAB\x82\xBD\x82Ƃ\xAB A() \x82Ń\x8A\x83g\x83\x89\x83C
+			// 9x \x82ł\xCD W()\x82͑\xB6\x8D݂\xB7\x82邪\x83G\x83\x89\x81[\x82\xF0\x95Ԃ\xB5\x82Ă\xAD\x82\xE9\x82悤\x82\xBE
+			PImmSetCompositionFontA(hIMC, &IMELogFontA);
+		}
+		PImmReleaseContext(HWnd,hIMC);
+	}
+}
 
-  hIMC = (*PImmGetContext)(HWnd);
-  // Set font for the conversion window
-  (*PImmSetCompositionFont)(hIMC,&lfIME);
-  (*PImmReleaseContext)(HWnd,hIMC);
+void SetConversionLogFont(HWND HWnd, const LOGFONTA *lf)
+{
+	if (HIMEDLL == NULL) return;
+
+	memcpy(&IMELogFontA,lf,sizeof(LOGFONT));
+	if (PImmSetCompositionFontW != NULL) {
+		LOGFONTW *p = &IMELogFontW;
+		p->lfWeight = lf->lfWeight;
+		p->lfItalic = lf->lfItalic;
+		p->lfUnderline = lf->lfUnderline;
+		p->lfStrikeOut = lf->lfStrikeOut;
+		p->lfWidth = lf->lfWidth;
+		p->lfHeight = lf->lfHeight;
+		p->lfCharSet = lf->lfCharSet;
+		p->lfOutPrecision = lf->lfOutPrecision;
+		p->lfClipPrecision = lf->lfClipPrecision;
+		p->lfQuality = lf->lfQuality ;
+		p->lfPitchAndFamily = lf->lfPitchAndFamily;
+		MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS,
+							lf->lfFaceName, sizeof(lf->lfFaceName),
+							p->lfFaceName, _countof(p->lfFaceName));
+	}
+	ResetConversionLogFont(HWnd);
 }
 
 // \x93\xE0\x95\x94\x97p

Modified: branches/unicode_buf/teraterm/teraterm/ttime.h
===================================================================
--- branches/unicode_buf/teraterm/teraterm/ttime.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/ttime.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -38,7 +38,8 @@
 void FreeIME(HWND hWnd);
 BOOL CanUseIME(void);
 void SetConversionWindow(HWND HWnd, int X, int Y);
-void SetConversionLogFont(HWND HWnd, PLOGFONTA lf);
+void SetConversionLogFont(HWND HWnd, const LOGFONTA *lf);
+void ResetConversionLogFont(HWND HWnd);
 BOOL GetIMEOpenStatus(HWND hWnd);
 void SetIMEOpenStatus(HWND hWnd, BOOL stat);
 const wchar_t *GetConvStringW(HWND hWnd, LPARAM lParam, size_t *len);

Modified: branches/unicode_buf/teraterm/teraterm/ttplug.c
===================================================================
--- branches/unicode_buf/teraterm/teraterm/ttplug.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/ttplug.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
  * (C) Robert O'Callahan
- * (C) 2004-2017 TeraTerm Project
+ * (C) 2004-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -118,7 +118,7 @@
   if (1) {
     char buf[1024];
     struct _finddata_t searchData;
-    long searchHandle;
+	intptr_t searchHandle;
 
     _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%s\\TTX*.DLL", ts->HomeDir);
 

Modified: branches/unicode_buf/teraterm/teraterm/ttwinman.c
===================================================================
--- branches/unicode_buf/teraterm/teraterm/ttwinman.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/ttwinman.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -55,7 +55,6 @@
 TComVar cv;
 
 /* pointers to window objects */
-void* pVTWin = NULL;
 void* pTEKWin = NULL;
 /* instance handle */
 HINSTANCE hInst;

Modified: branches/unicode_buf/teraterm/teraterm/ttwinman.h
===================================================================
--- branches/unicode_buf/teraterm/teraterm/ttwinman.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/ttwinman.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -55,7 +55,6 @@
 extern TComVar cv;
 
 /* pointers to window objects */
-extern void* pVTWin;
 extern void* pTEKWin;
 /* instance handle */
 extern HINSTANCE hInst;

Modified: branches/unicode_buf/teraterm/teraterm/vtdisp.c
===================================================================
--- branches/unicode_buf/teraterm/teraterm/vtdisp.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/vtdisp.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -197,7 +197,7 @@
 
 static BOOL (WINAPI *BGAlphaBlend)(HDC,int,int,int,int,HDC,int,int,int,int,BLENDFUNCTION);
 
-static HBITMAP GetBitmapHandle(char *File);
+static HBITMAP GetBitmapHandle(const char *File);
 
 
 //\x95֗\x98\x8A֐\x94\x81\x99
@@ -447,8 +447,14 @@
   if(spiVersion[2] != 'I' || spiVersion[3] != 'N')
     goto error;
 
+#if !defined(_M_X64)
   if(!(SPI_IsSupported)(nameFile,(unsigned long)bufFile))
     goto error;
+#else
+  // TODO \x83|\x83C\x83\x93\x83^\x82\xF0 unsigned long \x82ɕϊ\xB7\x82\xB5\x82Ă\xA2\x82\xE9
+  // 64bit\x94\xC5Susie Plug-in \x82\xAA\x91\xB6\x8D݂\xB7\x82\xE9?
+  goto error;
+#endif
 
   if((SPI_GetPicture)(bufFile,sizeFile,1,hbmi,hbuf,NULL,0))
     goto error;
@@ -726,7 +732,7 @@
 // (2011.8.3 yutaka)
 // cf. http://www.geocities.jp/ccfjd821/purogu/wpe-ji9.html
 // \x82\xB1\x82̊֐\x94\x82\xCD Windows 2000 \x96\xA2\x96\x9E\x82̏ꍇ\x82ɂ͌Ă\xF1\x82ł͂\xA2\x82\xAF\x82Ȃ\xA2
-static HBITMAP GetBitmapHandle(char *File)
+static HBITMAP GetBitmapHandle(const char *File)
 {
 	OLE_HANDLE hOle = 0;
 	IStream *iStream=NULL;
@@ -740,7 +746,7 @@
 
 	hFile=CreateFile(File,GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL);
 	if (hFile == INVALID_HANDLE_VALUE) {
-		return (hBitmap);
+		return NULL;
 	}
 	nFileSize=GetFileSize(hFile,NULL);
 	hMem=GlobalAlloc(GMEM_MOVEABLE,nFileSize);
@@ -759,9 +765,9 @@
 	// \x83v\x83\x8D\x83O\x83\x89\x83\x80\x82\xAA\x97\x8E\x82\xBF\x82\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B
 	// (2015.12.5 yutaka)
 	if (iPicture == NULL)
-		return (hBitmap);
+		return NULL;
 
-	iStream->lpVtbl->Release((IStream *)iPicture);
+	iStream->lpVtbl->Release(iStream);
 
 	iPicture->lpVtbl->get_Type(iPicture,&type);
 	if(type==PICTYPE_BITMAP){
@@ -770,7 +776,7 @@
 
 	hBitmap=(HBITMAP)hOle;
 
-	return (hBitmap);
+	return hBitmap;
 }
 
 // \x90\xFC\x8C`\x95⊮\x96@\x82ɂ\xE6\x82\xE8\x94\xE4\x8Ar\x93I\x91N\x96\xBE\x82Ƀr\x83b\x83g\x83}\x83b\x83v\x82\xF0\x8Ag\x91\xE5\x81E\x8Fk\x8F\xAC\x82\xB7\x82\xE9\x81B

Modified: branches/unicode_buf/teraterm/teraterm/vtterm.c
===================================================================
--- branches/unicode_buf/teraterm/teraterm/vtterm.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/vtterm.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -408,7 +408,15 @@
 		strcpy(ts.Locale, DEFAULT_LOCALE);
 		result = setlocale(LC_ALL, ts.Locale);
 	}
-	ts.CodePage = atoi(strrchr(result, '.')+1);
+	// \x89p\x8C\xEA\x94\xC5Windows\x82ł́Ats.Locale\x82\xAA\x83f\x83t\x83H\x83\x8B\x83g\x82\xCC"japanese"\x82\xBE\x82\xC1\x82\xBD\x8Fꍇ\x81A
+	// setlocale\x82\xAA NULL \x82\xF0\x95Ԃ\xB7\x82\xBD\x82߁ATera Term\x82̋N\x93\xAE\x8E\x9E\x82ɗ\x8E\x82\xBF\x82\xE9\x81Bstrrchr\x82\xCC
+	// \x91\xE61\x88\xF8\x90\x94\x82ɂ\xCDNULL\x82\xAA\x8Ew\x92\xE8\x82ł\xAB\x82Ȃ\xA2\x82\xBD\x82߁B
+	// setlocale \x82ɐ\xAC\x8C\x{1C2D42}\xBD\x8E\x9E\x82̓R\x81[\x83h\x83y\x81[\x83W\x82\xF0\x90ݒ肵\x81A\x8E\xB8\x94s\x82\xB5\x82\xBD\x8E\x9E\x82\xCD
+	// ANSI\x83R\x81[\x83h\x83y\x81[\x83W\x82\xF0\x90ݒ肷\x82\xE9\x81B
+	if (result)
+		ts.CodePage = atoi(strrchr(result, '.')+1);
+	else
+		ts.CodePage = GetACP();
 }
 
 void ResetKeypadMode(BOOL DisabledModeOnly)

Modified: branches/unicode_buf/teraterm/teraterm/vtwin.cpp
===================================================================
--- branches/unicode_buf/teraterm/teraterm/vtwin.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/vtwin.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -151,11 +151,6 @@
 /////////////////////////////////////////////////////////////////////////////
 // CVTWindow
 
-static HINSTANCE AfxGetInstanceHandle()
-{
-	return hInst;
-}
-
 // Tera Term\x8BN\x93\xAE\x8E\x9E\x82\xC6URL\x95\xB6\x8E\x9A\x97\xF1mouse over\x8E\x9E\x82ɌĂ΂\xEA\x82\xE9 (2005.4.2 yutaka)
 static void SetMouseCursor(const char *cursor)
 {
@@ -258,6 +253,7 @@
 // (2007.9.30 yutaka)
 //
 // \x97\xE1\x8AO\x83R\x81[\x83h\x82𕶎\x9A\x97\xF1\x82֕ϊ\xB7\x82\xB7\x82\xE9
+#if !defined(_M_X64)
 static const char *GetExceptionString(DWORD exception)
 {
 #define EXCEPTION(x) case EXCEPTION_##x: return (#x);
@@ -447,6 +443,7 @@
 //	return (EXCEPTION_EXECUTE_HANDLER);  /* \x82\xBB\x82̂܂܃v\x83\x8D\x83Z\x83X\x82\xF0\x8FI\x97\xB9\x82\xB3\x82\xB9\x82\xE9 */
 	return (EXCEPTION_CONTINUE_SEARCH);  /* \x88\xF8\x82\xAB\x91\xB1\x82\xAB\x81m\x83A\x83v\x83\x8A\x83P\x81[\x83V\x83\x87\x83\x93\x83G\x83\x89\x81[\x81n\x83|\x83b\x83v\x83A\x83b\x83v\x83\x81\x83b\x83Z\x81[\x83W\x83{\x83b\x83N\x83X\x82\xF0\x8CĂяo\x82\xB7 */
 }
+#endif // !defined(_M_X64 )
 
 
 // Virtual Store\x82\xAA\x97L\x8C\xF8\x82ł\xA0\x82邩\x82ǂ\xA4\x82\xA9\x82𔻕ʂ\xB7\x82\xE9\x81B
@@ -534,7 +531,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // CVTWindow constructor
 
-CVTWindow::CVTWindow()
+CVTWindow::CVTWindow(HINSTANCE hInstance)
 {
 	WNDCLASS wc;
 	RECT rect;
@@ -550,9 +547,12 @@
 #endif
 	int fuLoad = LR_DEFAULTCOLOR;
 	BOOL isFirstInstance;
+	m_hInst = hInstance;
 
 	// \x97\xE1\x8AO\x83n\x83\x93\x83h\x83\x89\x82̃t\x83b\x83N (2007.9.30 yutaka)
+#if !defined(_M_X64)
 	SetUnhandledExceptionFilter(ApplicationFaultHandler);
+#endif
 
 	CommInit(&cv);
 	isFirstInstance = StartTeraTerm(&ts);
@@ -694,7 +694,7 @@
 	wc.lpfnWndProc = (WNDPROC)ProcStub;
 	wc.cbClsExtra = 0;
 	wc.cbWndExtra = 0;
-	wc.hInstance = AfxGetInstanceHandle();
+	wc.hInstance = hInstance;
 	wc.hIcon = NULL;
 	//wc.hCursor = LoadCursor(NULL,IDC_IBEAM);
 	wc.hCursor = NULL; // \x83}\x83E\x83X\x83J\x81[\x83\\x83\x8B\x82͓\xAE\x93I\x82ɕύX\x82\xB7\x82\xE9 (2005.4.2 yutaka)
@@ -703,7 +703,7 @@
 	wc.lpszClassName = VTClassName;
 
 	RegisterClass(&wc);
-	m_hAccel = ::LoadAccelerators(hInst, MAKEINTRESOURCE(IDR_ACC));
+	m_hAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_ACC));
 
 	if (ts.VTPos.x==CW_USEDEFAULT) {
 		rect = rectDefault;
@@ -714,7 +714,7 @@
 		rect.right = rect.left + 100;
 		rect.bottom = rect.top + 100;
 	}
-	Create(hInst, VTClassName, _T("Tera Term"), Style, rect, NULL, NULL);
+	Create(hInstance, VTClassName, _T("Tera Term"), Style, rect, NULL, NULL);
 
 	/*--------- Init2 -----------------*/
 	HVTWin = GetSafeHwnd();
@@ -745,7 +745,7 @@
 		fuLoad = LR_VGACOLOR;
 	}
 	::PostMessage(HVTWin,WM_SETICON,ICON_SMALL,
-	              (LPARAM)LoadImage(AfxGetInstanceHandle(),
+	              (LPARAM)LoadImage(hInstance,
 	                                MAKEINTRESOURCE((ts.VTIcon!=IdIconDefault)?ts.VTIcon:IDI_VT),
 	                                IMAGE_ICON,16,16,fuLoad));
 	// Vista \x82\xCC Aero \x82ɂ\xA8\x82\xA2\x82\xC4 Alt+Tab \x90؂\xE8\x91ւ\xA6\x82ŕ\\x8E\xA6\x82\xB3\x82\xEA\x82\xE9\x83A\x83C\x83R\x83\x93\x82\xAA
@@ -752,13 +752,13 @@
 	// 16x16 \x83A\x83C\x83R\x83\x93\x82̊g\x91\xE5\x82ɂȂ\xC1\x82Ă\xB5\x82܂\xA4\x82̂ŁA\x91傫\x82\xA2\x83A\x83C\x83R\x83\x93\x82\xE0
 	// \x83Z\x83b\x83g\x82\xB7\x82\xE9 (2008.9.3 maya)
 	::PostMessage(HVTWin,WM_SETICON,ICON_BIG,
-	              (LPARAM)LoadImage(AfxGetInstanceHandle(),
+	              (LPARAM)LoadImage(hInstance,
 	                                MAKEINTRESOURCE((ts.VTIcon!=IdIconDefault)?ts.VTIcon:IDI_VT),
 	                                IMAGE_ICON, 0, 0, fuLoad));
 
 	SetCustomNotifyIcon(
 		(HICON)LoadImage(
-			AfxGetInstanceHandle(),
+			hInstance,
 			MAKEINTRESOURCE((ts.VTIcon!=IdIconDefault)?ts.VTIcon:IDI_VT),
 			IMAGE_ICON, 16, 16, LR_VGACOLOR|LR_SHARED));
 
@@ -890,7 +890,7 @@
 
 				AppendMenu(PopupBase,
 				           submenu != NULL ? LOBYTE(state) | MF_POPUP : state,
-				           submenu != NULL ? (UINT)submenu : GetMenuItemID(PopupMenu, i),
+				           submenu != NULL ? (UINT_PTR)submenu : GetMenuItemID(PopupMenu, i),
 				           itemText);
 			}
 		}
@@ -1058,7 +1058,7 @@
 
 void CVTWindow::InitMenu(HMENU *Menu)
 {
-	*Menu = LoadMenu(AfxGetInstanceHandle(),
+	*Menu = LoadMenu(m_hInst,
 	                 MAKEINTRESOURCE(IDR_MENU));
 	char uimsg[MAX_UIMSG];
 	int ret;
@@ -1308,7 +1308,7 @@
 		             "&Window", ts.UILanguageFile);
 		::InsertMenu(*Menu,ID_HELPMENU,
 		             MF_STRING | MF_ENABLED | MF_POPUP | MF_BYPOSITION,
-		             (int)WinMenu, ts.UIMsg);
+		             (UINT_PTR)WinMenu, ts.UIMsg);
 	}
 
 	TTXModifyMenu(*Menu); /* TTPLUG */
@@ -1488,7 +1488,7 @@
 {
 	char uimsg[MAX_UIMSG];
 
-	*Menu = LoadMenu(AfxGetInstanceHandle(),
+	*Menu = LoadMenu(m_hInst,
 	                 MAKEINTRESOURCE(IDR_PASTEMENU));
 
 	GetMenuString(*Menu, ID_EDIT_PASTE2, uimsg, sizeof(uimsg), MF_BYCOMMAND);
@@ -1633,7 +1633,7 @@
 {
 	ActiveWin = IdTEK;
 	if (HTEKWin==NULL) {
-		pTEKWin = new CTEKWindow();
+		pTEKWin = new CTEKWindow(m_hInst);
 	}
 	else {
 		::ShowWindow(HTEKWin,SW_SHOWNORMAL);
@@ -1843,7 +1843,7 @@
 }
 
 // \x8FI\x97\xB9\x96₢\x8D\x87\x82킹\x82Ȃ\xB5\x82\xC9Tera Term\x82\xF0\x8FI\x97\xB9\x82\xB7\x82\xE9\x81BOnAllClose()\x8E\xF3\x90M\x97p\x81B
-LONG CVTWindow::OnNonConfirmClose(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnNonConfirmClose(WPARAM wParam, LPARAM lParam)
 {
 	// \x82\xB1\x82\xB1\x82\xC5 ts \x82̓\xE0\x97e\x82\xF0\x88Ӑ}\x93I\x82ɏ\x91\x82\xAB\x8A\xB7\x82\xA6\x82Ă\xE0\x81A\x8FI\x97\xB9\x8E\x9E\x82Ɏ\xA9\x93\xAE\x83Z\x81[\x83u\x82\xB3\x82\xEA\x82\xE9\x82킯\x82ł͂Ȃ\xA2\x82̂ŁA\x93\xC1\x82ɖ\xE2\x91\xE8\x82Ȃ\xB5\x81B
 	ts.PortFlag &= ~PF_CONFIRMDISCONN;
@@ -1993,7 +1993,7 @@
 	}
 }
 
-LONG CVTWindow::OnDropNotify(UINT ShowDialog, LONG lParam)
+LRESULT CVTWindow::OnDropNotify(WPARAM ShowDialog, LPARAM lParam)
 {
 	// ini\x82ɕۑ\xB6\x82\xB3\x82\xEA\x82Ȃ\xA2\x81A\x8D\xA1\x8E\xC0\x8Ds\x82\xB5\x82Ă\xA2\x82\xE9Tera Term\x82ł̂ݗL\x8C\xF8\x82Ȑݒ\xE8
 	static enum drop_type DefaultDropType = DROP_TYPE_CANCEL;
@@ -2091,7 +2091,7 @@
 			SetDialogFont(ts.DialogFontName, ts.DialogFontPoint, ts.DialogFontCharSet,
 						  ts.UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
 			DropType =
-				ShowDropDialogBox(hInst, HVTWin,
+				ShowDropDialogBox(m_hInst, HVTWin,
 								  FileName, DropType,
 								  DropListCount - i,
 								  (DirectoryCount == 0 && isSSH) ? true : false,
@@ -3187,22 +3187,27 @@
 LRESULT CVTWindow::OnIMENotify(WPARAM wParam, LPARAM lParam)
 {
 	switch (wParam) {
-	case IMN_SETOPENSTATUS: {
+	case IMN_SETOPENSTATUS:
 		// \x93\xFC\x97̓R\x83\x93\x83e\x83L\x83X\x83g\x82̊J\x95\xF3\x91Ԃ\xAA\x8DX\x90V\x82\xB3\x82\xEA\x82\xE9(IME On/OFF)
 
 		// IME\x82\xCCOn/Off\x82\xF0\x8E擾\x82\xB7\x82\xE9
 		IMEstat = GetIMEOpenStatus(HVTWin);
+		if (IMEstat != 0) {
+			// IME On
 
-		// \x8F\xF3\x91Ԃ\xF0\x95\\x8E\xA6\x82\xB7\x82\xE9IME\x82̂\xBD\x82߂Ɉʒu\x82\xF0\x92ʒm\x82\xB7\x82\xE9
-		int CaretX = (CursorX-WinOrgX)*FontWidth;
-		int CaretY = (CursorY-WinOrgY)*FontHeight;
-		SetConversionWindow(HVTWin,CaretX,CaretY);
+			// \x8F\xF3\x91Ԃ\xF0\x95\\x8E\xA6\x82\xB7\x82\xE9IME\x82̂\xBD\x82߂Ɉʒu\x82\xF0\x92ʒm\x82\xB7\x82\xE9
+			int CaretX = (CursorX-WinOrgX)*FontWidth;
+			int CaretY = (CursorY-WinOrgY)*FontHeight;
+			SetConversionWindow(HVTWin,CaretX,CaretY);
 
+			// \x83t\x83H\x83\x93\x83g\x82\xF0\x90ݒ肷\x82\xE9
+			ResetConversionLogFont(HVTWin);
+		}
+
 		// \x95`\x89\xE6
 		ChangeCaret();
 
 		break;
-	}
 
 	// \x8C\xF3\x95\xE2\x83E\x83B\x83\x93\x83h\x83E\x82̕\\x8E\xA6\x8F󋵒ʒm
 	// IME_OPENCANDIDATE / IMN_CLOSECANDIDATE \x83T\x83|\x81[\x83g\x8F\xF3\x8B\xB5
@@ -3218,11 +3223,32 @@
 	// \x8C\xF3\x95\xE2\x83E\x83B\x83\x93\x83h\x83E\x82\xAA\x95\\x8E\xA6\x82\xB3\x82ꂽ / \x95‚\xB6\x82\xBD\x82Ŕ\xAD\x90\xB6\x82\xB7\x82\xE9\x81B
 	case IMN_OPENCANDIDATE: {
 		// \x8C\xF3\x95\xE2\x83E\x83B\x83\x93\x83h\x83E\x82\xF0\x8AJ\x82\xB1\x82\xA4\x82Ƃ\xB5\x82Ă\xA2\x82\xE9
+
+		// \x8F\xF3\x91Ԃ\xF0\x95\\x8E\xA6\x82\xB7\x82\xE9IME\x82̂\xBD\x82߂Ɉʒu\x82\xF0\x92ʒm\x82\xB7\x82\xE9
+		// \x8E\x9F\x82̏ꍇ\x82\xAA\x82\xA0\x82\xE9\x82̂ŁA\x88ʒu\x82\xF0\x8DĐݒ肷\x82\xE9
+		// - \x8A\xBF\x8E\x9A\x95ϊ\xB7\x8C\xF3\x95\xE2\x82\xF0\x95\\x8E\xA6
+		// - \x8E\x9F\x82̕\xB6\x8E\x9A\x82\xF0\x93\xFC\x97͂\xB7\x82邱\x82ƂŊm\x92菈\x97\x9D\x82\xF0\x8Ds\x82\xA4
+		// - \x95\xB6\x8E\x9A\x93\xFC\x97͂Ɩ\xA2\x95ϊ\xB7\x95\xB6\x8E\x9A\x93\xFC\x97͂\xAA\x94\xAD\x90\xB6\x82\xB7\x82\xE9
 		int CaretX = (CursorX-WinOrgX)*FontWidth;
 		int CaretY = (CursorY-WinOrgY)*FontHeight;
 		SetConversionWindow(HVTWin,CaretX,CaretY);
+
+		// \x83t\x83H\x83\x93\x83g\x82\xF0\x90ݒ肷\x82\xE9
+		ResetConversionLogFont(HVTWin);
+
 		break;
 	}
+
+	case IMN_OPENSTATUSWINDOW:
+		// \x83X\x83e\x81[\x83^\x83X\x83E\x83B\x83\x93\x83h\x83E\x82\xF0\x83I\x81[\x83v\x83\x93(\x96\xA2\x8Am\x92蕶\x8E\x9A\x82\xF0\x95\\x8E\xA6?)\x82\xB5\x82悤\x82Ƃ\xB5\x82Ă\xA2\x82\xE9
+
+		// IME\x82Ŗ\xA2\x95ϊ\xB7\x8F\xF3\x91ԂŁA\x83t\x83H\x83\x93\x83g\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x83I\x81[\x83v\x83\x93\x82\xB5\x82ăN\x83\x8D\x81[\x83Y\x82\xB7\x82\xE9\x82\xC6
+		// IME\x82ɐݒ肵\x82Ă\xA2\x82\xBD\x83t\x83H\x83\x93\x83g\x82\xAA\x95ʂ̂\xE0\x82̂ɕω\xBB\x82\xB5\x82Ă\xA2\x82\xE9\x82炵\x82\xA2
+		// \x82\xB1\x82\xB1\x82Ńt\x83H\x83\x93\x83g\x82̍Đݒ\xE8\x82\xF0\x8Ds\x82\xA4
+
+		// \x83t\x83H\x83\x93\x83g\x82\xF0\x90ݒ肷\x82\xE9
+		ResetConversionLogFont(HVTWin);
+		break;
 	default:
 		break;
 	}
@@ -3305,7 +3331,7 @@
 	return TTCFrameWnd::DefWindowProc(WM_IME_REQUEST,wParam,lParam);
 }
 
-LONG CVTWindow::OnAccelCommand(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnAccelCommand(WPARAM wParam, LPARAM lParam)
 {
 	switch (wParam) {
 		case IdHold:
@@ -3398,7 +3424,7 @@
 	return 0;
 }
 
-LONG CVTWindow::OnChangeMenu(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnChangeMenu(WPARAM wParam, LPARAM lParam)
 {
 	HMENU SysMenu;
 	BOOL Show, B1, B2;
@@ -3439,7 +3465,7 @@
 			             "&Window", ts.UILanguageFile);
 			::InsertMenu(MainMenu,ID_HELPMENU,
 			             MF_STRING | MF_ENABLED | MF_POPUP | MF_BYPOSITION,
-			             (int)WinMenu, ts.UIMsg);
+			             (UINT_PTR)WinMenu, ts.UIMsg);
 		}
 		else {
 			RemoveMenu(MainMenu,ID_HELPMENU,MF_BYPOSITION);
@@ -4160,7 +4186,7 @@
 void CVTWindow::OnCommentToLog()
 {
 	// \x83\x8D\x83O\x83t\x83@\x83C\x83\x8B\x82փR\x83\x81\x83\x93\x83g\x82\xF0\x92lj\xC1\x82\xB7\x82\xE9 (2004.8.6 yutaka)
-	TTDialogBox(hInst, MAKEINTRESOURCE(IDD_COMMENT_DIALOG),
+	TTDialogBox(m_hInst, MAKEINTRESOURCE(IDD_COMMENT_DIALOG),
 				HVTWin, (DLGPROC)OnCommentDlgProc);
 }
 
@@ -4507,7 +4533,7 @@
 
 	SetDialogFont(ts.DialogFontName, ts.DialogFontPoint, ts.DialogFontCharSet,
 				  ts.UILanguageFile, "Tera Term", "DLG_TAHOMA_FONT");
-	CAddSettingPropSheetDlg CAddSetting(hInst, _T("Tera Term: Additional settings"), HVTWin);
+	CAddSettingPropSheetDlg CAddSetting(m_hInst, _T("Tera Term: Additional settings"), HVTWin);
 	ret = CAddSetting.DoModal();
 	switch (ret) {
 		case (DWORD)-1:
@@ -4656,7 +4682,7 @@
 	}
 	cf.lpfnHook = (LPCFHOOKPROC)(&TFontHook);
 	cf.nFontType = REGULAR_FONTTYPE;
-	cf.hInstance = hInst;
+	cf.hInstance = m_hInst;
 	HelpId = HlpSetupFont;
 	result = ChooseFontA(&cf);
 
@@ -5305,7 +5331,7 @@
 //
 void CVTWindow::OnOpenSetupDirectory()
 {
-	TTDialogBox(hInst, MAKEINTRESOURCE(IDD_SETUP_DIR_DIALOG),
+	TTDialogBox(m_hInst, MAKEINTRESOURCE(IDD_SETUP_DIR_DIALOG),
 	            HVTWin, (DLGPROC)OnSetupDirectoryDlgProc);
 }
 
@@ -6010,7 +6036,7 @@
 		goto activate;
 	}
 
-	hDlgWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_BROADCAST_DIALOG),
+	hDlgWnd = CreateDialog(m_hInst, MAKEINTRESOURCE(IDD_BROADCAST_DIALOG),
 	                       HVTWin, (DLGPROC)BroadcastCommandDlgProc);
 
 	if (hDlgWnd == NULL) {
@@ -6032,7 +6058,7 @@
 }
 
 // WM_COPYDATA\x82̎\xF3\x90M
-LONG CVTWindow::OnReceiveIpcMessage(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnReceiveIpcMessage(WPARAM wParam, LPARAM lParam)
 {
 	COPYDATASTRUCT *cds;
 	char *buf, *msg, *name;
@@ -6461,7 +6487,7 @@
 		OnFileTransEnd(wp, lp);
 		break;
 	case WM_USER_GETSERIALNO:
-		OnGetSerialNo(wp, lp);
+		retval = OnGetSerialNo(wp, lp);
 		break;
 	case WM_USER_KEYCODE:
 		OnKeyCode(wp, lp);

Modified: branches/unicode_buf/teraterm/teraterm/vtwin.h
===================================================================
--- branches/unicode_buf/teraterm/teraterm/vtwin.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/teraterm/vtwin.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -73,7 +73,7 @@
 #endif
 
 public:
-	CVTWindow();
+	CVTWindow(HINSTANCE hInstance);
 	int Parse();
 	void ButtonUp(BOOL Paste);
 	void ButtonDown(POINT p, int LMR);
@@ -132,7 +132,7 @@
 //-->
 	LRESULT OnIMEStartComposition(WPARAM wParam, LPARAM lParam);
 	LRESULT OnIMEEndComposition(WPARAM wParam, LPARAM lParam);
-	LRESULT OnIMEComposition(UINT wParam, LONG lParam);
+	LRESULT OnIMEComposition(WPARAM wParam, LPARAM lParam);
 	LRESULT OnIMEInputChange(WPARAM wParam, LPARAM lParam);
 	LRESULT OnIMENotify(WPARAM wParam, LPARAM lParam);
 	LRESULT OnIMERequest(WPARAM wParam, LPARAM lParam);

Modified: branches/unicode_buf/teraterm/ttpcmn/CMakeLists.txt
===================================================================
--- branches/unicode_buf/teraterm/ttpcmn/CMakeLists.txt	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpcmn/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -73,3 +73,9 @@
   setupapi
   delayimp
   )
+
+install(
+  TARGETS ttpcmn
+  RUNTIME
+  DESTINATION .
+  )

Modified: branches/unicode_buf/teraterm/ttpcmn/ttcmn.c
===================================================================
--- branches/unicode_buf/teraterm/ttpcmn/ttcmn.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpcmn/ttcmn.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1031,7 +1031,7 @@
 			Temp[1] = ' ';
 			GetWindowText(Hw,&Temp[2],sizeof(Temp)-3);
 			SendDlgItemMessage(HDlg, IList, LB_ADDSTRING,
-			                   0, (LONG)Temp);
+			                   0, (LPARAM)Temp);
 			if (Hw==HWin) {
 				SendDlgItemMessage(HDlg, IList, LB_SETCURSEL, i,0);
 			}

Modified: branches/unicode_buf/teraterm/ttpdlg/ttdlg.c
===================================================================
--- branches/unicode_buf/teraterm/ttpdlg/ttdlg.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpdlg/ttdlg.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -57,8 +57,6 @@
 #undef EFFECT_ENABLED	// \x83G\x83t\x83F\x83N\x83g\x82̗L\x8C\xF8\x89”\xDB
 #undef TEXTURE_ENABLED	// \x83e\x83N\x83X\x83`\x83\x83\x82̗L\x8C\xF8\x89”\xDB
 
-//#include "compat_w95.h"
-
 #ifdef _DEBUG
 #define calloc(c, s)  _calloc_dbg((c), (s), _NORMAL_BLOCK, __FILE__, __LINE__)
 #define free(p)       _free_dbg((p), _NORMAL_BLOCK)
@@ -75,10 +73,9 @@
 #define EndDialog(p1,p2) \
 	TTEndDialog(p1, p2)
 
-//static HANDLE hInst;
 extern HANDLE hInst;
 
-char UILanguageFile[MAX_PATH];
+static char UILanguageFile[MAX_PATH];
 
 static const char *ProtocolFamilyList[] = { "UNSPEC", "IPv6", "IPv4", NULL };
 static PCHAR NLListRcv[] = {"CR","CR+LF", "LF", "AUTO", NULL};
@@ -270,7 +267,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+					ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 
 					if ( ts!=NULL ) {
 						int width, height;
@@ -683,7 +680,7 @@
 			return TRUE;
 
 		case WM_COMMAND:
-			ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+			ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 			RestoreVar(Dialog,ts,&IAttr,&IOffset);
 			switch (LOWORD(wParam)) {
 				case IDOK:
@@ -935,7 +932,7 @@
 			break;
 
 		case WM_PAINT:
-			ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+			ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 			if ( ts==NULL ) {
 				return TRUE;
 			}
@@ -944,7 +941,7 @@
 			break;
 
 		case WM_HSCROLL:
-			ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+			ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 			if (ts==NULL) {
 				return TRUE;
 			}
@@ -1203,7 +1200,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+					ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 					if ( ts!=NULL ) {
 						memset(Temp, 0, sizeof(Temp));
 						GetDlgItemText(Dialog, IDC_SERIALPORT, Temp, sizeof(Temp)-1);
@@ -1323,7 +1320,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+					ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 					if (ts!=NULL) {
 						WritePrivateProfileString("Hosts",NULL,NULL,ts->SetupFName);
 
@@ -1472,7 +1469,7 @@
 					GetRB(Dialog,&w,IDC_TCPIPTELNET,IDC_TCPIPTELNET);
 					if (w==1) {
 						EnableDlgItem(Dialog,IDC_TCPIPTERMTYPELABEL,IDC_TCPIPTERMTYPE);
-						ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+						ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 						if (ts!=NULL) {
 							SetDlgItemInt(Dialog,IDC_TCPIPPORT,ts->TelPort,FALSE);
 						}
@@ -1623,7 +1620,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					GetHNRec = (PGetHNRec)GetWindowLong(Dialog,DWL_USER);
+					GetHNRec = (PGetHNRec)GetWindowLongPtr(Dialog,DWLP_USER);
 					if ( GetHNRec!=NULL ) {
 						char afstr[BUFSIZ];
 						GetRB(Dialog,&GetHNRec->PortType,IDC_HOSTTCPIP,IDC_HOSTSERIAL);
@@ -1684,7 +1681,7 @@
 				case IDC_HOSTTELNET:
 					GetRB(Dialog,&i,IDC_HOSTTELNET,IDC_HOSTTELNET);
 					if ( i==1 ) {
-						GetHNRec = (PGetHNRec)GetWindowLong(Dialog,DWL_USER);
+						GetHNRec = (PGetHNRec)GetWindowLongPtr(Dialog,DWLP_USER);
 						if ( GetHNRec!=NULL ) {
 							SetDlgItemInt(Dialog,IDC_HOSTTCPPORT,GetHNRec->TelPort,FALSE);
 						}
@@ -1830,13 +1827,16 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					CurDir = (PCHAR)GetWindowLong(Dialog,DWL_USER);
+					CurDir = (PCHAR)GetWindowLongPtr(Dialog,DWLP_USER);
 					if ( CurDir!=NULL ) {
+						char FileDirExpanded[MAX_PATH];
 						_getcwd(HomeDir,sizeof(HomeDir));
-						_chdir(CurDir);
+						ExpandEnvironmentStrings(CurDir, FileDirExpanded, sizeof(FileDirExpanded));
+						_chdir(FileDirExpanded);
 						GetDlgItemText(Dialog, IDC_DIRNEW, TmpDir, sizeof(TmpDir));
 						if ( strlen(TmpDir)>0 ) {
-							if (_chdir(TmpDir) != 0) {
+							ExpandEnvironmentStrings(TmpDir, FileDirExpanded, sizeof(FileDirExpanded));
+							if (_chdir(FileDirExpanded) != 0) {
 								get_lang_msg("MSG_TT_ERROR", uimsg2, sizeof(uimsg2), "Tera Term: Error", UILanguageFile);
 								get_lang_msg("MSG_FIND_DIR_ERROR", uimsg, sizeof(uimsg), "Cannot find directory", UILanguageFile);
 								MessageBox(Dialog,uimsg,uimsg2,MB_ICONEXCLAMATION);
@@ -1843,7 +1843,7 @@
 								_chdir(HomeDir);
 								return TRUE;
 							}
-							_getcwd(CurDir,MAXPATHLEN);
+							strncpy_s(CurDir, MAXPATHLEN, TmpDir, _TRUNCATE);
 						}
 						_chdir(HomeDir);
 					}
@@ -1857,9 +1857,13 @@
 				case IDC_SELECT_DIR:
 					get_lang_msg("DLG_SELECT_DIR_TITLE", uimsg, sizeof(uimsg),
 					             "Select new directory", UILanguageFile);
-					GetDlgItemText(Dialog, IDC_DIRNEW, buf, sizeof(buf));
-					if (doSelectFolder(Dialog, buf2, sizeof(buf2), buf, uimsg)) {
-						SetDlgItemText(Dialog, IDC_DIRNEW, buf2);
+					{
+						char FileDirExpanded[MAX_PATH];
+						GetDlgItemText(Dialog, IDC_DIRNEW, buf, sizeof(buf));
+						ExpandEnvironmentStrings(buf, FileDirExpanded, sizeof(FileDirExpanded));
+						if (doSelectFolder(Dialog, buf2, sizeof(buf2), FileDirExpanded, uimsg)) {
+							SetDlgItemText(Dialog, IDC_DIRNEW, buf2);
+						}
 					}
 					return TRUE;
 
@@ -2552,7 +2556,7 @@
 	return (n + 1);  // 1origin
 }
 
-static BOOL CALLBACK GenDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK GenDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam)
 {
 	static const DlgTextInfo TextInfos[] = {
 		{ 0, "DLG_GEN_TITLE" },
@@ -2615,7 +2619,7 @@
 		case WM_COMMAND:
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLong(Dialog,DWL_USER);
+					ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 					if (ts!=NULL) {
 						w = (WORD)GetCurSel(Dialog, IDC_GENPORT);
 						if (w>1) {
@@ -2680,7 +2684,7 @@
 	return FALSE;
 }
 
-static BOOL CALLBACK WinListDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK WinListDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam)
 {
 	static const DlgTextInfo TextInfos[] = {
 		{ 0, "DLG_WINLIST_TITLE" },
@@ -2745,7 +2749,7 @@
 						PostMessage(Hw,WM_SYSCOMMAND,SC_CLOSE,0);
 					}
 					else {
-						Close = (PBOOL)GetWindowLong(Dialog,DWL_USER);
+						Close = (PBOOL)GetWindowLongPtr(Dialog,DWLP_USER);
 						if (Close!=NULL) {
 							*Close = TRUE;
 						}
@@ -2917,7 +2921,7 @@
 	return
 		(BOOL)DialogBoxParam(hInst,
 		                     MAKEINTRESOURCE(IDD_GENDLG),
-		                     WndParent, (DLGPROC)&GenDlg, (LPARAM)ts);
+		                     WndParent, GenDlg, (LPARAM)ts);
 }
 
 BOOL WINAPI _WindowWindow(HWND WndParent, PBOOL Close)
@@ -2927,7 +2931,7 @@
 		(BOOL)DialogBoxParam(hInst,
 		                     MAKEINTRESOURCE(IDD_WINLISTDLG),
 		                     WndParent,
-		                     (DLGPROC)&WinListDlg, (LPARAM)Close);
+							 WinListDlg, (LPARAM)Close);
 }
 
 BOOL WINAPI _TTDLGSetUILanguageFile(char *file)
@@ -2935,28 +2939,3 @@
 	strncpy_s(UILanguageFile, sizeof(UILanguageFile), file, _TRUNCATE);
 	return TRUE;
 }
-
-#if 0
-BOOL WINAPI DllMain(HANDLE hInstance,
-                    ULONG ul_reason_for_call,
-                    LPVOID lpReserved)
-{
-	hInst = hInstance;
-	switch (ul_reason_for_call) {
-		case DLL_THREAD_ATTACH:
-			/* do thread initialization */
-			break;
-		case DLL_THREAD_DETACH:
-			/* do thread cleanup */
-			break;
-		case DLL_PROCESS_ATTACH:
-			/* do process initialization */
-			DoCover_IsDebuggerPresent();
-			break;
-		case DLL_PROCESS_DETACH:
-			/* do process cleanup */
-			break;
-	}
-	return TRUE;
-}
-#endif

Modified: branches/unicode_buf/teraterm/ttpfile/CMakeLists.txt
===================================================================
--- branches/unicode_buf/teraterm/ttpfile/CMakeLists.txt	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpfile/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -71,3 +71,9 @@
   ttpfile
   ttpcmn
   )
+
+install(
+  TARGETS ttpfile
+  RUNTIME
+  DESTINATION .
+  )

Modified: branches/unicode_buf/teraterm/ttpfile/ttfile.c
===================================================================
--- branches/unicode_buf/teraterm/ttpfile/ttfile.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpfile/ttfile.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2005-2017 TeraTerm Project
+ * (C) 2005-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -184,7 +184,7 @@
 	WORD BinFlag, val;
 	long opt = 0;
 
-	pl = (LPLONG)GetWindowLong(Dialog, DWL_USER);
+	pl = (LPLONG)GetWindowLongPtr(Dialog, DWLP_USER);
 	if (pl) {
 		GetRB(Dialog, &BinFlag, IDC_FOPTBIN, IDC_FOPTBIN);
 		if (BinFlag) {
@@ -266,7 +266,7 @@
 		ofn = (LPOPENFILENAME)lParam;
 		pl = (LPLONG)(ofn->lCustData);
 		opt = *pl;
-		SetWindowLong(Dialog, DWL_USER, (LONG)pl);
+		SetWindowLongPtr(Dialog, DWLP_USER, (LONG_PTR)pl);
 
 		font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
 		GetObject(font, sizeof(LOGFONT), &logfont);
@@ -526,7 +526,7 @@
 
 		ofn.lpfnHook = (LPOFNHOOKPROC)(&LogFnHook);
 		optl = *Option;
-		ofn.lCustData = (DWORD)&optl;
+		ofn.lCustData = (LPARAM)&optl;
 		break;
 	case GTF_SEND:
 		ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
@@ -535,7 +535,7 @@
 
 		ofn.lpfnHook = (LPOFNHOOKPROC)(&TransFnHook);
 		optw = (WORD)*Option;
-		ofn.lCustData = (DWORD)&optw;
+		ofn.lCustData = (LPARAM)&optw;
 		break;
 	case GTF_BP:
 		ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
@@ -600,7 +600,7 @@
 	case WM_INITDIALOG:
 		ofn = (LPOPENFILENAME)lParam;
 		pw = (LPWORD)ofn->lCustData;
-		SetWindowLong(Dialog, DWL_USER, (LONG)pw);
+		SetWindowLongPtr(Dialog, DWLP_USER, (LONG_PTR)pw);
 
 		font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
 		GetObject(font, sizeof(LOGFONT), &logfont);
@@ -630,7 +630,7 @@
 	case WM_COMMAND: // for old style dialog
 		switch (LOWORD(wParam)) {
 		case IDOK:
-			pw = (LPWORD)GetWindowLong(Dialog,DWL_USER);
+			pw = (LPWORD)GetWindowLongPtr(Dialog,DWLP_USER);
 			if (pw!=NULL)
 				GetRB(Dialog,pw,IDC_FOPTBIN,IDC_FOPTBIN);
 			if (DlgFoptFont != NULL) {
@@ -648,7 +648,7 @@
 		notify = (LPOFNOTIFY)lParam;
 		switch (notify->hdr.code) {
 		case CDN_FILEOK:
-			pw = (LPWORD)GetWindowLong(Dialog,DWL_USER);
+			pw = (LPWORD)GetWindowLongPtr(Dialog,DWLP_USER);
 			if (pw!=NULL)
 				GetRB(Dialog,pw,IDC_FOPTBIN,IDC_FOPTBIN);
 			if (DlgFoptFont != NULL) {
@@ -743,7 +743,7 @@
 	ofn.lCustData = 0;
 	if (FuncId==GMF_Z) {
 		ofn.Flags |= OFN_ENABLETEMPLATE | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLESIZING;
-		ofn.lCustData = (DWORD)Option;
+		ofn.lCustData = (LPARAM)Option;
 		ofn.lpfnHook = (LPOFNHOOKPROC)(&TransFnHook);
 		ofn.lpTemplateName = MAKEINTRESOURCE(IDD_FOPT);
 	} else if (FuncId==GMF_Y) {
@@ -813,7 +813,7 @@
 	return Ok;
 }
 
-static BOOL CALLBACK GetFnDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK GetFnDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam)
 {
 	PFileVar fv;
 	char TempFull[MAX_PATH];
@@ -825,7 +825,7 @@
 	switch (Message) {
 	case WM_INITDIALOG:
 		fv = (PFileVar)lParam;
-		SetWindowLong(Dialog, DWL_USER, lParam);
+		SetWindowLongPtr(Dialog, DWLP_USER, lParam);
 		SendDlgItemMessage(Dialog, IDC_GETFN, EM_LIMITTEXT, sizeof(TempFull)-1,0);
 
 		font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
@@ -860,7 +860,7 @@
 		return TRUE;
 
 	case WM_COMMAND:
-		fv = (PFileVar)GetWindowLong(Dialog,DWL_USER);
+		fv = (PFileVar)GetWindowLongPtr(Dialog,DWLP_USER);
 		switch (LOWORD(wParam)) {
 		case IDOK:
 			if (fv!=NULL) {
@@ -894,7 +894,7 @@
 {
 	return (BOOL)DialogBoxParam(hInst,
 	                            MAKEINTRESOURCE(IDD_GETFNDLG),
-	                            HWin, GetFnDlg, (LONG)fv);
+	                            HWin, GetFnDlg, (LPARAM)fv);
 }
 
 void WINAPI SetFileVar(PFileVar fv)
@@ -990,7 +990,7 @@
 	case WM_INITDIALOG:
 		ofn = (LPOPENFILENAME)lParam;
 		pl = (LPLONG)ofn->lCustData;
-		SetWindowLong(Dialog, DWL_USER, (LONG)pl);
+		SetWindowLongPtr(Dialog, DWLP_USER, (LONG_PTR)pl);
 
 		font = (HFONT)SendMessage(Dialog, WM_GETFONT, 0, 0);
 		GetObject(font, sizeof(LOGFONT), &logfont);
@@ -1048,7 +1048,7 @@
 	case WM_COMMAND: // for old style dialog
 		switch (LOWORD(wParam)) {
 		case IDOK:
-			pl = (LPLONG)GetWindowLong(Dialog,DWL_USER);
+			pl = (LPLONG)GetWindowLongPtr(Dialog,DWLP_USER);
 			if (pl!=NULL)
 			{
 				if (LOWORD(*pl)==0xFFFF) { // Send
@@ -1083,7 +1083,7 @@
 		notify = (LPOFNOTIFY)lParam;
 		switch (notify->hdr.code) {
 		case CDN_FILEOK:
-			pl = (LPLONG)GetWindowLong(Dialog,DWL_USER);
+			pl = (LPLONG)GetWindowLongPtr(Dialog,DWLP_USER);
 			if (pl!=NULL) {
 				if (LOWORD(*pl) == 0xFFFF) { // Send
 					Lo = 0xFFFF;
@@ -1182,7 +1182,7 @@
 	}
 	ofn.Flags |= OFN_ENABLETEMPLATE | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLESIZING;
 	ofn.Flags |= OFN_SHOWHELP;
-	ofn.lCustData = (DWORD)&opt;
+	ofn.lCustData = (LPARAM)&opt;
 	ofn.lpstrTitle = fv->DlgCaption;
 	ofn.lpfnHook = (LPOFNHOOKPROC)(&XFnHook);
 	ofn.lpTemplateName = MAKEINTRESOURCE(IDD_XOPT);

Modified: branches/unicode_buf/teraterm/ttpmacro/CMakeLists.txt
===================================================================
--- branches/unicode_buf/teraterm/ttpmacro/CMakeLists.txt	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpmacro/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -128,3 +128,8 @@
   ttpmacro
   ttpcmn
   )
+
+install(
+  TARGETS ttpmacro
+  DESTINATION .
+  )

Modified: branches/unicode_buf/teraterm/ttpmacro/ListDlg.cpp
===================================================================
--- branches/unicode_buf/teraterm/ttpmacro/ListDlg.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpmacro/ListDlg.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -43,7 +43,7 @@
 
 // CListDlg \x83_\x83C\x83A\x83\x8D\x83O
 
-CListDlg::CListDlg(PCHAR Text, PCHAR Caption, CHAR **Lists, int Selected, int x, int y)
+CListDlg::CListDlg(const PCHAR Text, const PCHAR Caption, const CHAR **Lists, int Selected, int x, int y)
 {
 	m_Text = Text;
 	m_Caption = Caption;
@@ -60,24 +60,14 @@
 	return TTCDialog::DoModal(hInst, hWndParent, IDD);
 }
 
-BOOL CListDlg::OnInitDialog()
+void CListDlg::InitList(HWND HList)
 {
-	static const DlgTextInfo TextInfos[] = {
-		{ IDOK, "BTN_YES" },
-		{ IDCANCEL, "BTN_CANCEL" },
-	};
-	char **p;
+	const char **p;
 	int ListMaxWidth = 0;
 	int ListCount = 0;
-	HDC DC;
-	RECT R;
-	HWND HList, HOk;
-
-	SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), UILanguageFile);
-
-	HList = ::GetDlgItem(m_hWnd, IDC_LISTBOX);
-	DC = ::GetDC(HList);	// \x83\x8A\x83X\x83g\x83{\x83b\x83N\x83X\x82\xF0\x89\xA1\x83X\x83N\x83\x8D\x81[\x83\x8B\x82ł\xAB\x82\xE9\x82悤\x82ɍő啝\x82\xF0\x8E擾
-
+	HDC DC = ::GetDC(HList);
+	HFONT hFontList = (HFONT)::SendMessage(HList,WM_GETFONT,0,0);
+	HFONT hOldFont = (HFONT)SelectObject(DC,hFontList);
 	p = m_Lists;
 	while (*p) {
 		SIZE size;
@@ -93,6 +83,7 @@
 	}
 
 	SendDlgItemMessage(IDC_LISTBOX, LB_SETHORIZONTALEXTENT, (ListMaxWidth + 5), 0);
+	SelectObject(DC,hOldFont);
 	::ReleaseDC(HList, DC);
 
 	if (m_Selected < 0 || m_Selected >= ListCount) {
@@ -99,7 +90,22 @@
 		m_Selected = 0;
 	}
 	SetCurSel(IDC_LISTBOX, m_Selected);
+}
 
+BOOL CListDlg::OnInitDialog()
+{
+	static const DlgTextInfo TextInfos[] = {
+		{ IDOK, "BTN_YES" },
+		{ IDCANCEL, "BTN_CANCEL" },
+	};
+	RECT R;
+	HWND HList, HOk;
+
+	SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), UILanguageFile);
+
+	HList = ::GetDlgItem(m_hWnd, IDC_LISTBOX);
+	InitList(HList);
+
 	// \x96{\x95\xB6\x82ƃ^\x83C\x83g\x83\x8B
 	SetDlgItemText(IDC_LISTTEXT, m_Text);
 	SetWindowText(m_Caption);
@@ -138,8 +144,6 @@
 	return TTCDialog::OnCancel();
 }
 
-//int MessageBoxHaltScript(HWND hWnd);
-
 BOOL CListDlg::OnClose()
 {
 	int ret = MessageBoxHaltScript(m_hWnd);
@@ -152,14 +156,18 @@
 void CListDlg::Relocation(BOOL is_init, int new_WW)
 {
 	RECT R;
-	HDC TmpDC;
 	HWND HText, HOk, HCancel, HList;
 	int CW, CH;
+	int NonClientAreaWidth;
+	int NonClientAreaHeight;
 
 	::GetClientRect(m_hWnd, &R);
 	CW = R.right-R.left;
 	CH = R.bottom-R.top;
-#define CONTROL_GAP_W	14
+	NonClientAreaWidth = WW - CW;
+	NonClientAreaHeight = WH - CH;
+
+#define CONTROL_GAP_W	14		// \x83E\x83B\x83\x93\x83h\x83E\x92[\x82ƃR\x83\x93\x83g\x83\x8D\x81[\x83\x8B\x8AԂƂ̕\x9D
 	// \x8F\x89\x89\xF1\x82̂\xDD
 	if (is_init) {
 		// \x83e\x83L\x83X\x83g\x83R\x83\x93\x83g\x83\x8D\x81[\x83\x8B\x83T\x83C\x83Y\x82\xF0\x95␳
@@ -167,8 +175,9 @@
 			TW = CW;
 		}
 		// \x83E\x83C\x83\x93\x83h\x83E\x83T\x83C\x83Y\x82̌v\x8EZ
-		WW = TW + (WW - CW);
-		WH = TH + LH + (int)(BH*1.5) + (WH - CH);
+		WW = TW + NonClientAreaWidth;
+		CW = WW - NonClientAreaWidth;
+		WH = TH + LH + (int)(BH*1.5) + NonClientAreaHeight;		// (\x83{\x83^\x83\x93\x82̍\x82\x82\xB3/2) \x82\xAA\x83E\x83B\x83\x93\x83h\x83E\x92[\x82ƃR\x83\x93\x83g\x83\x8D\x81[\x83\x8B\x8AԂƂ̍\x82\x82\xB3
 		init_WW = WW;
 		// \x83\x8A\x83X\x83g\x83{\x83b\x83N\x83X\x83T\x83C\x83Y\x82̌v\x8EZ
 		if (LW < CW - BW - CONTROL_GAP_W * 3) {
@@ -190,15 +199,21 @@
 	::MoveWindow(HOk,CONTROL_GAP_W+CONTROL_GAP_W+LW,BH/2,BW,BH,TRUE);
 	::MoveWindow(HCancel,CONTROL_GAP_W+CONTROL_GAP_W+LW,BH*2,BW,BH,TRUE);
 
+	// PosX\x82\xAA\x83f\x83B\x83X\x83v\x83\x8C\x83C\x82̊O\x82\xCC-100\x88ȉ\xBA\x82̈ʒu\x82ɂ\xA0\x82\xE9\x8Fꍇ
 	if (PosX<=GetMonitorLeftmost(PosX, PosY)-100) {
-		::GetWindowRect(m_hWnd, &R);
-		TmpDC = ::GetDC(GetSafeHwnd());
-		PosX = (GetDeviceCaps(TmpDC,HORZRES)-R.right+R.left) / 2;
-		PosY = (GetDeviceCaps(TmpDC,VERTRES)-R.bottom+R.top) / 2;
-		::ReleaseDC(GetSafeHwnd(),TmpDC);
+		// \x83E\x83B\x83\x93\x83h\x83E\x83T\x83C\x83Y\x82\xF0\x83Z\x83b\x83g
+		::SetWindowPos(m_hWnd, HWND_TOP,0,0,WW,WH,SWP_NOMOVE);
+		// \x92\x86\x89\x9B\x82Ɉړ\xAE\x82\xB7\x82\xE9
+		CenterWindow(m_hWnd, NULL);
+		// \x88ʒu\x82\xF0\x95ۑ\xB6
+		RECT rcWnd;
+		GetWindowRect(&rcWnd);
+		PosX = rcWnd.left;
+		PosY = rcWnd.top;
+	} else {
+		// \x83E\x83B\x83\x93\x83h\x83E\x83T\x83C\x83Y\x82\xF0\x83Z\x83b\x83g + \x8Ew\x92\xE8\x88ʒu\x82ֈړ\xAE
+		::SetWindowPos(m_hWnd, HWND_TOP,PosX,PosY,WW,WH, 0);
 	}
-	::SetWindowPos(m_hWnd, HWND_TOP,PosX,PosY,WW,WH,0);
 
 	::InvalidateRect(m_hWnd, NULL, TRUE);
 }
-

Modified: branches/unicode_buf/teraterm/ttpmacro/ListDlg.h
===================================================================
--- branches/unicode_buf/teraterm/ttpmacro/ListDlg.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpmacro/ListDlg.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -31,7 +31,7 @@
 class CListDlg : public TTCDialog
 {
 public:
-	CListDlg(PCHAR Text, PCHAR Caption, CHAR **Lists, int Selected, int x, int y);
+	CListDlg(PCHAR Text, PCHAR Caption, const CHAR **Lists, int Selected, int x, int y);
 	INT_PTR DoModal();
 	int m_SelectItem;
 
@@ -39,12 +39,13 @@
 	enum { IDD = IDD_LISTDLG };
 	PCHAR m_Text;
 	PCHAR m_Caption;
-	CHAR **m_Lists;
+	const CHAR **m_Lists;
 	int m_Selected;
 	int PosX, PosY, init_WW, WW, WH, TW, TH, BH, BW, LW, LH;
 	SIZE s;
 
 	void Relocation(BOOL is_init, int WW);
+	void InitList(HWND HList);
 
 	virtual BOOL OnInitDialog();
 	virtual BOOL OnOK();

Modified: branches/unicode_buf/teraterm/ttpmacro/ttl.c
===================================================================
--- branches/unicode_buf/teraterm/ttpmacro/ttl.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpmacro/ttl.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1405,6 +1405,7 @@
 {
 	WORD Err;
 	TStrVal FName1, FName2;
+	BOOL ret;
 
 	Err = 0;
 	GetStrVal(FName1,&Err);
@@ -1427,9 +1428,17 @@
 		SetResult(-2);
 		return Err;
 	}
-	if (_stricmp(FName1,FName2)==0) return Err;
+	if (_stricmp(FName1, FName2) == 0) {
+		SetResult(-3);
+		return Err;
+	}
 
-	CopyFile(FName1,FName2,FALSE);
+	ret = CopyFile(FName1, FName2, FALSE);
+	if (ret == 0) {
+		SetResult(-4);
+		return Err;
+	}
+
 	SetResult(0);
 	return Err;
 }
@@ -1622,13 +1631,13 @@
 	}
 	if (FH == INVALID_HANDLE_VALUE) {
 		SetIntVal(VarId, -1);
-		return ErrCantOpen;
+		return Err;
 	}
 	fhi = HandlePut(FH);
 	if (fhi == -1) {
 		SetIntVal(VarId, -1);
 		_lclose(FH);
-		return ErrCantOpen;
+		return Err;
 	}
 	SetIntVal(VarId, fhi);
 	if (Append!=0) {
@@ -1642,7 +1651,8 @@
 WORD TTLFileLock()
 {
 	WORD Err;
-	int FH;
+	HANDLE FH;
+	int fhi;
 	DWORD timeout;
 	int result;
 	BOOL ret;
@@ -1649,7 +1659,8 @@
 	DWORD dwStart;
 
 	Err = 0;
-	GetIntVal(&FH,&Err);
+	GetIntVal(&fhi,&Err);
+	FH = HandleGet(fhi);
 	if (Err!=0) return Err;
 
 	timeout = -1;  // \x96\xB3\x8C\xC0\x91\xE5
@@ -1661,7 +1672,7 @@
 	result = 1;  // error
 	dwStart = GetTickCount();
 	do {
-		ret = LockFile((HANDLE)FH, 0, 0, (DWORD)-1, (DWORD)-1);
+		ret = LockFile(FH, 0, 0, (DWORD)-1, (DWORD)-1);
 		if (ret != 0) { // \x83\x8D\x83b\x83N\x90\xAC\x8C\xF7
 			result = 0;  // success
 			break;
@@ -1678,16 +1689,18 @@
 WORD TTLFileUnLock()
 {
 	WORD Err;
-	int FH;
+	HANDLE FH;
+	int fhi;
 	BOOL ret;
 
 	Err = 0;
-	GetIntVal(&FH,&Err);
+	GetIntVal(&fhi,&Err);
+	FH = HandleGet(fhi);
 	if ((Err==0) && (GetFirstChar()!=0))
 		Err = ErrSyntax;
 	if (Err!=0) return Err;
 
-	ret = UnlockFile((HANDLE)FH, 0, 0, (DWORD)-1, (DWORD)-1);
+	ret = UnlockFile(FH, 0, 0, (DWORD)-1, (DWORD)-1);
 	if (ret != 0) { // \x83A\x83\x93\x83\x8D\x83b\x83N\x90\xAC\x8C\xF7
 		SetResult(0);
 	} else {
@@ -2044,7 +2057,7 @@
 		// \x83t\x83@\x83C\x83\x8B\x82\xCC1\x83o\x83C\x83g\x96ڂ\xAA\x83q\x83b\x83g\x82\xB7\x82\xE9\x82ƁA\x83t\x83@\x83C\x83\x8B\x83|\x83C\x83\x93\x83^\x82\xAA\x93˂\xAB\x94j\x82\xC1\x82\xC4
 		// INVALID_SET_FILE_POINTER \x82ɂȂ\xE9\x82̂ŁA
 		// \x83[\x83\x8D\x83I\x83t\x83Z\x83b\x83g\x82ɂȂ\xE9\x82悤\x82ɒ\xB2\x90\xAE\x82\xB7\x82\xE9\x81B(2008.10.10 yutaka)
-		if (pos == INVALID_SET_FILE_POINTER) 
+		if (pos2 == INVALID_SET_FILE_POINTER)
 			_llseek(FH, 0, 0);
 		SetResult(1);
 	} else {
@@ -2083,16 +2096,14 @@
 	}
 
 	// \x83t\x83@\x83C\x83\x8B\x82\xF0\x8Ew\x92肵\x82\xBD\x83T\x83C\x83Y\x82Ő؂\xE8\x8Bl\x82߂\xE9\x81B
-   ret = _sopen_s( &fh, FName, _O_RDWR | _O_CREAT, _SH_DENYNO, _S_IREAD | _S_IWRITE );
-   if (ret != 0) {
-		Err = ErrCantOpen;
+	ret = _sopen_s( &fh, FName, _O_RDWR | _O_CREAT, _SH_DENYNO, _S_IREAD | _S_IWRITE );
+	if (ret != 0) {
 		goto end;
-   }
-   ret = _chsize_s(fh, TruncByte);
-   if (ret != 0) {
-		Err = ErrInvalidCtl;
+	}
+	ret = _chsize_s(fh, TruncByte);
+	if (ret != 0) {
 		goto end;
-   }
+	}
 
 	result = 0;
 	Err = 0;

Modified: branches/unicode_buf/teraterm/ttpmacro/ttmdlg.cpp
===================================================================
--- branches/unicode_buf/teraterm/ttpmacro/ttmdlg.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpmacro/ttmdlg.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -278,7 +278,7 @@
  * @retval -1		cancel\x83{\x83^\x83\x93
  * @retval -2		close\x83{\x83^\x83\x93
  */
-int OpenListDlg(PCHAR Text, PCHAR Caption, CHAR **Lists, int Selected)
+int OpenListDlg(PCHAR Text, PCHAR Caption, const CHAR **Lists, int Selected)
 {
 	CListDlg ListDlg(Text, Caption, Lists, Selected, DlgPosX, DlgPosY);
 	INT_PTR r = ListDlg.DoModal();

Modified: branches/unicode_buf/teraterm/ttpmacro/ttmdlg.h
===================================================================
--- branches/unicode_buf/teraterm/ttpmacro/ttmdlg.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpmacro/ttmdlg.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -48,7 +48,7 @@
 void CloseStatDlg();
 void BringupStatDlg();
 
-int OpenListDlg(PCHAR Text, PCHAR Caption, CHAR **Lists, int Selected);
+int OpenListDlg(const PCHAR Text, const PCHAR Caption, const CHAR **Lists, int Selected);
 
 extern char HomeDir[MAX_PATH];
 extern char FileName[MAX_PATH];

Modified: branches/unicode_buf/teraterm/ttpmacro/ttmmain.cpp
===================================================================
--- branches/unicode_buf/teraterm/ttpmacro/ttmmain.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpmacro/ttmmain.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2005-2017 TeraTerm Project
+ * (C) 2005-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -459,7 +459,7 @@
 	if (::IsIconic(m_hWnd)) {
 		int OldMapMode = GetMapMode(dc);
 		SetMapMode(dc, MM_TEXT);
-		SendMessage(WM_ICONERASEBKGND,(UINT)dc, 0);	// TODO
+		SendMessage(WM_ICONERASEBKGND,(WPARAM)dc, 0);	// TODO
 		DrawIcon(dc, 0, 0, m_hIcon);
 		SetMapMode(dc, OldMapMode);
 	}

Modified: branches/unicode_buf/teraterm/ttpmacro/wait4all.c
===================================================================
--- branches/unicode_buf/teraterm/ttpmacro/wait4all.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpmacro/wait4all.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009-2017 TeraTerm Project
+ * Copyright (C) 2009-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -79,7 +79,7 @@
 static int open_macro_shmem(void)
 {
 	HMap = CreateFileMapping(
-		(HANDLE) 0xFFFFFFFF, NULL, PAGE_READWRITE,
+		INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
 		0, sizeof(TMacroShmem), TTM_FILEMAPNAME);
 	if (HMap == NULL)
 		return FALSE;

Modified: branches/unicode_buf/teraterm/ttpset/CMakeLists.txt
===================================================================
--- branches/unicode_buf/teraterm/ttpset/CMakeLists.txt	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpset/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -50,3 +50,9 @@
   ttpset
   ttpcmn
   )
+
+install(
+  TARGETS ttpset
+  RUNTIME
+  DESTINATION .
+  )

Modified: branches/unicode_buf/teraterm/ttpset/ttset.c
===================================================================
--- branches/unicode_buf/teraterm/ttpset/ttset.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttpset/ttset.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1190,8 +1190,10 @@
 	if (strlen(ts->FileDir) == 0)
 		GetDownloadFolder(ts->FileDir, sizeof(ts->FileDir));
 	else {
+		char FileDirExpanded[MAX_PATH];
+		ExpandEnvironmentStrings(ts->FileDir, FileDirExpanded, sizeof(FileDirExpanded));
 		_getcwd(Temp, sizeof(Temp));
-		if (_chdir(ts->FileDir) != 0)
+		if (_chdir(FileDirExpanded) != 0)
 			GetDownloadFolder(ts->FileDir, sizeof(ts->FileDir));
 		_chdir(Temp);
 	}

Modified: branches/unicode_buf/teraterm/ttptek/CMakeLists.txt
===================================================================
--- branches/unicode_buf/teraterm/ttptek/CMakeLists.txt	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/teraterm/ttptek/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -68,3 +68,9 @@
   ttptek
   ttpcmn
   )
+
+install(
+  TARGETS ttptek
+  RUNTIME
+  DESTINATION .
+  )

Added: branches/unicode_buf/tests/#39452.ttl
===================================================================
--- branches/unicode_buf/tests/#39452.ttl	                        (rev 0)
+++ branches/unicode_buf/tests/#39452.ttl	2019-08-20 14:35:14 UTC (rev 7998)
@@ -0,0 +1,21 @@
+filetruncate '#39452-1:.txt'
+messagebox result 'invalid file name'
+
+filetruncate '#39452-1.txt' 'string'
+messagebox result 'invalid file size'
+
+; file is not exist
+filetruncate '#39452-1.txt' 10
+messagebox result 'success'
+
+; invalid file path
+filetruncate 'aa:\#39452-1.txt' 10
+messagebox result 'invalid file path'
+
+; file is exist but cannot open with write mode
+filecreate fp '#39452-1.txt'
+filetruncate '#39452-1.txt' 10
+messagebox result 'cannot open with write mode'
+fileclose fp
+
+filedelete '#39452-1.txt'

Modified: branches/unicode_buf/tests/gui_commands_test.ttl
===================================================================
--- branches/unicode_buf/tests/gui_commands_test.ttl	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/tests/gui_commands_test.ttl	2019-08-20 14:35:14 UTC (rev 7998)
@@ -9,7 +9,10 @@
 call test_passwordbox
 call test_statusbox
 call test_macrodialogbox
+type = 1
 call test_listbox
+type = 2
+call test_listbox
 messagebox "finish all tests" "test"
 end
 
@@ -200,9 +203,11 @@
 ;;;		messagebox
 :test_listbox
 N = 7
-intdim done N
-strdim strs N
-strdim srcs N
+if type == 1 then
+   intdim done N
+   strdim strs N
+   strdim srcs N
+endif
 for i 0 N-1
 	done[i] = 0
 next
@@ -234,6 +239,11 @@
 	else
 		msg = "push `cancel`"
 	endif
+	if type == 2 then
+		strconcat msg "==================================================================================================="
+		strconcat msg "\n=\n=\n"
+		strspecial msg
+	endif
 	listbox msg "test listbox" strs prev
 	if result < 0 then
 		done_cancel = 1

Modified: branches/unicode_buf/ttpmenu/CMakeLists.txt
===================================================================
--- branches/unicode_buf/ttpmenu/CMakeLists.txt	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/ttpmenu/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -51,4 +51,7 @@
   comdlg32
   )
 
-
+install(
+  TARGETS ttpmenu
+  DESTINATION .
+  )

Modified: branches/unicode_buf/ttpmenu/ttpmenu.cpp
===================================================================
--- branches/unicode_buf/ttpmenu/ttpmenu.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/ttpmenu/ttpmenu.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -317,7 +317,7 @@
 	ti.cbSize	= sizeof(TOOLINFO);
 	ti.uFlags	= TTF_IDISHWND; 
 	ti.hwnd		= g_hWndMenu; 
-	ti.uId		= (UINT) ::GetDlgItem(g_hWndMenu, idControl); 
+	ti.uId		= (UINT_PTR)::GetDlgItem(g_hWndMenu, idControl); 
 	ti.hinst	= 0; 
 	ti.lpszText	= LPSTR_TEXTCALLBACK;
 
@@ -656,9 +656,9 @@
 {
 	HWND passwordControl = GetDlgItem(dlg, item);
 
-	SetWindowLong(passwordControl, GWL_USERDATA,
-	              SetWindowLong(passwordControl, GWL_WNDPROC,
-	                            (LONG) password_wnd_proc));
+	SetWindowLongPtr(passwordControl, GWLP_USERDATA,
+					 SetWindowLongPtr(passwordControl, GWLP_WNDPROC,
+									  (LONG_PTR) password_wnd_proc));
 }
 
 /* ==========================================================================
@@ -1416,7 +1416,7 @@
 		ModifyMenu(g_hConfigMenu, ID_HOTKEY, MF_BYCOMMAND, ID_HOTKEY, uimsg);
 
 		UTIL_get_lang_msg("MENU_EXEC", uimsg, sizeof(uimsg), "Execute", UILanguageFile);
-		::ModifyMenu(g_hSubMenu, ID_EXEC, MF_BYCOMMAND | MF_POPUP, (UINT) g_hListMenu, (LPCTSTR) uimsg);
+		::ModifyMenu(g_hSubMenu, ID_EXEC, MF_BYCOMMAND | MF_POPUP, (UINT_PTR)g_hListMenu, (LPCTSTR) uimsg);
 	}
 
 	return TRUE;
@@ -2350,7 +2350,7 @@
 	Attention		: 
 	Up Date			: 
    ======1=========2=========3=========4=========5=========6=========7======= */
-BOOL CALLBACK DlgCallBack_Config(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgCallBack_Config(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
 	TEXTMETRIC			textMetric;
 	PDRAWITEMSTRUCT		lpdis;
@@ -2437,7 +2437,7 @@
 	Attention		: 
 	Up Date			: 
    ======1=========2=========3=========4=========5=========6=========7======= */
-BOOL CALLBACK DlgCallBack_Etc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgCallBack_Etc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
 	switch(uMsg) {
 	case WM_INITDIALOG:
@@ -2464,7 +2464,7 @@
 	Attention		: 
 	Up Date			: 
    ======1=========2=========3=========4=========5=========6=========7======= */
-BOOL CALLBACK DlgCallBack_Version(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK DlgCallBack_Version(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
 	switch(uMsg) {
 	case WM_INITDIALOG:

Modified: branches/unicode_buf/ttpmenu/ttpmenu.h
===================================================================
--- branches/unicode_buf/ttpmenu/ttpmenu.h	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/ttpmenu/ttpmenu.h	2019-08-20 14:35:14 UTC (rev 7998)
@@ -166,9 +166,9 @@
 BOOL	SetDefaultEtcDlg(HWND hWnd);
 BOOL	SetMenuFont(HWND hWnd);
 BOOL	SetTaskTray(HWND hWnd, DWORD dwMessage);
-BOOL	CALLBACK DlgCallBack_Config(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
-BOOL	CALLBACK DlgCallBack_Etc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
-BOOL	CALLBACK DlgCallBack_Version(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR	CALLBACK DlgCallBack_Config(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR	CALLBACK DlgCallBack_Etc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR	CALLBACK DlgCallBack_Version(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
 LRESULT	CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam);
 LRESULT	CALLBACK WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
 

Modified: branches/unicode_buf/ttpmenu/winmisc.cpp
===================================================================
--- branches/unicode_buf/ttpmenu/winmisc.cpp	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/ttpmenu/winmisc.cpp	2019-08-20 14:35:14 UTC (rev 7998)
@@ -457,6 +457,6 @@
 		}
 	}
 
-	return CallWindowProc((WNDPROC) GetWindowLong(control, GWL_USERDATA),
+	return CallWindowProc((WNDPROC) GetWindowLongPtr(control, GWLP_USERDATA),
 	                      control, msg, wParam, lParam);
 }

Modified: branches/unicode_buf/ttssh2/ttxssh/CMakeLists.txt
===================================================================
--- branches/unicode_buf/ttssh2/ttxssh/CMakeLists.txt	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/ttssh2/ttxssh/CMakeLists.txt	2019-08-20 14:35:14 UTC (rev 7998)
@@ -5,34 +5,17 @@
 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_zlib.cmake)
 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_openssl.cmake)
 
-if(USE_UNICODE_API)
-  add_definitions(-DUNICODE -D_UNICODE)
+if (MSVC)
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:dnsapi.dll")
 endif()
 
-set(COMMON_SRC
-  ../../teraterm/teraterm/WSAAsyncGetAddrInfo.c
-  ../../teraterm/common/ttcommon.h
-  ../../teraterm/common/i18n.h
-  ../../teraterm/common/ttlib.h
-  ../../teraterm/common/ttlib.c
-  ../../teraterm/common/dlglib.h
-  ../../teraterm/common/dlglib.c
-  ../../teraterm/common/dlglib_cpp.cpp
-  ../../teraterm/common/dlglib_tmpl.cpp
-  ../../teraterm/common/servicenames.h
-  ../../teraterm/common/codeconv.cpp
-  ../../teraterm/common/codeconv.h
-  ../../teraterm/common/tipwin.cpp
-  ../../teraterm/common/tipwin.h
+add_library(
+  ttxssh SHARED
   )
 
-source_group(
-  "common"
-  FILES
-  ${COMMON_SRC}
-  )
-
-set(SRC
+target_sources(
+  ttxssh
+  PRIVATE
   ${CMAKE_CURRENT_BINARY_DIR}/puttyversion.h
   ../matcher/matcher.c
   arc4random.c
@@ -98,8 +81,33 @@
   ${COMMON_SRC}
   )
 
+target_sources(
+  ttxssh
+  PRIVATE
+  ../../teraterm/teraterm/WSAAsyncGetAddrInfo.c
+  ../../teraterm/common/ttcommon.h
+  ../../teraterm/common/i18n.h
+  ../../teraterm/common/ttlib.h
+  ../../teraterm/common/ttlib.c
+  ../../teraterm/common/dlglib.h
+  ../../teraterm/common/dlglib.c
+  ../../teraterm/common/dlglib_cpp.cpp
+  ../../teraterm/common/dlglib_tmpl.cpp
+  ../../teraterm/common/servicenames.h
+  ../../teraterm/common/codeconv.cpp
+  ../../teraterm/common/codeconv.h
+  ../../teraterm/common/tipwin.cpp
+  ../../teraterm/common/tipwin.h
+  )
 
-include_directories(
+source_group(
+  "common"
+  REGULAR_EXPRESSION
+  "teraterm\/common\/")
+
+target_include_directories(
+  ttxssh
+  PRIVATE
   ../../teraterm/teraterm
   ../../teraterm/common
   ../matcher
@@ -106,21 +114,8 @@
   ../putty
   ${OPENSSL_INCLUDE_DIRS}
   ${ZLIB_INCLUDE_DIRS}
-  )
+)
 
-link_directories(
-  ${ZLIB_LIBRARY_DIRS}
-  )
-
-if (MSVC)
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:dnsapi.dll")
-endif()
-
-add_library(
-  ttxssh SHARED
-  ${SRC}
-  )
-
 set_target_properties(
   ttxssh
   PROPERTIES
@@ -127,12 +122,26 @@
   PREFIX ""
   )
 
+target_compile_definitions(
+  ttxssh
+  PRIVATE
+  $<$<CONFIG:Debug>:_CRTDBG_MAP_ALLOC>
+  )
+if(USE_UNICODE_API)
+  target_compile_definitions(
+    ttxssh
+    PRIVATE
+    UNICODE
+    _UNICODE
+    )
+endif()
+
+
 target_link_libraries(
   ttxssh
   libputty
   ttpcmn
-  debug zlibstaticd
-  optimized zlibstatic
+  ${ZLIB_LIB}
   ${OPENSSL_LIB}
   #
   ws2_32
@@ -165,3 +174,9 @@
   WRITE ${CMAKE_CURRENT_BINARY_DIR}/puttyversion.h
   "#define PUTTYVERSION \"${version_str}\"\n"
   )
+
+install(
+  TARGETS ttxssh
+  RUNTIME
+  DESTINATION .
+  )

Modified: branches/unicode_buf/ttssh2/ttxssh/auth.c
===================================================================
--- branches/unicode_buf/ttssh2/ttxssh/auth.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/ttssh2/ttxssh/auth.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -815,8 +815,8 @@
 
 
 BOOL autologin_sent_none;
-static BOOL CALLBACK auth_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
-                                   LPARAM lParam)
+static INT_PTR CALLBACK auth_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+									  LPARAM lParam)
 {
 	const int IDC_TIMER1 = 300; // \x8E\xA9\x93\xAE\x83\x8D\x83O\x83C\x83\x93\x82\xAA\x97L\x8C\xF8\x82ȂƂ\xAB
 	const int IDC_TIMER2 = 301; // \x83T\x83|\x81[\x83g\x82\xB3\x82\xEA\x82Ă\xA2\x82郁\x83\\x83b\x83h\x82\xF0\x8E\xA9\x93\xAE\x83`\x83F\x83b\x83N(CheckAuthListFirst)
@@ -832,7 +832,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->auth_state.auth_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		UseControlChar = TRUE;
 		ShowPassPhrase = FALSE;
@@ -869,7 +869,7 @@
 		return FALSE;			/* because we set the focus */
 
 	case WM_TIMER:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 		// \x94F\x8F؏\x80\x94\x{142A82}ł\xAB\x82Ă\xA9\x82\xE7\x81A\x94F\x8F؃f\x81[\x83^\x82𑗐M\x82\xB7\x82\xE9\x81B\x91\x81\x82\xB7\x82\xAC\x82\xE9\x82ƁA\x97\x8E\x82\xBF\x82\xE9\x81B(2004.12.16 yutaka)
 		if (wParam == IDC_TIMER1) {
 			// \x8E\xA9\x93\xAE\x83\x8D\x83O\x83C\x83\x93\x82̂\xBD\x82\xDF
@@ -961,7 +961,7 @@
 		return FALSE;
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:
@@ -1392,8 +1392,8 @@
 	return TRUE;
 }
 
-static BOOL CALLBACK TIS_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
-                                  LPARAM lParam)
+static INT_PTR CALLBACK TIS_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+									 LPARAM lParam)
 {
 	PTInstVar pvar;
 
@@ -1401,7 +1401,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->auth_state.auth_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		init_TIS_dlg(pvar, dlg);
 
@@ -1415,7 +1415,7 @@
 		return FALSE;			/* because we set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:
@@ -1593,8 +1593,8 @@
 	return TRUE;
 }
 
-static BOOL CALLBACK default_auth_dlg_proc(HWND dlg, UINT msg,
-										   WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK default_auth_dlg_proc(HWND dlg, UINT msg,
+											  WPARAM wParam, LPARAM lParam)
 {
 	PTInstVar pvar;
 
@@ -1601,7 +1601,7 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		init_default_auth_dlg(pvar, dlg);
 		CenterWindow(dlg, GetParent(dlg));
@@ -1608,7 +1608,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:

Modified: branches/unicode_buf/ttssh2/ttxssh/fwd.c
===================================================================
--- branches/unicode_buf/ttssh2/ttxssh/fwd.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/ttssh2/ttxssh/fwd.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -529,11 +529,11 @@
 			             hInst, NULL);
 		if (pvar->fwd_state.accept_wnd != NULL) {
 			pvar->fwd_state.old_accept_wnd_proc =
-				(WNDPROC) SetWindowLong(pvar->fwd_state.accept_wnd,
-				                        GWL_WNDPROC,
-				                        (LONG) accept_wnd_proc);
-			SetWindowLong(pvar->fwd_state.accept_wnd, GWL_USERDATA,
-			              (LONG) pvar);
+				(WNDPROC) SetWindowLongPtr(pvar->fwd_state.accept_wnd,
+										   GWLP_WNDPROC,
+										   (LONG_PTR) accept_wnd_proc);
+			SetWindowLongPtr(pvar->fwd_state.accept_wnd, GWLP_USERDATA,
+							 (LONG_PTR) pvar);
 		}
 	}
 
@@ -771,6 +771,11 @@
 	FWDChannel* channel;
 	int changed = 0;
 
+	// \x83|\x81[\x83g\x93]\x91\x97\x82̖\xA2\x8Eg\x97p\x8E\x9E\x82͈ȉ\xBA\x82̃t\x83\x8D\x81[\x90\xA7\x8C\xE4\x82\xF0\x8Ds\x82\xED\x82Ȃ\xA2\x81B
+	if (c->type != TYPE_PORTFWD) {
+		return;
+	}
+
 	channel_num = c->local_num;
 	channel = pvar->fwd_state.channels + channel_num;
 
@@ -812,7 +817,7 @@
 static LRESULT CALLBACK accept_wnd_proc(HWND wnd, UINT msg, WPARAM wParam,
                                         LPARAM lParam)
 {
-	PTInstVar pvar = (PTInstVar) GetWindowLong(wnd, GWL_USERDATA);
+	PTInstVar pvar = (PTInstVar) GetWindowLongPtr(wnd, GWLP_USERDATA);
 
 	if (msg == WM_SOCK_ACCEPT &&
 	    (LOWORD(lParam) == FD_READ || LOWORD(lParam) == FD_CLOSE ||

Modified: branches/unicode_buf/ttssh2/ttxssh/fwdui.c
===================================================================
--- branches/unicode_buf/ttssh2/ttxssh/fwdui.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/ttssh2/ttxssh/fwdui.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -975,7 +975,7 @@
 	return TRUE;
 }
 
-static BOOL CALLBACK fwd_edit_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+static UINT_PTR CALLBACK fwd_edit_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
                                        LPARAM lParam)
 {
 	FWDEditClosure *closure;
@@ -985,7 +985,7 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		closure = (FWDEditClosure *) lParam;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		pvar = closure->pvar;
 		init_fwd_edit_dlg(pvar, closure->spec, dlg);
@@ -993,7 +993,7 @@
 		return FALSE;			/* because we set the focus */
 
 	case WM_COMMAND:
-		closure = (FWDEditClosure *) GetWindowLong(dlg, DWL_USER);
+		closure = (FWDEditClosure *) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:
@@ -1101,7 +1101,7 @@
 	}
 }
 
-static BOOL CALLBACK fwd_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+static UINT_PTR CALLBACK fwd_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
                                   LPARAM lParam)
 {
 	PTInstVar pvar;
@@ -1110,7 +1110,7 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		init_fwd_dlg(pvar, dlg);
 		CenterWindow(dlg, GetParent(dlg));
@@ -1117,7 +1117,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:

Modified: branches/unicode_buf/ttssh2/ttxssh/hosts.c
===================================================================
--- branches/unicode_buf/ttssh2/ttxssh/hosts.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/ttssh2/ttxssh/hosts.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1048,7 +1048,13 @@
 			index = strlen(result);
 		}
 
-		_snprintf_s(result + index, result_len - host_len, _TRUNCATE,
+		// \x91\xE62\x88\xF8\x90\x94(sizeOfBuffer)\x82̎w\x92\xE8\x8C\xEB\x82\xE8\x82ɂ\xE6\x82\xE8\x81A\x8E\xC0\x8Dۂ̃o\x83b\x83t\x83@\x83T\x83C\x83Y\x82\xE6\x82\xE8
+		// \x91傫\x82\xAD\x82Ȃ\xC1\x82Ă\xA2\x82\xBD\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B
+		// \x83|\x81[\x83g\x94ԍ\x86\x82\xAA22\x88ȊO\x82̏ꍇ\x81AVS2005\x82\xCCdebug build\x82ł́Aadd_host_key()\x82\xCC
+		// free(keydata)\x82ŁA\x82\xA9\x82Ȃ炸\x81u\x83u\x83\x8C\x81[\x83N\x83|\x83C\x83\x93\x83g\x82\xAA\x94\xAD\x90\xB6\x82\xB5\x82܂\xB5\x82\xBD\x81B\x83q\x81[\x83v\x82\xAA\x89\xF3\x82\xEA\x82Ă\xA2\x82邱\x82Ƃ\xAA
+		// \x8C\xB4\x88\xF6\x82Ƃ\xB5\x82čl\x82\xA6\x82\xE7\x82\xEA\x82܂\xB7\x81B\x81v\x82Ƃ\xA2\x82\xA4\x97\xE1\x8AO\x82\xAA\x94\xAD\x90\xB6\x82\xB7\x82\xE9\x81B
+		// release build\x82ł͍Č\xBB\x90\xAB\x82\xAA\x92Ⴂ\x81B
+		_snprintf_s(result + index, result_len - index, _TRUNCATE,
 		            " %d ", pvar->hosts_state.hostkey.bits);
 		index += strlen(result + index);
 		index += print_mp_int(result + index, pvar->hosts_state.hostkey.exp);
@@ -1708,8 +1714,8 @@
 // TODO: finger print\x82̕\\x8E\xA6\x82\xE0\x8Ds\x82\xA4\x81B
 // (2006.3.25 yutaka)
 //
-static BOOL CALLBACK hosts_add_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
-                                        LPARAM lParam)
+static INT_PTR CALLBACK hosts_add_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+										   LPARAM lParam)
 {
 	PTInstVar pvar;
 	char uimsg[MAX_UIMSG];
@@ -1718,7 +1724,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->hosts_state.hosts_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		// \x92lj\xC1\x81E\x92u\x82\xAB\x8A\xB7\x82\xA6\x82Ƃ\xE0 init_hosts_dlg \x82\xF0\x8CĂ\xF1\x82ł\xA2\x82\xE9\x82̂ŁA\x82\xBB\x82̑O\x82ɃZ\x83b\x83g\x82\xB7\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82\xE9
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
@@ -1792,7 +1798,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDC_CONTINUE:
@@ -1863,8 +1869,8 @@
 //
 // \x92u\x82\xAB\x8A\xB7\x82\xA6\x8E\x9E\x82̊m\x94F\x83_\x83C\x83A\x83\x8D\x83O\x82𕪗\xA3
 //
-static BOOL CALLBACK hosts_replace_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
-                                            LPARAM lParam)
+static INT_PTR CALLBACK hosts_replace_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+											   LPARAM lParam)
 {
 	PTInstVar pvar;
 	char uimsg[MAX_UIMSG];
@@ -1873,7 +1879,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->hosts_state.hosts_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		// \x92lj\xC1\x81E\x92u\x82\xAB\x8A\xB7\x82\xA6\x82Ƃ\xE0 init_hosts_dlg \x82\xF0\x8CĂ\xF1\x82ł\xA2\x82\xE9\x82̂ŁA\x82\xBB\x82̑O\x82ɃZ\x83b\x83g\x82\xB7\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82\xE9
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
@@ -1944,7 +1950,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDC_CONTINUE:
@@ -2016,8 +2022,8 @@
 //
 // \x93\xAF\x82\xB6\x83z\x83X\x83g\x82Ō\xAE\x8C`\x8E\xAE\x82\xAA\x88Ⴄ\x8E\x9E\x82̒lj\xC1\x8Am\x94F\x83_\x83C\x83A\x83\x8D\x83O\x82𕪗\xA3
 //
-static BOOL CALLBACK hosts_add2_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
-                                         LPARAM lParam)
+static INT_PTR CALLBACK hosts_add2_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
+											LPARAM lParam)
 {
 	PTInstVar pvar;
 	char uimsg[MAX_UIMSG];
@@ -2026,7 +2032,7 @@
 	case WM_INITDIALOG:
 		pvar = (PTInstVar) lParam;
 		pvar->hosts_state.hosts_dialog = dlg;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		// \x92lj\xC1\x81E\x92u\x82\xAB\x8A\xB7\x82\xA6\x82Ƃ\xE0 init_hosts_dlg \x82\xF0\x8CĂ\xF1\x82ł\xA2\x82\xE9\x82̂ŁA\x82\xBB\x82̑O\x82ɃZ\x83b\x83g\x82\xB7\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82\xE9
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
@@ -2099,7 +2105,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar) GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar) GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDC_CONTINUE:

Modified: branches/unicode_buf/ttssh2/ttxssh/key.c
===================================================================
--- branches/unicode_buf/ttssh2/ttxssh/key.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/ttssh2/ttxssh/key.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -2161,7 +2161,7 @@
 				strncat_s(buf, buf_len, "\r\n", _TRUNCATE);
 			}
 		}
-		SendDlgItemMessage(dlg, IDC_ADDKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)buf);
+		SetDlgItemTextA(dlg, IDC_ADDKEY_EDIT, buf);
 		free(buf);
 	}
 
@@ -2168,7 +2168,7 @@
 	if (ctx->nold > 0) {
 		buf_len = 100 * ctx->nold;
 		buf = calloc(100, ctx->nold);
-		SendDlgItemMessage(dlg, IDC_REMOVEKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)"");
+		SetDlgItemTextA(dlg, IDC_REMOVEKEY_EDIT, "");
 		for (i = 0; i < ctx->nold; i++) {
 			switch (dgst_alg) {
 			case SSH_DIGEST_MD5:
@@ -2189,12 +2189,12 @@
 				strncat_s(buf, buf_len, "\r\n", _TRUNCATE);
 			}
 		}
-		SendDlgItemMessage(dlg, IDC_REMOVEKEY_EDIT, WM_SETTEXT, 0, (LPARAM)(char *)buf);
+		SetDlgItemTextA(dlg, IDC_REMOVEKEY_EDIT, buf);
 		free(buf);
 	}
 }
 
-static BOOL CALLBACK hosts_updatekey_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static UINT_PTR CALLBACK hosts_updatekey_dlg_proc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
 {
 	PTInstVar pvar;
 	char buf[1024];
@@ -2205,7 +2205,7 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		pvar = (PTInstVar)lParam;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
 		UTIL_get_lang_msg("DLG_HOSTKEY_ROTATION_TITLE", pvar, uimsg);
@@ -2249,7 +2249,7 @@
 		return TRUE;			/* because we do not set the focus */
 
 	case WM_COMMAND:
-		pvar = (PTInstVar)GetWindowLong(dlg, DWL_USER);
+		pvar = (PTInstVar)GetWindowLongPtr(dlg, DWLP_USER);
 
 		switch (LOWORD(wParam)) {
 		case IDOK:
@@ -2329,6 +2329,7 @@
 	buffer_t *bsig = NULL;
 	char *cp, *sig;
 	size_t i, ndone, siglen;
+	int siglen_i;
 	int ret;
 
 	// SSH2 packet format:
@@ -2384,7 +2385,8 @@
 		free(blob);
 		blob = NULL;
 
-		sig = buffer_get_string_msg(bsig, &siglen);
+		sig = buffer_get_string_msg(bsig, &siglen_i);
+		siglen = siglen_i;
 		// Verify signature
 		ret = key_verify(ctx->keys[i], sig, siglen, buffer_ptr(b), buffer_len(b));
 		free(sig);

Modified: branches/unicode_buf/ttssh2/ttxssh/sftp.c
===================================================================
--- branches/unicode_buf/ttssh2/ttxssh/sftp.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/ttssh2/ttxssh/sftp.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1073,8 +1073,8 @@
 			SetFocus(hEdit);
 
 			// \x83G\x83f\x83B\x83b\x83g\x83R\x83\x93\x83g\x83\x8D\x81[\x83\x8B\x82̃T\x83u\x83N\x83\x89\x83X\x89\xBB
-			hEditProc = (WNDPROC)GetWindowLong(hEdit, GWL_WNDPROC);
-			SetWindowLong(hEdit, GWL_WNDPROC, (LONG)EditProc);
+			hEditProc = (WNDPROC)GetWindowLongPtr(hEdit, GWLP_WNDPROC);
+			SetWindowLongPtr(hEdit, GWLP_WNDPROC, (LONG_PTR)EditProc);
 
 			CenterWindow(hDlgWnd, GetParent(hDlgWnd));
 

Modified: branches/unicode_buf/ttssh2/ttxssh/ssh.c
===================================================================
--- branches/unicode_buf/ttssh2/ttxssh/ssh.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/ttssh2/ttxssh/ssh.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -218,7 +218,7 @@
 	if (type == TYPE_SCP) {
 		c->scp.state = SCP_INIT;
 		c->scp.progress_window = NULL;
-		c->scp.thread = (HANDLE)-1;
+		c->scp.thread = INVALID_HANDLE_VALUE;
 		c->scp.localfp = NULL;
 		c->scp.filemtime = 0;
 		c->scp.fileatime = 0;
@@ -345,10 +345,10 @@
 			DestroyWindow(c->scp.progress_window);
 			c->scp.progress_window = NULL;
 		}
-		if (c->scp.thread != (HANDLE)-1L) {
+		if (c->scp.thread != INVALID_HANDLE_VALUE) {
 			WaitForSingleObject(c->scp.thread, INFINITE);
 			CloseHandle(c->scp.thread);
-			c->scp.thread = (HANDLE)-1L;
+			c->scp.thread = INVALID_HANDLE_VALUE;
 		}
 
 		ssh2_scp_free_packetlist(c);
@@ -2530,7 +2530,10 @@
 	if (grab_payload(pvar, challenge_bytes)) {
 		unsigned char *outmsg = begin_send_packet(pvar, SSH_CMSG_AUTH_RSA_RESPONSE, 16);
 
-		if (pvar->auth_state.cur_cred.method == SSH_AUTH_RSA) {
+		// rhosts\x94F\x8F\xD8(SSH1)\x82\xAA\x82ł\xAB\x82\xE9\x82悤\x82\xC9 SSH_AUTH_RHOSTS_RSA \x82\xF0\x8F\xF0\x8C\x8F\x82ɒlj\xC1\x82\xB7\x82\xE9\x81B
+		if (pvar->auth_state.cur_cred.method == SSH_AUTH_RSA ||
+			pvar->auth_state.cur_cred.method == SSH_AUTH_RHOSTS_RSA
+			) {
 			if (CRYPT_generate_RSA_challenge_response
 				(pvar, pvar->ssh_state.payload + 2, challenge_bytes, outmsg)) {
 
@@ -4068,18 +4071,16 @@
 		strncpy_s(c->scp.remotefile, sizeof(c->scp.remotefile), sendfile, _TRUNCATE); 
 
 		if (dstfile == NULL || dstfile[0] == '\0') { // local file path is empty.
-			char *fn, *cwd;
+			char *fn;
+			char FileDirExpanded[MAX_PATH];
 
 			fn = strrchr(sendfile, '/');
 			if (fn && fn[1] == '\0')
 				goto error;
-			cwd = pvar->ts->FileDir;
-			//cwd = _getcwd(NULL, 0);
 
-			_snprintf_s(c->scp.localfilefull, sizeof(c->scp.localfilefull), _TRUNCATE, "%s\\%s", cwd, fn ? fn : sendfile);
+			ExpandEnvironmentStrings(pvar->ts->FileDir, FileDirExpanded, sizeof(FileDirExpanded));
+			_snprintf_s(c->scp.localfilefull, sizeof(c->scp.localfilefull), _TRUNCATE, "%s\\%s", FileDirExpanded, fn ? fn : sendfile);
 			ExtractFileName(c->scp.localfilefull, c->scp.localfile, sizeof(c->scp.localfile));   // file name only
-
-			//free(cwd);  // free!!
 		} else {
 			_snprintf_s(c->scp.localfilefull, sizeof(c->scp.localfilefull), _TRUNCATE, "%s", dstfile);
 			ExtractFileName(dstfile, c->scp.localfile, sizeof(c->scp.localfile));   // file name only
@@ -6810,7 +6811,7 @@
 
 static void start_ssh_heartbeat_thread(PTInstVar pvar)
 {
-	HANDLE thread = (HANDLE)-1;
+	HANDLE thread = INVALID_HANDLE_VALUE;
 	unsigned tid;
 	HWND hDlgWnd;
 
@@ -6822,8 +6823,9 @@
 
 	// TTSSH\x82\xCD thread-safe \x82ł͂Ȃ\xA2\x82̂ŃX\x83\x8C\x83b\x83h\x93\xE0\x82\xA9\x82\xE7\x82̃p\x83P\x83b\x83g\x91\x97\x90M\x82͕s\x89B(2007.12.26 yutaka)
 	thread = (HANDLE)_beginthreadex(NULL, 0, ssh_heartbeat_thread, pvar, 0, &tid);
-	if (thread == (HANDLE)-1) {
+	if (thread == 0) {
 		// TODO:
+		thread = INVALID_HANDLE_VALUE;
 	}
 	pvar->ssh_heartbeat_thread = thread;
 }
@@ -6831,10 +6833,10 @@
 // \x83X\x83\x8C\x83b\x83h\x82̒\xE2\x8E~ (2004.12.27 yutaka)
 void halt_ssh_heartbeat_thread(PTInstVar pvar)
 {
-	if (pvar->ssh_heartbeat_thread != (HANDLE)-1L) {
+	if (pvar->ssh_heartbeat_thread != INVALID_HANDLE_VALUE) {
 		WaitForSingleObject(pvar->ssh_heartbeat_thread, INFINITE);
 		CloseHandle(pvar->ssh_heartbeat_thread);
-		pvar->ssh_heartbeat_thread = (HANDLE)-1L;
+		pvar->ssh_heartbeat_thread = INVALID_HANDLE_VALUE;
 
 		DestroyWindow(pvar->ssh_hearbeat_dialog);
 	}
@@ -7424,7 +7426,7 @@
 	char new_passwd[PASSWD_MAXLEN];
 };
 
-static BOOL CALLBACK passwd_change_dialog(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK passwd_change_dialog(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
 {
 	char old_passwd[PASSWD_MAXLEN];
 	char new_passwd[PASSWD_MAXLEN];
@@ -8433,8 +8435,9 @@
 		}
 
 		thread = (HANDLE)_beginthreadex(NULL, 0, ssh_scp_thread, c, 0, &tid);
-		if (thread == (HANDLE)-1) {
+		if (thread == 0) {
 			// TODO:
+			thread = INVALID_HANDLE_VALUE;
 		}
 		c->scp.thread = thread;
 
@@ -8673,7 +8676,7 @@
 			HANDLE thread;
 			unsigned int tid;
 
-			sscanf_s(data, "C%o %lld %s", &permission, &size, filename, sizeof(filename));
+			sscanf_s(data, "C%o %lld %s", &permission, &size, filename, (unsigned int)sizeof(filename));
 
 			// Windows\x82Ȃ̂Ńp\x81[\x83~\x83b\x83V\x83\x87\x83\x93\x82͖\xB3\x8E\x8B\x81B\x83T\x83C\x83Y\x82̂݋L\x98^\x81B
 			c->scp.filetotalsize = size;
@@ -8694,8 +8697,9 @@
 
 			ssh2_scp_alloc_packetlist(c);
 			thread = (HANDLE)_beginthreadex(NULL, 0, ssh_scp_receive_thread, c, 0, &tid);
-			if (thread == (HANDLE)-1) {
+			if (thread == 0) {
 				// TODO:
+				thread = INVALID_HANDLE_VALUE;
 			}
 			c->scp.thread = thread;
 			c->scp.thread_id = tid;

Modified: branches/unicode_buf/ttssh2/ttxssh/ttxssh.c
===================================================================
--- branches/unicode_buf/ttssh2/ttxssh/ttxssh.c	2019-08-20 14:34:24 UTC (rev 7997)
+++ branches/unicode_buf/ttssh2/ttxssh/ttxssh.c	2019-08-20 14:35:14 UTC (rev 7998)
@@ -1252,8 +1252,8 @@
 	return CallWindowProc(OrigHostnameEditProc, dlg, msg, wParam, lParam);
 }
 
-static BOOL CALLBACK TTXHostDlg(HWND dlg, UINT msg, WPARAM wParam,
-                                LPARAM lParam)
+static INT_PTR CALLBACK TTXHostDlg(HWND dlg, UINT msg, WPARAM wParam,
+								   LPARAM lParam)
 {
 	static char *ssh_version[] = {"SSH1", "SSH2", NULL};
 	PGetHNRec GetHNRec;
@@ -1271,7 +1271,7 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		GetHNRec = (PGetHNRec) lParam;
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
 		UTIL_get_lang_msg("DLG_HOST_TITLE", pvar, uimsg);
@@ -1348,8 +1348,8 @@
 		// C-n/C-p \x82̂\xBD\x82߂ɃT\x83u\x83N\x83\x89\x83X\x89\xBB (2007.9.4 maya)
 		hwndHostname = GetDlgItem(dlg, IDC_HOSTNAME);
 		hwndHostnameEdit = GetWindow(hwndHostname, GW_CHILD);
-		OrigHostnameEditProc = (WNDPROC)GetWindowLong(hwndHostnameEdit, GWL_WNDPROC);
-		SetWindowLong(hwndHostnameEdit, GWL_WNDPROC, (LONG)HostnameEditProc);
+		OrigHostnameEditProc = (WNDPROC)GetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC);
+		SetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC, (LONG_PTR)HostnameEditProc);
 
 		CheckRadioButton(dlg, IDC_HOSTTELNET, IDC_HOSTOTHER,
 		                 pvar->settings.Enabled ? IDC_HOSTSSH : GetHNRec->
@@ -1478,7 +1478,7 @@
 	case WM_COMMAND:
 		switch (LOWORD(wParam)) {
 		case IDOK:
-			GetHNRec = (PGetHNRec) GetWindowLong(dlg, DWL_USER);
+			GetHNRec = (PGetHNRec) GetWindowLongPtr(dlg, DWLP_USER);
 			if (GetHNRec != NULL) {
 				if (IsDlgButtonChecked(dlg, IDC_HOSTTCPIP)) {
 					char afstr[BUFSIZ];
@@ -1544,12 +1544,12 @@
 					}
 				}
 			}
-			SetWindowLong(hwndHostnameEdit, GWL_WNDPROC, (LONG)OrigHostnameEditProc);
+			SetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC, (LONG_PTR)OrigHostnameEditProc);
 			EndDialog(dlg, 1);
 			return TRUE;
 
 		case IDCANCEL:
-			SetWindowLong(hwndHostnameEdit, GWL_WNDPROC, (LONG)OrigHostnameEditProc);
+			SetWindowLongPtr(hwndHostnameEdit, GWLP_WNDPROC, (LONG_PTR)OrigHostnameEditProc);
 			EndDialog(dlg, 0);
 			return TRUE;
 
@@ -1594,7 +1594,7 @@
 			enable_dlg_items(dlg, IDC_SSH_VERSION, IDC_SSH_VERSION, FALSE); // disabled
 hostssh_enabled:
 
-			GetHNRec = (PGetHNRec) GetWindowLong(dlg, DWL_USER);
+			GetHNRec = (PGetHNRec) GetWindowLongPtr(dlg, DWLP_USER);
 
 			if (IsDlgButtonChecked(dlg, IDC_HOSTTELNET)) {
 				if (GetHNRec != NULL)
@@ -2441,8 +2441,8 @@
     return CallWindowProc(g_defAboutDlgEditWndProc, hWnd, msg, wp, lp);
 }
 
-static BOOL CALLBACK TTXAboutDlg(HWND dlg, UINT msg, WPARAM wParam,
-                                 LPARAM lParam)
+static INT_PTR CALLBACK TTXAboutDlg(HWND dlg, UINT msg, WPARAM wParam,
+									LPARAM lParam)
 {
 	static HFONT DlgAboutTextFont;
 
@@ -3252,12 +3252,12 @@
 	}
 }
 
-static BOOL CALLBACK TTXSetupDlg(HWND dlg, UINT msg, WPARAM wParam,
-                                 LPARAM lParam)
+static INT_PTR CALLBACK TTXSetupDlg(HWND dlg, UINT msg, WPARAM wParam,
+									LPARAM lParam)
 {
 	switch (msg) {
 	case WM_INITDIALOG:
-		SetWindowLong(dlg, DWL_USER, lParam);
+		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 		init_setup_dlg((PTInstVar) lParam, dlg);
 
 		CenterWindow(dlg, GetParent(dlg));
@@ -3266,7 +3266,7 @@
 	case WM_COMMAND:
 		switch (LOWORD(wParam)) {
 		case IDOK:
-			complete_setup_dlg((PTInstVar) GetWindowLong(dlg, DWL_USER), dlg);
+			complete_setup_dlg((PTInstVar) GetWindowLongPtr(dlg, DWLP_USER), dlg);
 			EndDialog(dlg, 1);
 			return TRUE;
 		case IDCANCEL:			/* there isn't a cancel button, but other Windows
@@ -3783,7 +3783,7 @@
 //
 // SCP dialog
 //
-static BOOL CALLBACK TTXScpDialog(HWND dlg, UINT msg, WPARAM wParam,
+static INT_PTR CALLBACK TTXScpDialog(HWND dlg, UINT msg, WPARAM wParam,
                                      LPARAM lParam)
 {
 	static char sendfile[MAX_PATH] = "";
@@ -3877,15 +3877,20 @@
 		}
 
 		switch (LOWORD(wParam)) {
-		case IDOK:
+		case IDOK:  // \x83t\x83@\x83C\x83\x8B\x91\x97\x90M
 			hWnd = GetDlgItem(dlg, IDC_SENDFILE_EDIT);
 			SendMessage(hWnd, WM_GETTEXT , sizeof(sendfile), (LPARAM)sendfile);
 			if (sendfile[0] != '\0') {
-				// \x91\x97\x90M\x83p\x83X\x82\xF0\x8E\xE6\x82\xE8\x8Fo\x82\xB5\x81Ateraterm.ini \x82\xE0\x8D\x87\x82킹\x82čX\x90V\x82\xB7\x82\xE9\x81B
+				// \x91\x97\x90M\x83p\x83X\x82\xF0\x8E\xE6\x82\xE8\x8Fo\x82\xB5\x81Ats->ScpSendDir \x82\xE0\x8D\x87\x82킹\x82čX\x90V\x82\xB7\x82\xE9\x81B
 				hWnd = GetDlgItem(dlg, IDC_SENDFILE_TO);
 				SendMessage(hWnd, WM_GETTEXT , sizeof(sendfiledir), (LPARAM)sendfiledir);
 				strncpy_s(pvar->ts->ScpSendDir, sizeof(pvar->ts->ScpSendDir), sendfiledir, _TRUNCATE);
 
+				// \x8E\xF3\x90M\x83p\x83X\x82\xF0\x8E\xE6\x82\xE8\x8Fo\x82\xB5\x81Ats->FileDir \x82\xE0\x8D\x87\x82킹\x82čX\x90V\x82\xB7\x82\xE9\x81B
+				hWnd = GetDlgItem(dlg, IDC_RECVFILE_TO);
+				SendMessage(hWnd, WM_GETTEXT , sizeof(recvdir), (LPARAM)recvdir);
+				strncpy_s(pvar->ts->FileDir, sizeof(pvar->ts->FileDir), recvdir, _TRUNCATE);
+
 				SSH_start_scp(pvar, sendfile, sendfiledir);
 				//SSH_scp_transaction(pvar, "bigfile30.bin", "", FROMREMOTE);
 				EndDialog(dlg, 1); // dialog close
@@ -3894,12 +3899,12 @@
 			return FALSE;
 
 		case IDCANCEL:
-			// \x91\x97\x90M\x83p\x83X\x82\xF0\x8E\xE6\x82\xE8\x8Fo\x82\xB5\x81Ateraterm.ini \x82\xE0\x8D\x87\x82킹\x82čX\x90V\x82\xB7\x82\xE9\x81B
+			// \x91\x97\x90M\x83p\x83X\x82\xF0\x8E\xE6\x82\xE8\x8Fo\x82\xB5\x81Ats->ScpSendDir \x82\xE0\x8D\x87\x82킹\x82čX\x90V\x82\xB7\x82\xE9\x81B
 			hWnd = GetDlgItem(dlg, IDC_SENDFILE_TO);
 			SendMessage(hWnd, WM_GETTEXT , sizeof(sendfiledir), (LPARAM)sendfiledir);
 			strncpy_s(pvar->ts->ScpSendDir, sizeof(pvar->ts->ScpSendDir), sendfiledir, _TRUNCATE);
 
-			// \x8E\xF3\x90M\x83p\x83X\x82Ɋւ\xB5\x82Ă\xE0\x8DX\x90V\x82\xB7\x82\xE9\x81B(2013.8.18 yutaka)
+			// \x8E\xF3\x90M\x83p\x83X\x82\xF0\x8E\xE6\x82\xE8\x8Fo\x82\xB5\x81Ats->FileDir \x82\xE0\x8D\x87\x82킹\x82čX\x90V\x82\xB7\x82\xE9\x81B
 			hWnd = GetDlgItem(dlg, IDC_RECVFILE_TO);
 			SendMessage(hWnd, WM_GETTEXT , sizeof(recvdir), (LPARAM)recvdir);
 			strncpy_s(pvar->ts->FileDir, sizeof(pvar->ts->FileDir), recvdir, _TRUNCATE);
@@ -3914,6 +3919,19 @@
 				char recvpath[MAX_PATH] = "";
 				char* fn = strrchr(szFileName, '/');
 				char recvfn[sizeof(szFileName)];
+				char recvdir_expanded[MAX_PATH];
+
+				// \x91\x97\x90M\x83p\x83X\x82\xF0\x8E\xE6\x82\xE8\x8Fo\x82\xB5\x81Ats->ScpSendDir \x82\xE0\x8D\x87\x82킹\x82čX\x90V\x82\xB7\x82\xE9\x81B
+				hWnd = GetDlgItem(dlg, IDC_SENDFILE_TO);
+				SendMessage(hWnd, WM_GETTEXT , sizeof(sendfiledir), (LPARAM)sendfiledir);
+				strncpy_s(pvar->ts->ScpSendDir, sizeof(pvar->ts->ScpSendDir), sendfiledir, _TRUNCATE);
+
+				// \x8E\xF3\x90M\x83p\x83X\x82\xF0\x8E\xE6\x82\xE8\x8Fo\x82\xB5\x81Ats->FileDir \x82\xE0\x8D\x87\x82킹\x82čX\x90V\x82\xB7\x82\xE9\x81B
+				hWnd = GetDlgItem(dlg, IDC_RECVFILE_TO);
+				SendMessage(hWnd, WM_GETTEXT , sizeof(recvdir), (LPARAM)recvdir);
+				ExpandEnvironmentStrings(recvdir, recvdir_expanded, sizeof(recvdir_expanded));
+				strncpy_s(pvar->ts->FileDir, sizeof(pvar->ts->FileDir), recvdir, _TRUNCATE);
+
 				if (fn) {
 					fn++;
 					if (*fn == '\0') {
@@ -3925,8 +3943,7 @@
 				}
 				strncpy_s(recvfn, sizeof(recvfn), fn, _TRUNCATE);
 				replaceInvalidFileNameChar(recvfn, '_');
-				SendMessage(GetDlgItem(dlg, IDC_RECVFILE_TO), WM_GETTEXT, sizeof(recvdir), (LPARAM)recvdir);
-				_snprintf_s(recvpath, sizeof(recvpath), _TRUNCATE, "%s\\%s", recvdir, recvfn);
+				_snprintf_s(recvpath, sizeof(recvpath), _TRUNCATE, "%s\\%s", recvdir_expanded, recvfn);
 				SSH_scp_transaction(pvar, szFileName, recvpath, FROMREMOTE);
 				EndDialog(dlg, 1); // dialog close
 				return TRUE;
@@ -4172,8 +4189,8 @@
 	buffer_free(blob);
 }
 
-static BOOL CALLBACK TTXKeyGenerator(HWND dlg, UINT msg, WPARAM wParam,
-                                     LPARAM lParam)
+static INT_PTR CALLBACK TTXKeyGenerator(HWND dlg, UINT msg, WPARAM wParam,
+										LPARAM lParam)
 {
 	static ssh_keytype key_type;
 	static int saved_key_bits;
@@ -5344,7 +5361,7 @@
 		hInst = hInstance;
 		pvar = &InstVar;
 		__mem_mapping =
-			CreateFileMapping((HANDLE) 0xFFFFFFFF, NULL, PAGE_READWRITE, 0,
+			CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0,
 			                  sizeof(TS_SSH), TTSSH_FILEMAPNAME);
 		if (__mem_mapping == NULL) {
 			/* fake it. The settings won't be shared, but what the heck. */


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