[Ttssh2-commit] [7528] vtwin,teratermでMFCを使用しないようにした

scmno****@osdn***** scmno****@osdn*****
2019年 3月 29日 (金) 01:38:54 JST


Revision: 7528
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7528
Author:   zmatsuo
Date:     2019-03-29 01:38:54 +0900 (Fri, 29 Mar 2019)
Log Message:
-----------
vtwin,teratermでMFCを使用しないようにした

Modified Paths:
--------------
    trunk/teraterm/common/tt_res.h
    trunk/teraterm/teraterm/ftdlg.cpp
    trunk/teraterm/teraterm/teraprn.cpp
    trunk/teraterm/teraterm/teraterm.cpp
    trunk/teraterm/teraterm/ttermpro.rc
    trunk/teraterm/teraterm/vtdisp.c
    trunk/teraterm/teraterm/vtdisp.h
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/teraterm/vtwin.h

Added Paths:
-----------
    trunk/teraterm/teraterm/teraterml.h

Removed Paths:
-------------
    trunk/teraterm/common/stdafx.cpp

-------------- next part --------------
Deleted: trunk/teraterm/common/stdafx.cpp
===================================================================
--- trunk/teraterm/common/stdafx.cpp	2019-03-28 16:38:41 UTC (rev 7527)
+++ trunk/teraterm/common/stdafx.cpp	2019-03-28 16:38:54 UTC (rev 7528)
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2011-2017 TeraTerm Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "stdafx.h"
-

Modified: trunk/teraterm/common/tt_res.h
===================================================================
--- trunk/teraterm/common/tt_res.h	2019-03-28 16:38:41 UTC (rev 7527)
+++ trunk/teraterm/common/tt_res.h	2019-03-28 16:38:54 UTC (rev 7528)
@@ -289,6 +289,7 @@
 #define ID_SETUP_TERMINAL               50310
 #define ID_SETUP_WINDOW                 50320
 #define ID_SETUP_FONT                   50330
+#define ID_SETUP_DLG_FONT               50331
 #define ID_SETUP_KEYBOARD               50340
 #define ID_SETUP_SERIALPORT             50350
 #define ID_SETUP_TCPIP                  50360

Modified: trunk/teraterm/teraterm/ftdlg.cpp
===================================================================
--- trunk/teraterm/teraterm/ftdlg.cpp	2019-03-28 16:38:41 UTC (rev 7527)
+++ trunk/teraterm/teraterm/ftdlg.cpp	2019-03-28 16:38:54 UTC (rev 7528)
@@ -39,6 +39,7 @@
 #include "dlglib.h"
 #include "tt_res.h"
 #include "ftdlg.h"
+#include "teraterml.h"
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -150,8 +151,6 @@
 
 /////////////////////////////////////////////////////////////////////////////
 // CFileTransDlg message handler
-#define AddModalHandle(p1)		// TODO
-#define	RemoveModalHandle(p1)
 
 BOOL CFileTransDlg::OnInitDialog()
 {

Modified: trunk/teraterm/teraterm/teraprn.cpp
===================================================================
--- trunk/teraterm/teraterm/teraprn.cpp	2019-03-28 16:38:41 UTC (rev 7527)
+++ trunk/teraterm/teraterm/teraprn.cpp	2019-03-28 16:38:54 UTC (rev 7528)
@@ -28,7 +28,6 @@
  */
 
 /* TERATERM.EXE, Printing routines */
-#include "stdafx.h"
 #include "teraterm.h"
 #include "tttypes.h"
 #include <commdlg.h>
@@ -41,6 +40,7 @@
 #include "win16api.h"
 
 #include "tt_res.h"
+#include "tmfc.h"
 #include "prnabort.h"
 
 #include "teraprn.h"
@@ -51,7 +51,7 @@
 static char THIS_FILE[] = __FILE__;
 #endif
 
-//#define CWnd TTCWnd
+#define CWnd TTCWnd
 
 static PRINTDLG PrnDlg;
 

Modified: trunk/teraterm/teraterm/teraterm.cpp
===================================================================
--- trunk/teraterm/teraterm/teraterm.cpp	2019-03-28 16:38:41 UTC (rev 7527)
+++ trunk/teraterm/teraterm/teraterm.cpp	2019-03-28 16:38:54 UTC (rev 7528)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2006-2017 TeraTerm Project
+ * (C) 2006-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,8 @@
 
 /* TERATERM.EXE, main */
 
-#include "stdafx.h"
+#include <crtdbg.h>
+#include <tchar.h>
 #include "teraterm.h"
 #include "tttypes.h"
 #include "commlib.h"
@@ -47,11 +48,9 @@
 #include "keyboard.h"
 #include "dllutil.h"
 #include "compat_win.h"
-
-#include "teraapp.h"
-
 #include "compat_w95.h"
 #include "dlglib.h"
+#include "teraterml.h"
 
 #if 0
 //#ifdef _DEBUG
@@ -61,11 +60,6 @@
 #define new ::new(_NORMAL_BLOCK, __FILE__, __LINE__)
 #endif
 
-BEGIN_MESSAGE_MAP(CTeraApp, CWinApp)
-	//{{AFX_MSG_MAP(CTeraApp)
-	//}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
 static BOOL AddFontFlag;
 static TCHAR TSpecialFont[MAX_PATH];
 
@@ -122,39 +116,8 @@
 	LoadSpecialFont();
 }
 
-CTeraApp::CTeraApp()
-{
-	init();
-}
-
-// CTeraApp instance
-CTeraApp theApp;
-
-
-
-
-
-// CTeraApp initialization
-BOOL CTeraApp::InitInstance()
-{
-	hInst = m_hInstance;
-	m_pMainWnd = new CVTWindow();
-	pVTWin = m_pMainWnd;
-	// [Tera Term]\x83Z\x83N\x83V\x83\x87\x83\x93\x82\xCCDlgFont=\x82\xAA\x82Ȃ\xA2\x8Fꍇ\x82\xCD
-	// [TTSH]\x83Z\x83N\x83V\x83\x87\x83\x93\x82̃t\x83H\x83\x93\x83g\x90ݒ\xE8\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9
-	SetDialogFont(ts.SetupFName, ts.UILanguageFile, "TTSSH");
-	return TRUE;
-}
-
-int CTeraApp::ExitInstance()
-{
-	UnloadSpecialFont();
-	DLLExit();
-	return CWinApp::ExitInstance();
-}
-
 // Tera Term main engine
-BOOL CTeraApp::OnIdle(LONG lCount)
+static BOOL OnIdle(LONG lCount)
 {
 	static int Busy = 2;
 	int Change, nx, ny;
@@ -280,12 +243,98 @@
 	return (Busy>0);
 }
 
-BOOL CTeraApp::PreTranslateMessage(MSG* pMsg)
+BOOL CallOnIdle(LONG lCount)
 {
-	if (MetaKey(ts.MetaKey)) {
-		return FALSE; /* ignore accelerator keys */
+	return OnIdle(lCount);
+}
+
+HINSTANCE GetInstance()
+{
+	return hInst;
+}
+
+static HWND main_window;
+HWND GetHWND()
+{
+	return main_window;
+}
+
+static HWND hModalWnd;
+
+void AddModalHandle(HWND hWnd)
+{
+	hModalWnd = hWnd;
+}
+
+void RemoveModalHandle(HWND hWnd)
+{
+	hModalWnd = 0;
+}
+
+int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInst,
+                   LPSTR lpszCmdLine, int nCmdShow)
+{
+#ifdef _DEBUG
+	::_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
+#endif
+
+	LONG lCount = 0;
+	DWORD SleepTick = 1;
+	init();
+	hInst = hInstance;
+	CVTWindow *m_pMainWnd = new CVTWindow();
+	pVTWin = m_pMainWnd;
+	main_window = m_pMainWnd->m_hWnd;
+	// [Tera Term]\x83Z\x83N\x83V\x83\x87\x83\x93\x82\xCCDlgFont=\x82\xAA\x82Ȃ\xA2\x8Fꍇ\x82\xCD
+	// [TTSSH]\x83Z\x83N\x83V\x83\x87\x83\x93\x82̃t\x83H\x83\x93\x83g\x90ݒ\xE8\x82\xF0\x8Eg\x97p\x82\xB7\x82\xE9
+	SetDialogFont(ts.SetupFName, ts.UILanguageFile, "TTSSH");
+
+	MSG msg;
+	while (GetMessage(&msg, NULL, 0, 0)) {
+		if (hModalWnd != 0) {
+			if (IsDialogMessage(hModalWnd, &msg)) {
+				continue;
+			}
+		}
+
+		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);
+		}
+
+		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;
+				}
+				lCount = 0;
+				Sleep(SleepTick);
+			} else {
+				// \x97vidle
+				SleepTick = 0;
+				lCount++;
+			}
+		}
 	}
-	else {
-		return CWinApp::PreTranslateMessage(pMsg);
-	}
+	delete m_pMainWnd;
+	m_pMainWnd = NULL;
+
+	UnloadSpecialFont();
+	DLLExit();
+
+    return msg.wParam;
 }

Copied: trunk/teraterm/teraterm/teraterml.h (from rev 7527, trunk/teraterm/common/stdafx.cpp)
===================================================================
--- trunk/teraterm/teraterm/teraterml.h	                        (rev 0)
+++ trunk/teraterm/teraterm/teraterml.h	2019-03-28 16:38:54 UTC (rev 7528)
@@ -0,0 +1,33 @@
+/*
+ * (C) 2019 TeraTerm Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* teraterm local header   */
+/*	teraterm/ folder only  */
+
+void AddModalHandle(HWND hWnd);
+void RemoveModalHandle(HWND hWnd);

Modified: trunk/teraterm/teraterm/ttermpro.rc
===================================================================
--- trunk/teraterm/teraterm/ttermpro.rc	2019-03-28 16:38:41 UTC (rev 7527)
+++ trunk/teraterm/teraterm/ttermpro.rc	2019-03-28 16:38:54 UTC (rev 7528)
@@ -274,7 +274,6 @@
 
 IDD_FILETRANSDLG DIALOGEX 20, 20, 176, 96
 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CLASS "FTDlg32"
 FONT 14, "System", 0, 0, 0x0
 BEGIN
     CONTROL         "Filename:",IDC_TRANS_FILENAME,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,15,12,38,10
@@ -578,7 +577,11 @@
     BEGIN
         MENUITEM "&Terminal...",                ID_SETUP_TERMINAL
         MENUITEM "&Window...",                  ID_SETUP_WINDOW
-        MENUITEM "&Font...",                    ID_SETUP_FONT
+		POPUP "&Font"
+        BEGIN
+			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: trunk/teraterm/teraterm/vtdisp.c
===================================================================
--- trunk/teraterm/teraterm/vtdisp.c	2019-03-28 16:38:41 UTC (rev 7527)
+++ trunk/teraterm/teraterm/vtdisp.c	2019-03-28 16:38:54 UTC (rev 7528)
@@ -3902,3 +3902,10 @@
 	}
 	return color;
 }
+
+void DpiChanged(void)
+{
+  ChangeFont();
+  DispChangeWinSize(WinWidth,WinHeight);
+  ChangeCaret();
+}

Modified: trunk/teraterm/teraterm/vtdisp.h
===================================================================
--- trunk/teraterm/teraterm/vtdisp.h	2019-03-28 16:38:41 UTC (rev 7527)
+++ trunk/teraterm/teraterm/vtdisp.h	2019-03-28 16:38:54 UTC (rev 7528)
@@ -55,7 +55,7 @@
   (int Xw, int Yw, int *Xs, int *Ys, PBOOL Right);
 void DispConvScreenToWin
   (int Xs, int Ys, int *Xw, int *Yw);
-void SetLogFont();
+//void SetLogFont();
 void ChangeFont();
 void ResetIME();
 void ChangeCaret();
@@ -116,6 +116,7 @@
 void DispGetRootWinSize(int *x, int *y, BOOL inPixels);
 int DispFindClosestColor(int red, int green, int blue);
 void UpdateBGBrush(void);
+void DpiChanged(void);
 
 extern int WinWidth, WinHeight;
 extern HFONT VTFont[AttrFontMask+1];

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2019-03-28 16:38:41 UTC (rev 7527)
+++ trunk/teraterm/teraterm/vtwin.cpp	2019-03-28 16:38:54 UTC (rev 7528)
@@ -30,7 +30,6 @@
 
 /* TERATERM.EXE, VT window */
 
-#include "stdafx.h"
 #include "teraterm.h"
 #include "tttypes.h"
 
@@ -51,6 +50,7 @@
 #include "tektypes.h"
 #include "ttdde.h"
 #include "ttlib.h"
+#include "dlglib.h"
 #include "helpid.h"
 #include "teraprn.h"
 #include <winsock2.h>
@@ -61,11 +61,13 @@
 #include <stdlib.h>
 #include <string.h>
 #include <locale.h>
+#include <tchar.h>
 
 #include <shlobj.h>
 #include <io.h>
 #include <errno.h>
 #include <imagehlp.h>
+#include <crtdbg.h>
 
 #include <windowsx.h>
 #include <imm.h>
@@ -79,6 +81,7 @@
 #include "sizetip.h"
 #include "dnddlg.h"
 #include "tekwin.h"
+#include <htmlhelp.h>
 #include "compat_win.h"
 
 #include "initguid.h"
@@ -86,12 +89,34 @@
 DEFINE_GUID(GUID_DEVINTERFACE_USB_DEVICE, 0xA5DCBF10L, 0x6530, 0x11D2, 0x90, 0x1F, 0x00, \
              0xC0, 0x4F, 0xB9, 0x51, 0xED);
 
-#define VTClassName "VTWin32"
+#define CFrameWnd	TTCFrameWnd
 
+#define VTClassName _T("VTWin32")
+
+#undef SetDlgItemText
+#define SetDlgItemText SetDlgItemTextA
+#undef CreateProcess
+#define CreateProcess CreateProcessA
+#undef STARTUPINFO
+#define STARTUPINFO STARTUPINFOA
+#undef GetStartupInfo
+#define GetStartupInfo GetStartupInfoA
+
+#if defined(UNICODE)
+#define CreateProcessT CreateProcessW
+#define GetStartupInfoT GetStartupInfoW
+#define STARTUPINFOT STARTUPINFOW
+#define SetDlgItemTextT SetDlgItemTextW
+#else
+#define CreateProcessT CreateProcessA
+#define GetStartupInfoT GetStartupInfoA
+#define STARTUPINFOT STARTUPINFOA
+#define SetDlgItemTextT SetDlgItemTextA
+#endif
+
 #ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
+#define malloc(l)   _malloc_dbg((l), _NORMAL_BLOCK, __FILE__, __LINE__)
+#define new  		::new(_NORMAL_BLOCK, __FILE__, __LINE__)
 #endif
 
 // \x83E\x83B\x83\x93\x83h\x83E\x8Dő剻\x83{\x83^\x83\x93\x82\xF0\x97L\x8C\xF8\x82ɂ\xB7\x82\xE9 (2005.1.15 yutaka)
@@ -103,10 +128,6 @@
 
 #define BROADCAST_LOGFILE "broadcast.log"
 
-static HFONT DlgBroadcastFont;
-static HFONT DlgCommentFont;
-static HFONT DlgSetupdirFont;
-
 static BOOL TCPLocalEchoUsed = FALSE;
 static BOOL TCPCRSendUsed = FALSE;
 
@@ -123,6 +144,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // CVTWindow
 
+#if 0
 BEGIN_MESSAGE_MAP(CVTWindow, CFrameWnd)
 	//{{AFX_MSG_MAP(CVTWindow)
 	ON_WM_ACTIVATE()
@@ -261,11 +283,18 @@
 	ON_COMMAND(ID_HELP_INDEX2, OnHelpIndex)
 	ON_COMMAND(ID_HELP_ABOUT, OnHelpAbout)
 	ON_MESSAGE(WM_USER_DROPNOTIFY, OnDropNotify)
+	ON_MESSAGE(WM_DPICHANGED, OnDpiChanged)
 	//}}AFX_MSG_MAP
 END_MESSAGE_MAP()
+#endif
 
+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)
-void SetMouseCursor(char *cursor)
+static void SetMouseCursor(const char *cursor)
 {
 	HCURSOR hc;
 	LPCTSTR name = NULL;
@@ -300,7 +329,7 @@
 	if (Alpha == alpha) {
 		return;	// \x95ω\xBB\x82Ȃ\xB5\x82Ȃ牽\x82\xE0\x82\xB5\x82Ȃ\xA2
 	}
-	LONG_PTR lp = ::GetWindowLongPtr(HVTWin, GWL_EXSTYLE);
+	LONG_PTR lp = GetWindowLongPtr(GWL_EXSTYLE);
 	if (lp == 0) {
 		return;
 	}
@@ -784,7 +813,7 @@
 #endif
 
 	wc.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
-	wc.lpfnWndProc = AfxWndProc;
+	wc.lpfnWndProc = (WNDPROC)ProcStub;
 	wc.cbClsExtra = 0;
 	wc.cbWndExtra = 0;
 	wc.hInstance = AfxGetInstanceHandle();
@@ -796,7 +825,7 @@
 	wc.lpszClassName = VTClassName;
 
 	RegisterClass(&wc);
-	LoadAccelTable(MAKEINTRESOURCE(IDR_ACC));
+	m_hAccel = ::LoadAccelerators(hInst, MAKEINTRESOURCE(IDR_ACC));
 
 	if (ts.VTPos.x==CW_USEDEFAULT) {
 		rect = rectDefault;
@@ -807,7 +836,7 @@
 		rect.right = rect.left + 100;
 		rect.bottom = rect.top + 100;
 	}
-	Create(VTClassName, "Tera Term", Style, rect, NULL, NULL);
+	Create(hInst, VTClassName, _T("Tera Term"), Style, rect, NULL, NULL);
 
 	/*--------- Init2 -----------------*/
 	HVTWin = GetSafeHwnd();
@@ -824,9 +853,9 @@
 #ifdef ALPHABLEND_TYPE2
 //<!--by AKASI
 	if(BGNoFrame && ts.HideTitle > 0) {
-		ExStyle  = GetWindowLong(HVTWin,GWL_EXSTYLE);
+		ExStyle  = ::GetWindowLongPtr(HVTWin,GWL_EXSTYLE);
 		ExStyle &= ~WS_EX_CLIENTEDGE;
-		SetWindowLong(HVTWin,GWL_EXSTYLE,ExStyle);
+		::SetWindowLongPtr(HVTWin,GWL_EXSTYLE,ExStyle);
 	}
 //-->
 #endif
@@ -906,7 +935,7 @@
 
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef _DEBUG
+#if 0 //def _DEBUG
 void CVTWindow::AssertValid() const
 {
 	CFrameWnd::AssertValid();
@@ -1012,8 +1041,9 @@
 		return;
 	}
 
-	if (mousereport = MouseReport(IdMouseEventBtnDown, LMR, p.x, p.y)) {
-		SetCapture();
+	mousereport = MouseReport(IdMouseEventBtnDown, LMR, p.x, p.y);
+	if (mousereport) {
+		::SetCapture(m_hWnd);
 		return;
 	}
 
@@ -1853,7 +1883,7 @@
 	}
 }
 
-void CVTWindow::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
+void CVTWindow::OnActivate(UINT nState, HWND pWndOther, BOOL bMinimized)
 {
 	DispSetActive(nState!=WA_INACTIVE);
 	if (nState == WA_INACTIVE) {
@@ -2238,6 +2268,7 @@
 				ts.TransBin = DropType == DROP_TYPE_SEND_FILE ? 0 : 1;
 				FileSendStart();
 #if 0
+#if 0
 				goto finish;	// send file\x82͘A\x91\xB1\x82\xB5\x82Ăł\xAB\x82Ȃ\xA2
 #else
 				{
@@ -2251,6 +2282,7 @@
 					}
 				}
 #endif
+#endif
 			}
 			break;
 		case DROP_TYPE_PASTE_FILENAME:
@@ -2320,7 +2352,7 @@
 #endif
 }
 
-void CVTWindow::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
+void CVTWindow::OnHScroll(UINT nSBCode, UINT nPos, HWND pScrollBar)
 {
 	int Func;
 
@@ -2355,9 +2387,9 @@
 	DispHScroll(Func,nPos);
 }
 
-void CVTWindow::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
+void CVTWindow::OnInitMenuPopup(HMENU hPopupMenu, UINT nIndex, BOOL bSysMenu)
 {
-	InitMenuPopup(pPopupMenu->m_hMenu);
+	InitMenuPopup(hPopupMenu);
 }
 
 void CVTWindow::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
@@ -2399,11 +2431,11 @@
 	KeyUp(nChar);
 }
 
-void CVTWindow::OnKillFocus(CWnd* pNewWnd)
+void CVTWindow::OnKillFocus(HWND hNewWnd)
 {
 	DispDestroyCaret();
 	FocusReport(FALSE);
-	CFrameWnd::OnKillFocus(pNewWnd);
+//	CFrameWnd::OnKillFocus(hNewWnd);		// TODO
 
 	if (IsCaretOn()) {
 		CaretKillFocus(TRUE);
@@ -2410,7 +2442,7 @@
 	}
 }
 
-void CVTWindow::OnLButtonDblClk(UINT nFlags, CPoint point)
+void CVTWindow::OnLButtonDblClk(UINT nFlags, POINTS point)
 {
 	if (LButton || MButton || RButton) {
 		return;
@@ -2439,7 +2471,7 @@
 	::SetTimer(HVTWin, IdScrollTimer, 100, NULL);
 }
 
-void CVTWindow::OnLButtonDown(UINT nFlags, CPoint point)
+void CVTWindow::OnLButtonDown(UINT nFlags, POINTS point)
 {
 	POINT p;
 
@@ -2448,7 +2480,7 @@
 	ButtonDown(p,IdLeftButton);
 }
 
-void CVTWindow::OnLButtonUp(UINT nFlags, CPoint point)
+void CVTWindow::OnLButtonUp(UINT nFlags, POINTS point)
 {
 	if (IgnoreRelease)
 		IgnoreRelease = FALSE;
@@ -2463,7 +2495,7 @@
 	ButtonUp(FALSE);
 }
 
-void CVTWindow::OnMButtonDown(UINT nFlags, CPoint point)
+void CVTWindow::OnMButtonDown(UINT nFlags, POINTS point)
 {
 	POINT p;
 
@@ -2472,7 +2504,7 @@
 	ButtonDown(p,IdMiddleButton);
 }
 
-void CVTWindow::OnMButtonUp(UINT nFlags, CPoint point)
+void CVTWindow::OnMButtonUp(UINT nFlags, POINTS point)
 {
 	if (IgnoreRelease)
 		IgnoreRelease = FALSE;
@@ -2493,7 +2525,7 @@
 	}
 }
 
-int CVTWindow::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
+int CVTWindow::OnMouseActivate(HWND pDesktopWnd, UINT nHitTest, UINT message)
 {
 	if ((ts.SelOnActive==0) && (nHitTest==HTCLIENT)) { //disable mouse event for text selection
 		IgnoreRelease = TRUE;
@@ -2504,7 +2536,7 @@
 	}
 }
 
-void CVTWindow::OnMouseMove(UINT nFlags, CPoint point)
+void CVTWindow::OnMouseMove(UINT nFlags, POINTS point)
 {
 	int i;
 	BOOL mousereport;
@@ -2550,9 +2582,13 @@
 BOOL CVTWindow::OnMouseWheel(
 	UINT nFlags,   // \x89\xBC\x91z\x83L\x81[
 	short zDelta,  // \x89\xF1\x93]\x8B\x97\x97\xA3
-	CPoint pt      // \x83J\x81[\x83\\x83\x8B\x88ʒu
+	POINTS pts     // \x83J\x81[\x83\\x83\x8B\x88ʒu
 )
 {
+	POINT pt;
+	pt.x = pts.x;
+	pt.y = pts.y;
+
 	int line, i;
 
 	if (pSetLayeredWindowAttributes != NULL) {
@@ -2606,23 +2642,23 @@
 	return (TRUE);
 }
 
+#if 0
+// \x89\xBD\x82\xE0\x82\xB5\x82Ă\xA2\x82Ȃ\xA2
 void CVTWindow::OnNcCalcSize(BOOL valid, NCCALCSIZE_PARAMS *sizeinfo)
 {
 	CWnd::OnNcCalcSize(valid, sizeinfo);
 	return;
 }
+#endif
 
-void CVTWindow::OnNcLButtonDblClk(UINT nHitTest, CPoint point)
+void CVTWindow::OnNcLButtonDblClk(UINT nHitTest, POINTS point)
 {
 	if (! Minimized && !ts.TermIsWin && (nHitTest == HTCAPTION)) {
 		DispRestoreWinSize();
 	}
-	else {
-		CFrameWnd::OnNcLButtonDblClk(nHitTest,point);
-	}
 }
 
-void CVTWindow::OnNcRButtonDown(UINT nHitTest, CPoint point)
+void CVTWindow::OnNcRButtonDown(UINT nHitTest, POINTS point)
 {
 	if ((nHitTest==HTCAPTION) &&
 	    (ts.HideTitle>0) &&
@@ -2634,12 +2670,11 @@
 void CVTWindow::OnPaint()
 {
 	PAINTSTRUCT ps;
-	CDC *cdc;
 	HDC PaintDC;
 	int Xs, Ys, Xe, Ye;
 
 	// \x95\\x8E\xA6\x82\xB3\x82\xEA\x82Ă\xA2\x82Ȃ\xAD\x82Ă\xE0WM_PAINT\x82\xAA\x94\xAD\x90\xB6\x82\xB7\x82\xE9\x83P\x81[\x83X\x91΍\xF4
-	if (IsWindowVisible() == 0) {
+	if (::IsWindowVisible(m_hWnd) == 0) {
 		return;
 	}
 
@@ -2649,8 +2684,7 @@
 //-->
 #endif
 
-	cdc = BeginPaint(&ps);
-	PaintDC = cdc->GetSafeHdc();
+	PaintDC = BeginPaint(&ps);
 
 	PaintWindow(PaintDC,ps.rcPaint,ps.fErase, &Xs,&Ys,&Xe,&Ye);
 	LockBuffer();
@@ -2670,7 +2704,7 @@
 	}
 }
 
-void CVTWindow::OnRButtonDown(UINT nFlags, CPoint point)
+void CVTWindow::OnRButtonDown(UINT nFlags, POINTS point)
 {
 	POINT p;
 
@@ -2679,7 +2713,7 @@
 	ButtonDown(p,IdRightButton);
 }
 
-void CVTWindow::OnRButtonUp(UINT nFlags, CPoint point)
+void CVTWindow::OnRButtonUp(UINT nFlags, POINTS point)
 {
 	if (IgnoreRelease)
 		IgnoreRelease = FALSE;
@@ -2704,11 +2738,10 @@
 	}
 }
 
-void CVTWindow::OnSetFocus(CWnd* pOldWnd)
+void CVTWindow::OnSetFocus(HWND hOldWnd)
 {
 	ChangeCaret();
 	FocusReport(TRUE);
-	CFrameWnd::OnSetFocus(pOldWnd);
 }
 
 void CVTWindow::OnSize(UINT nType, int cx, int cy)
@@ -2862,7 +2895,7 @@
 		break;
 	}
 
-	CFrameWnd::OnSizing(fwSide, pRect);
+//TODO	CFrameWnd::OnSizing(fwSide, pRect);
 }
 
 void CVTWindow::OnSysChar(UINT nChar, UINT nRepCnt, UINT nFlags)
@@ -2875,7 +2908,7 @@
 	// ALT + x\x82\xF0\x89\x9F\x89\xBA\x82\xB7\x82\xE9\x82\xC6 WM_SYSCHAR \x82\xAA\x94\xF2\x82\xF1\x82ł\xAD\x82\xE9\x81B
 	// ALT + Enter\x82ŃE\x83B\x83\x93\x83h\x83E\x82̍ő剻 (2005.4.24 yutaka)
 	if ((nFlags&0x2000) != 0 && nChar == CR) {
-		if (IsZoomed()) { // window is maximum
+		if (::IsZoomed(m_hWnd)) { // window is maximum
 			ShowWindow(SW_RESTORE);
 		} else {
 			ShowWindow(SW_MAXIMIZE);
@@ -2914,13 +2947,16 @@
 		return;
 	}
 
-	CFrameWnd::OnSysChar(nChar, nRepCnt, nFlags);
+	CFrameWnd::DefWindowProc(WM_SYSCHAR, nChar, MAKELONG(nRepCnt, nFlags));
 }
 
+// \x89\xBD\x82\xE0\x82\xB5\x82Ă\xA2\x82Ȃ\xA2\x81A\x95s\x97v
+#if 0
 void CVTWindow::OnSysColorChange()
 {
 	CFrameWnd::OnSysColorChange();
 }
+#endif
 
 void CVTWindow::OnSysCommand(UINT nID, LPARAM lParam)
 {
@@ -2933,9 +2969,11 @@
 		// now getting host address (see CommOpen() in commlib.c)
 		::PostMessage(HVTWin,WM_SYSCOMMAND,nID,lParam);
 	}
+#if 0
 	else {
 		CFrameWnd::OnSysCommand(nID,lParam);
 	}
+#endif
 }
 
 void CVTWindow::OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
@@ -2959,7 +2997,7 @@
 	}
 }
 
-void CVTWindow::OnTimer(UINT nIDEvent)
+void CVTWindow::OnTimer(UINT_PTR nIDEvent)
 {
 	POINT Point;
 	WORD PortType;
@@ -3009,7 +3047,7 @@
 		case IdComEndTimer:
 			if (! CommCanClose(&cv)) {
 				// wait if received data remains
-				SetTimer(IdComEndTimer,1,NULL);
+				::SetTimer(m_hWnd, IdComEndTimer,1,NULL);
 				break;
 			}
 			cv.Ready = FALSE;
@@ -3045,7 +3083,7 @@
 	}
 }
 
-void CVTWindow::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
+void CVTWindow::OnVScroll(UINT nSBCode, UINT nPos, HWND pScrollBar)
 {
 	int Func;
 	SCROLLINFO si;
@@ -3156,12 +3194,11 @@
 		}
 		break;
 	}
-
-	return CFrameWnd::OnDeviceChange(nEventType, dwData);
+	return TRUE;
 }
 
 //<!--by AKASI
-LONG CVTWindow::OnWindowPosChanging(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnWindowPosChanging(WPARAM wParam, LPARAM lParam)
 {
 #ifdef ALPHABLEND_TYPE2
 	if(BGEnable && BGNoCopyBits) {
@@ -3172,7 +3209,7 @@
 	return CFrameWnd::DefWindowProc(WM_WINDOWPOSCHANGING,wParam,lParam);
 }
 
-LONG CVTWindow::OnSettingChange(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnSettingChange(WPARAM wParam, LPARAM lParam)
 {
 #ifdef ALPHABLEND_TYPE2
 	BGOnSettingChange();
@@ -3180,7 +3217,7 @@
 	return CFrameWnd::DefWindowProc(WM_SETTINGCHANGE,wParam,lParam);
 }
 
-LONG CVTWindow::OnEnterSizeMove(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnEnterSizeMove(WPARAM wParam, LPARAM lParam)
 {
 	EnableSizeTip(1);
 
@@ -3190,7 +3227,7 @@
 	return CFrameWnd::DefWindowProc(WM_ENTERSIZEMOVE,wParam,lParam);
 }
 
-LONG CVTWindow::OnExitSizeMove(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnExitSizeMove(WPARAM wParam, LPARAM lParam)
 {
 #ifdef ALPHABLEND_TYPE2
 	BGOnExitSizeMove();
@@ -3532,14 +3569,14 @@
 	return 0;
 }
 
-LONG CVTWindow::OnChangeTBar(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnChangeTBar(WPARAM wParam, LPARAM lParam)
 {
 	BOOL TBar;
 	DWORD Style,ExStyle;
 	HMENU SysMenu;
 
-	Style = GetWindowLong (HVTWin, GWL_STYLE);
-	ExStyle = GetWindowLong (HVTWin, GWL_EXSTYLE);
+	Style = ::GetWindowLongPtr (HVTWin, GWL_STYLE);
+	ExStyle = ::GetWindowLongPtr (HVTWin, GWL_EXSTYLE);
 	TBar = ((Style & WS_SYSMENU)!=0);
 	if (TBar == (ts.HideTitle==0)) {
 		return 0;
@@ -3575,9 +3612,9 @@
 #endif
 
 	AdjustSize = TRUE;
-	SetWindowLong(HVTWin, GWL_STYLE, Style);
+	::SetWindowLongPtr(HVTWin, GWL_STYLE, Style);
 #ifdef ALPHABLEND_TYPE2
-	SetWindowLong(HVTWin, GWL_EXSTYLE, ExStyle);
+	::SetWindowLongPtr(HVTWin, GWL_EXSTYLE, ExStyle);
 #endif
 	::SetWindowPos(HVTWin, NULL, 0, 0, 0, 0,
 	               SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
@@ -3594,7 +3631,7 @@
 	return 0;
 }
 
-LONG CVTWindow::OnCommNotify(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnCommNotify(WPARAM wParam, LPARAM lParam)
 {
 	switch (LOWORD(lParam)) {
 		case FD_READ:  // TCP/IP
@@ -3618,13 +3655,13 @@
 			cv.OutBuffCount = 0;
 			cv.LineModeBuffCount = 0;
 			cv.FlushLen = 0;
-			SetTimer(IdComEndTimer,1,NULL);
+			::SetTimer(m_hWnd, IdComEndTimer,1,NULL);
 			break;
 	}
 	return 0;
 }
 
-LONG CVTWindow::OnCommOpen(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnCommOpen(WPARAM wParam, LPARAM lParam)
 {
 	AutoDisconnectedPort = -1;
 
@@ -3719,7 +3756,7 @@
 	return 0;
 }
 
-LONG CVTWindow::OnCommStart(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnCommStart(WPARAM wParam, LPARAM lParam)
 {
 	// \x8E\xA9\x93\xAE\x90ڑ\xB1\x82\xAA\x96\xB3\x8C\xF8\x82̂Ƃ\xAB\x82\xE0\x90ڑ\xB1\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x8Fo\x82\xB7\x82悤\x82ɂ\xB5\x82\xBD (2006.9.15 maya)
 	if (((ts.PortType!=IdSerial) && (ts.HostName[0]==0)) ||
@@ -3745,7 +3782,7 @@
 	return 0;
 }
 
-LONG CVTWindow::OnDdeEnd(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnDdeEnd(WPARAM wParam, LPARAM lParam)
 {
 	EndDDE();
 	if (CloseTT) {
@@ -3754,42 +3791,42 @@
 	return 0;
 }
 
-LONG CVTWindow::OnDlgHelp(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnDlgHelp(WPARAM wParam, LPARAM lParam)
 {
 	OpenHelp(HH_HELP_CONTEXT, HelpId, ts.UILanguageFile);
 	return 0;
 }
 
-LONG CVTWindow::OnFileTransEnd(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnFileTransEnd(WPARAM wParam, LPARAM lParam)
 {
 	FileTransEnd(wParam);
 	return 0;
 }
 
-LONG CVTWindow::OnGetSerialNo(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnGetSerialNo(WPARAM wParam, LPARAM lParam)
 {
 	return (LONG)SerialNo;
 }
 
-LONG CVTWindow::OnKeyCode(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnKeyCode(WPARAM wParam, LPARAM lParam)
 {
 	KeyCodeSend(wParam,(WORD)lParam);
 	return 0;
 }
 
-LONG CVTWindow::OnProtoEnd(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnProtoEnd(WPARAM wParam, LPARAM lParam)
 {
 	ProtoDlgCancel();
 	return 0;
 }
 
-LONG CVTWindow::OnChangeTitle(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnChangeTitle(WPARAM wParam, LPARAM lParam)
 {
 	ChangeTitle();
 	return 0;
 }
 
-LONG CVTWindow::OnNotifyIcon(UINT wParam, LONG lParam)
+LRESULT CVTWindow::OnNotifyIcon(WPARAM wParam, LPARAM lParam)
 {
 	if (wParam == 1) {
 		switch (lParam) {
@@ -4176,11 +4213,12 @@
 
 static LRESULT CALLBACK OnCommentDlgProc(HWND hDlgWnd, UINT msg, WPARAM wp, LPARAM lp)
 {
+	static const DlgTextInfo TextInfos[] = {
+		{ 0, "DLG_COMMENT_TITLE" },
+		{ IDOK, "BTN_OK" }
+	};
 	char buf[256];
 	UINT ret;
-	LOGFONT logfont;
-	HFONT font;
-	char uimsg[MAX_UIMSG];
 
 	switch (msg) {
 		case WM_INITDIALOG:
@@ -4187,24 +4225,7 @@
 			//SetDlgItemText(hDlgWnd, IDC_EDIT_COMMENT, "\x83T\x83\x93\x83v\x83\x8B");
 			// \x83G\x83f\x83B\x83b\x83g\x83R\x83\x93\x83g\x83\x8D\x81[\x83\x8B\x82Ƀt\x83H\x81[\x83J\x83X\x82\xF0\x82\xA0\x82Ă\xE9
 			SetFocus(GetDlgItem(hDlgWnd, IDC_EDIT_COMMENT));
-
-			font = (HFONT)SendMessage(hDlgWnd, WM_GETFONT, 0, 0);
-			GetObject(font, sizeof(LOGFONT), &logfont);
-			if (get_lang_font("DLG_SYSTEM_FONT", hDlgWnd, &logfont, &DlgCommentFont, ts.UILanguageFile)) {
-				SendDlgItemMessage(hDlgWnd, IDC_EDIT_COMMENT, WM_SETFONT, (WPARAM)DlgCommentFont, MAKELPARAM(TRUE,0));
-				SendDlgItemMessage(hDlgWnd, IDOK, WM_SETFONT, (WPARAM)DlgCommentFont, MAKELPARAM(TRUE,0));
-			}
-			else {
-				DlgCommentFont = NULL;
-			}
-
-			GetWindowText(hDlgWnd, uimsg, sizeof(uimsg));
-			get_lang_msg("DLG_COMMENT_TITLE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-			SetWindowText(hDlgWnd, ts.UIMsg);
-			GetDlgItemText(hDlgWnd, IDOK, uimsg, sizeof(uimsg));
-			get_lang_msg("BTN_OK", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-			SetDlgItemText(hDlgWnd, IDOK, ts.UIMsg);
-
+			SetDlgTexts(hDlgWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile);
 			return FALSE;
 
 		case WM_COMMAND:
@@ -4211,21 +4232,18 @@
 			switch (LOWORD(wp)) {
 				case IDOK:
 					memset(buf, 0, sizeof(buf));
-					ret = GetDlgItemText(hDlgWnd, IDC_EDIT_COMMENT, buf, sizeof(buf) - 1);
+					ret = GetDlgItemTextA(hDlgWnd, IDC_EDIT_COMMENT, buf, sizeof(buf) - 1);
 					if (ret > 0) { // \x83e\x83L\x83X\x83g\x8E擾\x90\xAC\x8C\xF7
 						//buf[sizeof(buf) - 1] = '\0';  // null-terminate
 						CommentLogToFile(buf, ret);
 					}
-					if (DlgCommentFont != NULL) {
-						DeleteObject(DlgCommentFont);
-					}
-					EndDialog(hDlgWnd, IDOK);
+					TTEndDialog(hDlgWnd, IDOK);
 					break;
 				default:
 					return FALSE;
 			}
 		case WM_CLOSE:
-			EndDialog(hDlgWnd, 0);
+			TTEndDialog(hDlgWnd, 0);
 			return TRUE;
 
 		default:
@@ -4236,18 +4254,11 @@
 
 void CVTWindow::OnCommentToLog()
 {
-	DWORD ret;
-
 	// \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)
-	ret = DialogBox(hInst, MAKEINTRESOURCE(IDD_COMMENT_DIALOG),
-	                HVTWin, (DLGPROC)OnCommentDlgProc);
-	if (ret == 0 || ret == -1) {
-		ret = GetLastError();
-	}
-
+	TTDialogBox(hInst, MAKEINTRESOURCE(IDD_COMMENT_DIALOG),
+				HVTWin, (DLGPROC)OnCommentDlgProc);
 }
 
-
 // \x83\x8D\x83O\x82̉{\x97\x97 (2005.1.29 yutaka)
 void CVTWindow::OnViewLog()
 {
@@ -4666,6 +4677,55 @@
 	DispSetupFontDlg();
 }
 
+static BOOL CALLBACK TFontHook(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam)
+{
+	if (Message == WM_INITDIALOG) {
+		TCHAR uimsg[MAX_UIMSG];
+		get_lang_msgT("DLG_CHOOSEFONT_STC6", uimsg, _countof(uimsg),
+					  _T("\"Font style\" selection here won't affect actual font appearance."), ts.UILanguageFile);
+		SetDlgItemTextT(Dialog, stc6, uimsg);
+	}
+	return FALSE;
+}
+
+void CVTWindow::OnSetupDlgFont()
+{
+	LOGFONTA LogFont;
+	CHOOSEFONTA cf;
+	BOOL result;
+	result = GetI18nLogfont("Tera Term", "DlgFont", &LogFont, 0, ts.SetupFName);
+	if (result == FALSE) {
+		memset(&LogFont, 0, sizeof(LogFont));
+	}
+
+	memset(&cf, 0, sizeof(cf));
+	cf.lStructSize = sizeof(cf);
+	cf.hwndOwner = HVTWin;
+	cf.lpLogFont = &LogFont;
+	cf.Flags =
+		CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT |
+		CF_SHOWHELP | CF_NOVERTFONTS |
+		CF_ENABLEHOOK;
+#if (WINVER >= _WIN32_WINNT_WIN7) && defined(CF_INACTIVEFONTS)
+	if (IsWindows7OrLater() && ts.ListHiddenFonts) {
+		cf.Flags |= CF_INACTIVEFONTS;
+	}
+#endif
+	cf.lpfnHook = (LPCFHOOKPROC)(&TFontHook);
+	cf.nFontType = REGULAR_FONTTYPE;
+	cf.hInstance = hInst;
+	HelpId = HlpSetupFont;
+	result = ChooseFontA(&cf);
+	if (result) {
+		char Temp[80];
+		_snprintf_s(Temp, sizeof(Temp), _TRUNCATE, "%s,%d,%d",
+					LogFont.lfFaceName, LogFont.lfHeight, LogFont.lfCharSet);
+		WritePrivateProfileStringA("Tera Term", "DlgFont", Temp, ts.SetupFName);
+
+		SetDialogFont(ts.SetupFName, ts.UILanguageFile, "TTSSH");
+	}
+}
+
 void CVTWindow::OnSetupKeyboard()
 {
 	BOOL Ok;
@@ -4774,7 +4834,7 @@
 		int w, h;
 
 #ifdef WINDOW_MAXMIMUM_ENABLED
-		if (IsZoomed()) {
+		if (::IsZoomed(m_hWnd)) {
 			w = ts.TerminalWidth;
 			h = ts.TerminalHeight;
 			ts.TerminalWidth = ts.TerminalOldWidth;
@@ -4790,7 +4850,7 @@
 		FreeTTSET();
 
 #ifdef WINDOW_MAXMIMUM_ENABLED
-		if (IsZoomed()) {
+		if (::IsZoomed(m_hWnd)) {
 			ts.TerminalWidth = w;
 			ts.TerminalHeight = h;
 		}
@@ -5012,11 +5072,18 @@
 
 static LRESULT CALLBACK OnSetupDirectoryDlgProc(HWND hDlgWnd, UINT msg, WPARAM wp, LPARAM lp)
 {
+	static const DlgTextInfo TextInfos[] = {
+		{ 0, "DLG_SETUPDIR_TITLE" },
+		{ IDC_INI_SETUPDIR_GROUP, "DLG_SETUPDIR_INIFILE" },
+		{ IDC_KEYCNF_SETUPDIR_GROUP, "DLG_SETUPDIR_KEYBOARDFILE" },
+		{ IDC_CYGTERM_SETUPDIR_GROUP, "DLG_SETUPDIR_CYGTERMFILE" },
+		{ IDC_SSH_SETUPDIR_GROUP, "DLG_SETUPDIR_KNOWNHOSTSFILE" },
+	};
 	static char teratermexepath[MAX_PATH];
 	static char inipath[MAX_PATH], inifilename[MAX_PATH], inipath_vstore[1024];
 	static char keycnfpath[MAX_PATH], keycnffilename[MAX_PATH], keycnfpath_vstore[1024];
 	static char cygtermpath[MAX_PATH], cygtermfilename[MAX_PATH], cygtermpath_vstore[1024];
-	static char eterm1path[MAX_PATH], eterm1filename[MAX_PATH], eterm1path_vstore[1024];
+//	static char eterm1path[MAX_PATH], eterm1filename[MAX_PATH], eterm1path_vstore[1024];
 	char temp[MAX_PATH];
 	char tmpbuf[1024];
 	typedef int (CALLBACK *PSSH_read_known_hosts_file)(char *, int);
@@ -5027,65 +5094,13 @@
 	BOOL open_dir, ret;
 	int button_pressed;
 	HWND hWnd;
-	LOGFONT logfont;
-	HFONT font;
-	char uimsg[MAX_UIMSG];
 
 	switch (msg) {
 	case WM_INITDIALOG:
 		// I18N
-		font = (HFONT)SendMessage(hDlgWnd, WM_GETFONT, 0, 0);
-		GetObject(font, sizeof(LOGFONT), &logfont);
-		if (get_lang_font("DLG_TAHOMA_FONT", hDlgWnd, &logfont, &DlgSetupdirFont, ts.UILanguageFile)) {
-			SendDlgItemMessage(hDlgWnd, IDC_INI_SETUPDIR_GROUP, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_INI_SETUPDIR_EDIT, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_INI_SETUPDIR_BUTTON, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_INI_SETUPDIR_BUTTON_FILE, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_INI_SETUPDIR_STATIC_VSTORE, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_INI_SETUPDIR_EDIT_VSTORE, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_KEYCNF_SETUPDIR_GROUP, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_KEYCNF_SETUPDIR_EDIT, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_KEYCNF_SETUPDIR_BUTTON, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_KEYCNF_SETUPDIR_BUTTON_FILE, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_KEYCNF_SETUPDIR_STATIC_VSTORE, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_KEYCNF_SETUPDIR_EDIT_VSTORE, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_CYGTERM_SETUPDIR_GROUP, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_CYGTERM_SETUPDIR_EDIT, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_CYGTERM_SETUPDIR_BUTTON, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_CYGTERM_SETUPDIR_BUTTON_FILE, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_CYGTERM_SETUPDIR_STATIC_VSTORE, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_CYGTERM_SETUPDIR_EDIT_VSTORE, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_SSH_SETUPDIR_GROUP, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_SSH_SETUPDIR_EDIT, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_SSH_SETUPDIR_BUTTON, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_SSH_SETUPDIR_BUTTON_FILE, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_SSH_SETUPDIR_STATIC_VSTORE, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-			SendDlgItemMessage(hDlgWnd, IDC_SSH_SETUPDIR_EDIT_VSTORE, WM_SETFONT, (WPARAM)DlgSetupdirFont, MAKELPARAM(TRUE,0));
-		} else {
-			DlgSetupdirFont = NULL;
-		}
+		SetDlgTexts(hDlgWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile);
 
-		GetWindowText(hDlgWnd, uimsg, sizeof(uimsg));
-		get_lang_msg("DLG_SETUPDIR_TITLE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-		SetWindowText(hDlgWnd, ts.UIMsg);
-
-		GetDlgItemText(hDlgWnd, IDC_INI_SETUPDIR_GROUP, uimsg, sizeof(uimsg));
-		get_lang_msg("DLG_SETUPDIR_INIFILE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-		SetDlgItemText(hDlgWnd, IDC_INI_SETUPDIR_GROUP, ts.UIMsg);
-
-		GetDlgItemText(hDlgWnd, IDC_KEYCNF_SETUPDIR_GROUP, uimsg, sizeof(uimsg));
-		get_lang_msg("DLG_SETUPDIR_KEYBOARDFILE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-		SetDlgItemText(hDlgWnd, IDC_KEYCNF_SETUPDIR_GROUP, ts.UIMsg);
-
-		GetDlgItemText(hDlgWnd, IDC_CYGTERM_SETUPDIR_GROUP, uimsg, sizeof(uimsg));
-		get_lang_msg("DLG_SETUPDIR_CYGTERMFILE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-		SetDlgItemText(hDlgWnd, IDC_CYGTERM_SETUPDIR_GROUP, ts.UIMsg);
-
-		GetDlgItemText(hDlgWnd, IDC_SSH_SETUPDIR_GROUP, uimsg, sizeof(uimsg));
-		get_lang_msg("DLG_SETUPDIR_KNOWNHOSTSFILE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-		SetDlgItemText(hDlgWnd, IDC_SSH_SETUPDIR_GROUP, ts.UIMsg);
-
-		if (GetModuleFileName(NULL, temp, sizeof(temp)) != 0) {
+		if (GetModuleFileNameA(NULL, temp, sizeof(temp)) != 0) {
 			ExtractDirName(temp, teratermexepath);
 		}
 
@@ -5299,10 +5314,7 @@
 			break;
 
 		case IDCANCEL:
-			if (DlgSetupdirFont != NULL) {
-				DeleteObject(DlgSetupdirFont);
-			}
-			EndDialog(hDlgWnd, IDCANCEL);
+			TTEndDialog(hDlgWnd, IDCANCEL);
 			break;
 
 		default:
@@ -5322,7 +5334,7 @@
 		}
 
 	case WM_CLOSE:
-		EndDialog(hDlgWnd, 0);
+		TTEndDialog(hDlgWnd, 0);
 		return TRUE;
 
 	default:
@@ -5339,11 +5351,8 @@
 //
 void CVTWindow::OnOpenSetupDirectory()
 {
-	int ret;
-
-	ret = DialogBox(hInst, MAKEINTRESOURCE(IDD_SETUP_DIR_DIALOG),
-		HVTWin, (DLGPROC)OnSetupDirectoryDlgProc);
-
+	TTDialogBox(hInst, MAKEINTRESOURCE(IDD_SETUP_DIR_DIALOG),
+	            HVTWin, (DLGPROC)OnSetupDirectoryDlgProc);
 }
 
 void CVTWindow::OnSetupLoadKeyMap()
@@ -5662,13 +5671,19 @@
 //
 static LRESULT CALLBACK BroadcastCommandDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
 {
+	static const DlgTextInfo TextInfos[] = {
+		{ 0, "DLG_BROADCAST_TITLE" },
+		{ IDC_HISTORY_CHECK, "DLG_BROADCAST_HISTORY" },
+		{ IDC_ENTERKEY_CHECK, "DLG_BROADCAST_ENTER" },
+		{ IDC_PARENT_ONLY, "DLG_BROADCAST_PARENTONLY" },
+		{ IDC_REALTIME_CHECK, "DLG_BROADCAST_REALTIME" },
+		{ IDOK, "DLG_BROADCAST_SUBMIT" },
+		{ IDCANCEL, "BTN_CLOSE" },
+	};
 	char buf[256 + 3];
 	UINT ret;
 	LRESULT checked;
 	LRESULT history;
-	LOGFONT logfont;
-	HFONT font;
-	char uimsg[MAX_UIMSG];
 	char historyfile[MAX_PATH];
 	static HWND hwndBroadcast     = NULL; // Broadcast dropdown
 	static HWND hwndBroadcastEdit = NULL; // Edit control on Broadcast dropdown
@@ -5711,8 +5726,8 @@
 			// \x83T\x83u\x83N\x83\x89\x83X\x89\xBB\x82\xB3\x82\xB9\x82ă\x8A\x83A\x83\x8B\x83^\x83C\x83\x80\x83\x82\x81[\x83h\x82ɂ\xB7\x82\xE9 (2008.1.21 yutaka)
 			hwndBroadcast = GetDlgItem(hWnd, IDC_COMMAND_EDIT);
 			hwndBroadcastEdit = GetWindow(hwndBroadcast, GW_CHILD);
-			OrigBroadcastEditProc = (WNDPROC)GetWindowLong(hwndBroadcastEdit, GWL_WNDPROC);
-			SetWindowLong(hwndBroadcastEdit, GWL_WNDPROC, (LONG)BroadcastEditProc);
+			OrigBroadcastEditProc = (WNDPROC)GetWindowLongPtr(hwndBroadcastEdit, GWLP_WNDPROC);
+			SetWindowLongPtr(hwndBroadcastEdit, GWLP_WNDPROC, (LONG_PTR)BroadcastEditProc);
 			// \x83f\x83t\x83H\x83\x8B\x83g\x82\xCDon\x81B\x8Ec\x82\xE8\x82\xCDdisable\x81B
 			SendMessage(GetDlgItem(hWnd, IDC_REALTIME_CHECK), BM_SETCHECK, BST_CHECKED, 0);  // default on
 			EnableWindow(GetDlgItem(hWnd, IDC_HISTORY_CHECK), FALSE);
@@ -5726,44 +5741,8 @@
 			BroadcastWindowList = GetDlgItem(hWnd, IDC_LIST);
 			UpdateBroadcastWindowList(BroadcastWindowList);
 
-			font = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0);
-			GetObject(font, sizeof(LOGFONT), &logfont);
-			if (get_lang_font("DLG_SYSTEM_FONT", hWnd, &logfont, &DlgBroadcastFont, ts.UILanguageFile)) {
-				SendDlgItemMessage(hWnd, IDC_COMMAND_EDIT, WM_SETFONT, (WPARAM)DlgBroadcastFont, MAKELPARAM(TRUE,0));
-				SendDlgItemMessage(hWnd, IDC_HISTORY_CHECK, WM_SETFONT, (WPARAM)DlgBroadcastFont, MAKELPARAM(TRUE,0));
-				SendDlgItemMessage(hWnd, IDC_RADIO_CRLF, WM_SETFONT, (WPARAM)DlgBroadcastFont, MAKELPARAM(TRUE,0));
-				SendDlgItemMessage(hWnd, IDC_RADIO_CR, WM_SETFONT, (WPARAM)DlgBroadcastFont, MAKELPARAM(TRUE,0));
-				SendDlgItemMessage(hWnd, IDC_RADIO_LF, WM_SETFONT, (WPARAM)DlgBroadcastFont, MAKELPARAM(TRUE,0));
-				SendDlgItemMessage(hWnd, IDC_ENTERKEY_CHECK, WM_SETFONT, (WPARAM)DlgBroadcastFont, MAKELPARAM(TRUE,0));
-				SendDlgItemMessage(hWnd, IDC_PARENT_ONLY, WM_SETFONT, (WPARAM)DlgBroadcastFont, MAKELPARAM(TRUE,0));	// 337: 2007/03/20
-				SendDlgItemMessage(hWnd, IDC_REALTIME_CHECK, WM_SETFONT, (WPARAM)DlgBroadcastFont, MAKELPARAM(TRUE,0));
-				SendDlgItemMessage(hWnd, IDOK, WM_SETFONT, (WPARAM)DlgBroadcastFont, MAKELPARAM(TRUE,0));
-				SendDlgItemMessage(hWnd, IDCANCEL, WM_SETFONT, (WPARAM)DlgBroadcastFont, MAKELPARAM(TRUE,0));
-			}
-			else {
-				DlgBroadcastFont = NULL;
-			}
-			GetWindowText(hWnd, uimsg, sizeof(uimsg));
-			get_lang_msg("DLG_BROADCAST_TITLE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-			SetWindowText(hWnd, ts.UIMsg);
-			GetDlgItemText(hWnd, IDC_HISTORY_CHECK, uimsg, sizeof(uimsg));
-			get_lang_msg("DLG_BROADCAST_HISTORY", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-			SetDlgItemText(hWnd, IDC_HISTORY_CHECK, ts.UIMsg);
-			GetDlgItemText(hWnd, IDC_ENTERKEY_CHECK, uimsg, sizeof(uimsg));
-			get_lang_msg("DLG_BROADCAST_ENTER", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-			SetDlgItemText(hWnd, IDC_ENTERKEY_CHECK, ts.UIMsg);
-			GetDlgItemText(hWnd, IDC_PARENT_ONLY, uimsg, sizeof(uimsg));
-			get_lang_msg("DLG_BROADCAST_PARENTONLY", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-			SetDlgItemText(hWnd, IDC_PARENT_ONLY, ts.UIMsg);
-			GetDlgItemText(hWnd, IDC_REALTIME_CHECK, uimsg, sizeof(uimsg));
-			get_lang_msg("DLG_BROADCAST_REALTIME", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-			SetDlgItemText(hWnd, IDC_REALTIME_CHECK, ts.UIMsg);
-			GetDlgItemText(hWnd, IDOK, uimsg, sizeof(uimsg));
-			get_lang_msg("DLG_BROADCAST_SUBMIT", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-			SetDlgItemText(hWnd, IDOK, ts.UIMsg);
-			GetDlgItemText(hWnd, IDCANCEL, uimsg, sizeof(uimsg));
-			get_lang_msg("BTN_CLOSE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-			SetDlgItemText(hWnd, IDCANCEL, ts.UIMsg);
+			// I18N
+			SetDlgTexts(hWnd, TextInfos, _countof(TextInfos), ts.UILanguageFile);
 
 			// \x83_\x83C\x83A\x83\x8D\x83O\x82̏\x89\x8A\xFA\x83T\x83C\x83Y\x82\xF0\x95ۑ\xB6
 			GetWindowRect(hWnd, &rc_dlg);
@@ -5823,8 +5802,8 @@
 					// new handler
 					hwndBroadcast = GetDlgItem(hWnd, IDC_COMMAND_EDIT);
 					hwndBroadcastEdit = GetWindow(hwndBroadcast, GW_CHILD);
-					OrigBroadcastEditProc = (WNDPROC)GetWindowLong(hwndBroadcastEdit, GWL_WNDPROC);
-					SetWindowLong(hwndBroadcastEdit, GWL_WNDPROC, (LONG)BroadcastEditProc);
+					OrigBroadcastEditProc = (WNDPROC)GetWindowLongPtr(hwndBroadcastEdit, GWLP_WNDPROC);
+					SetWindowLongPtr(hwndBroadcastEdit, GWLP_WNDPROC, (LONG_PTR)BroadcastEditProc);
 
 					EnableWindow(GetDlgItem(hWnd, IDC_HISTORY_CHECK), FALSE);
 					EnableWindow(GetDlgItem(hWnd, IDC_RADIO_CRLF), FALSE);
@@ -5835,7 +5814,7 @@
 					EnableWindow(GetDlgItem(hWnd, IDC_LIST), TRUE);  // true
 				} else {
 					// restore old handler
-					SetWindowLong(hwndBroadcastEdit, GWL_WNDPROC, (LONG)OrigBroadcastEditProc);
+					SetWindowLongPtr(hwndBroadcastEdit, GWLP_WNDPROC, (LONG_PTR)OrigBroadcastEditProc);
 
 					EnableWindow(GetDlgItem(hWnd, IDC_HISTORY_CHECK), TRUE);
 					EnableWindow(GetDlgItem(hWnd, IDC_RADIO_CRLF), TRUE);
@@ -5910,7 +5889,7 @@
 					// \x83\x82\x81[\x83h\x83\x8C\x83X\x83_\x83C\x83A\x83\x8D\x83O\x82͈\xEA\x93x\x90\xB6\x90\xAC\x82\xB3\x82\xEA\x82\xE9\x82ƁA\x83A\x83v\x83\x8A\x83P\x81[\x83V\x83\x87\x83\x93\x82\xAA\x8FI\x97\xB9\x82\xB7\x82\xE9\x82܂\xC5
 					// \x94j\x8A\xFC\x82\xB3\x82\xEA\x82Ȃ\xA2\x82̂ŁA\x88ȉ\xBA\x82́u\x83E\x83B\x83\x93\x83h\x83E\x83v\x83\x8D\x83V\x81[\x83W\x83\x83\x96߂\xB5\x81v\x82͕s\x97v\x82Ǝv\x82\xED\x82\xEA\x82\xE9\x81B(yutaka)
 #if 0
-					SetWindowLong(hwndBroadcastEdit, GWL_WNDPROC, (LONG)OrigBroadcastEditProc);
+					SetWindowLongPtr(hwndBroadcastEdit, GWLP_WNDPROC, (LONG_PTR)OrigBroadcastEditProc);
 #endif
 
 					//EndDialog(hDlgWnd, IDOK);
@@ -5962,9 +5941,6 @@
 		case WM_CLOSE:
 			//DestroyWindow(hWnd);
 			EndDialog(hWnd, 0);
-			if (DlgBroadcastFont != NULL) {
-				DeleteObject(DlgBroadcastFont);
-			}
 			return TRUE;
 
 		case WM_SIZE:
@@ -6162,7 +6138,7 @@
 	// \x82\xE6\x82\xC1\x82čs\x82\xED\x82\xEA\x82\xE9\x81B
 	// \x82\xB5\x82\xA9\x82\xB5\x94\xF1\x83A\x83N\x83e\x83B\x83u\x82ȃE\x83B\x83\x93\x83h\x83E\x82ł\xCD OnIdle() \x82\xAA\x8CĂ΂\xEA\x82Ȃ\xA2\x82̂ŁA
 	// \x8B\xF3\x82̃\x81\x83b\x83Z\x81[\x83W\x82𑗂\xC1\x82\xC4 OnIdle() \x82\xAA\x8CĂ΂\xEA\x82\xE9\x82悤\x82ɂ\xB7\x82\xE9\x81B
-	PostMessage(WM_NULL, 0, 0);
+	::PostMessage(m_hWnd, WM_NULL, 0, 0);
 
 	return 1; // \x91\x97\x90M\x82ł\xAB\x82\xBD\x8Fꍇ\x82\xCD1\x82\xF0\x95Ԃ\xB7
 }
@@ -6251,3 +6227,334 @@
 	(*AboutDialog)(HVTWin);
 	FreeTTDLG();
 }
+
+LRESULT CVTWindow::OnDpiChanged(WPARAM wParam, LPARAM lParam)
+{
+	static DWORD preTime = 0;
+	DWORD currentTime = GetTickCount();
+	if (currentTime - preTime < 1000) {
+		return 0;
+	}
+	preTime = currentTime;
+
+	DpiChanged();
+	return TRUE;
+}
+
+LRESULT CVTWindow::Proc(UINT msg, WPARAM wp, LPARAM lp)
+{
+	LRESULT retval = 0;
+	if (msg == MsgDlgHelp) {
+		OnDlgHelp(wp,lp);
+		return 0;
+	}
+	switch(msg)
+	{
+	case WM_ACTIVATE:
+		OnActivate(wp & 0xFFFF, (HWND)wp, (wp >> 16) & 0xFFFF);
+		break;
+	case WM_CHAR:
+		OnChar(wp, LOWORD(lp), HIWORD(lp));
+		break;
+	case WM_CLOSE:
+		OnClose();
+		break;
+	case WM_DESTROY:
+		OnDestroy();
+		PostQuitMessage(0);
+		break;
+	case WM_DROPFILES:
+		OnDropFiles((HDROP)wp);
+		break;
+	case WM_GETMINMAXINFO:
+		OnGetMinMaxInfo((MINMAXINFO *)lp);
+		break;
+	case WM_HSCROLL:
+		OnHScroll(LOWORD(wp), HIWORD(wp), (HWND)lp);
+		break;
+	case WM_INITMENUPOPUP:
+		OnInitMenuPopup((HMENU)wp, LOWORD(lp), HIWORD(lp));
+		break;
+	case WM_KEYDOWN:
+		OnKeyDown(wp, LOWORD(lp), HIWORD(lp));
+		break;
+	case WM_KEYUP:
+		OnKeyUp(wp, LOWORD(lp), HIWORD(lp));
+		break;
+	case WM_KILLFOCUS:
+		OnKillFocus((HWND)wp);
+		break;
+	case WM_LBUTTONDBLCLK:
+		OnLButtonDblClk(wp, MAKEPOINTS(lp));
+		break;
+	case WM_LBUTTONDOWN:
+		OnLButtonDown(wp, MAKEPOINTS(lp));
+		break;
+	case WM_LBUTTONUP:
+		OnLButtonUp(wp, MAKEPOINTS(lp));
+		break;
+	case WM_MBUTTONDOWN:
+		OnMButtonDown(wp, MAKEPOINTS(lp));
+		break;
+	case WM_MBUTTONUP:
+		OnMButtonUp(wp, MAKEPOINTS(lp));
+		break;
+	case WM_MOUSEACTIVATE:
+		OnMouseActivate((HWND)wp, LOWORD(lp), HIWORD(lp));
+		break;
+	case WM_MOUSEMOVE:
+		OnMouseMove(wp, MAKEPOINTS(lp));
+		break;
+	case WM_MOUSEWHEEL:
+		OnMouseWheel(GET_KEYSTATE_WPARAM(wp), GET_WHEEL_DELTA_WPARAM(wp), MAKEPOINTS(lp));
+		break;
+	case WM_MOVE:
+		OnMove(LOWORD(lp), HIWORD(lp));
+		break;
+	case WM_NCLBUTTONDBLCLK:
+		OnNcLButtonDblClk((UINT)wp, MAKEPOINTS(lp));
+		DefWindowProc(msg, wp, lp);
+		break;
+	case WM_NCRBUTTONDOWN:
+		OnNcRButtonDown((UINT)wp, MAKEPOINTS(lp));
+		break;
+#if 0
+		// \x89\xBD\x82\xE0\x82\xB5\x82Ă\xA2\x82Ȃ\xA2
+	case WM_NCCALCSIZE:
+		break;
+#endif
+	case WM_PAINT:
+		OnPaint();
+		break;
+	case WM_RBUTTONDOWN:
+		OnRButtonDown((UINT)wp, MAKEPOINTS(lp));
+		break;
+	case WM_RBUTTONUP:
+		OnRButtonUp((UINT)wp, MAKEPOINTS(lp));
+		break;
+	case WM_SETFOCUS:
+		OnSetFocus((HWND)wp);
+		DefWindowProc(msg, wp, lp);
+		break;
+	case WM_SIZE:
+		OnSize(wp, LOWORD(lp), HIWORD(lp));
+		break;
+	case WM_SIZING:
+		OnSizing(wp, (LPRECT)lp);
+		break;
+#if 1
+	case WM_SYSCHAR:
+		OnSysChar(wp, LOWORD(lp), HIWORD(lp));
+		break;
+#endif
+#if 0	// \x89\xBD\x82\xE0\x82\xB5\x82Ă\xA2\x82Ȃ\xA2\x81A\x95s\x97v
+	case WM_SYSCOLORCHANGE:
+		break;
+#endif
+	case WM_SYSCOMMAND:
+		OnSysCommand(wp, lp);
+		DefWindowProc(msg, wp, lp);
+		break;
+	case WM_SYSKEYDOWN:
+		OnSysKeyDown(wp, LOWORD(lp), HIWORD(lp));
+		break;
+	case WM_SYSKEYUP:
+		OnSysKeyUp(wp, LOWORD(lp), HIWORD(lp));
+		break;
+	case WM_TIMER:
+		OnTimer(wp);
+		break;
+	case WM_VSCROLL:
+		OnVScroll(LOWORD(wp), HIWORD(wp), (HWND)lp);
+		break;
+	case WM_DEVICECHANGE:
+		OnDeviceChange((UINT)wp, (DWORD_PTR)lp);
+		DefWindowProc(msg, wp, lp);
+		break;
+	case WM_IME_STARTCOMPOSITION :
+		OnIMEStartComposition(wp, lp);
+		break;
+	case WM_IME_ENDCOMPOSITION :
+		OnIMEEndComposition(wp, lp);
+		break;
+	case WM_IME_COMPOSITION:
+		OnIMEComposition(wp, lp);
+		break;
+	case WM_INPUTLANGCHANGE:
+		OnIMEInputChange(wp, lp);
+		break;
+	case WM_IME_NOTIFY:
+		OnIMENotify(wp, lp);
+		break;
+	case WM_IME_REQUEST:
+		OnIMERequest(wp, lp);
+		break;
+	case WM_WINDOWPOSCHANGING:
+		OnWindowPosChanging(wp, lp);
+		break;
+	case WM_SETTINGCHANGE:
+		OnSettingChange(wp, lp);
+		break;
+	case WM_ENTERSIZEMOVE:
+		OnEnterSizeMove(wp, lp);
+		break;
+	case WM_EXITSIZEMOVE :
+		OnExitSizeMove(wp, lp);
+		break;
+	case WM_USER_ACCELCOMMAND:
+		OnAccelCommand(wp, lp);
+		break;
+	case WM_USER_CHANGEMENU:
+		OnChangeMenu(wp, lp);
+		break;
+	case WM_USER_CHANGETBAR:
+		OnChangeTBar(wp, lp);
+		break;
+	case WM_USER_COMMNOTIFY:
+		OnCommNotify(wp, lp);
+		break;
+	case WM_USER_COMMOPEN:
+		OnCommOpen(wp, lp);
+		break;
+	case WM_USER_COMMSTART:
+		OnCommStart(wp, lp);
+		break;
+	case WM_USER_DDEEND:
+		OnDdeEnd(wp, lp);
+		break;
+	case WM_USER_DLGHELP2:
+		OnDlgHelp(wp, lp);
+		break;
+	case WM_USER_FTCANCEL:
+		OnFileTransEnd(wp, lp);
+		break;
+	case WM_USER_GETSERIALNO:
+		OnGetSerialNo(wp, lp);
+		break;
+	case WM_USER_KEYCODE:
+		OnKeyCode(wp, lp);
+		break;
+	case WM_USER_PROTOCANCEL:
+		OnProtoEnd(wp, lp);
+		break;
+	case WM_USER_CHANGETITLE:
+		OnChangeTitle(wp, lp);
+		break;
+	case WM_COPYDATA:
+		OnReceiveIpcMessage(wp, lp);
+		break;
+	case WM_USER_NONCONFIRM_CLOSE:
+		OnNonConfirmClose(wp, lp);
+		break;
+	case WM_USER_NOTIFYICON:
+		OnNotifyIcon(wp, lp);
+		break;
+	case WM_USER_DROPNOTIFY:
+		OnDropNotify(wp, lp);
+		break;
+	case WM_DPICHANGED:
+		OnDpiChanged(wp, lp);
+		break;
+	case WM_COMMAND:
+	{
+		const WORD wID = GET_WM_COMMAND_ID(wp, lp);
+		switch (wID) {
+		case ID_FILE_NEWCONNECTION: OnFileNewConnection(); break;
+		case ID_FILE_DUPLICATESESSION: OnDuplicateSession(); break;
+		case ID_FILE_CYGWINCONNECTION: OnCygwinConnection(); break;
+		case ID_FILE_TERATERMMENU: OnTTMenuLaunch(); break;
+		case ID_FILE_LOGMEIN: OnLogMeInLaunch(); break;
+		case ID_FILE_LOG: OnFileLog(); break;
+		case ID_FILE_COMMENTTOLOG: OnCommentToLog(); break;
+		case ID_FILE_VIEWLOG: OnViewLog(); break;
+		case ID_FILE_SHOWLOGDIALOG: OnShowLogDialog(); break;
+		case ID_FILE_REPLAYLOG: OnReplayLog(); break;
+		case ID_FILE_SENDFILE: OnFileSend(); break;
+		case ID_FILE_KERMITRCV: OnFileKermitRcv(); break;
+		case ID_FILE_KERMITGET: OnFileKermitGet(); break;
+		case ID_FILE_KERMITSEND: OnFileKermitSend(); break;
+		case ID_FILE_KERMITFINISH: OnFileKermitFinish(); break;
+		case ID_FILE_XRCV: OnFileXRcv(); break;
+		case ID_FILE_XSEND: OnFileXSend(); break;
+		case ID_FILE_YRCV: OnFileYRcv(); break;
+		case ID_FILE_YSEND: OnFileYSend(); break;
+		case ID_FILE_ZRCV: OnFileZRcv(); break;
+		case ID_FILE_ZSEND: OnFileZSend(); break;
+		case ID_FILE_BPRCV: OnFileBPRcv(); break;
+		case ID_FILE_BPSEND: OnFileBPSend(); break;
+		case ID_FILE_QVRCV: OnFileQVRcv(); break;
+		case ID_FILE_QVSEND: OnFileQVSend(); break;
+		case ID_FILE_CHANGEDIR: OnFileChangeDir(); break;
+		case ID_FILE_PRINT2: OnFilePrint(); break;
+		case ID_FILE_DISCONNECT: OnFileDisconnect(); break;
+		case ID_FILE_EXIT: OnFileExit(); break;
+		case ID_FILE_EXITALL: OnAllClose(); break;
+		case ID_EDIT_COPY2: OnEditCopy(); break;
+		case ID_EDIT_COPYTABLE: OnEditCopyTable(); break;
+		case ID_EDIT_PASTE2: OnEditPaste(); break;
+		case ID_EDIT_PASTECR: OnEditPasteCR(); break;
+		case ID_EDIT_CLEARSCREEN: OnEditClearScreen(); break;
+		case ID_EDIT_CLEARBUFFER: OnEditClearBuffer(); break;
+		case ID_EDIT_CANCELSELECT: OnEditCancelSelection(); break;
+		case ID_EDIT_SELECTALL: OnEditSelectAllBuffer(); break;
+		case ID_EDIT_SELECTSCREEN: OnEditSelectScreenBuffer(); break;
+		case ID_SETUP_ADDITIONALSETTINGS: OnExternalSetup(); break;
+		case ID_SETUP_TERMINAL: OnSetupTerminal(); break;
+		case ID_SETUP_WINDOW: OnSetupWindow(); break;
+		case ID_SETUP_FONT: OnSetupFont(); break;
+		case ID_SETUP_DLG_FONT: OnSetupDlgFont(); break;
+		case ID_SETUP_KEYBOARD: OnSetupKeyboard(); break;
+		case ID_SETUP_SERIALPORT: OnSetupSerialPort(); break;
+		case ID_SETUP_TCPIP: OnSetupTCPIP(); break;
+		case ID_SETUP_GENERAL: OnSetupGeneral(); break;
+		case ID_SETUP_SAVE: OnSetupSave(); break;
+		case ID_SETUP_RESTORE: OnSetupRestore(); break;
+		case ID_OPEN_SETUP: OnOpenSetupDirectory(); break;
+		case ID_SETUP_LOADKEYMAP: OnSetupLoadKeyMap(); break;
+		case ID_CONTROL_RESETTERMINAL: OnControlResetTerminal(); break;
+		case ID_CONTROL_RESETREMOTETITLE: OnControlResetRemoteTitle(); break;
+		case ID_CONTROL_AREYOUTHERE: OnControlAreYouThere(); break;
+		case ID_CONTROL_SENDBREAK: OnControlSendBreak(); break;
+		case ID_CONTROL_RESETPORT: OnControlResetPort(); break;
+		case ID_CONTROL_BROADCASTCOMMAND: OnControlBroadcastCommand(); break;
+		case ID_CONTROL_OPENTEK: OnControlOpenTEK(); break;
+		case ID_CONTROL_CLOSETEK: OnControlCloseTEK(); break;
+		case ID_CONTROL_MACRO: OnControlMacro(); break;
+		case ID_CONTROL_SHOW_MACRO: OnShowMacroWindow(); break;
+		case ID_WINDOW_WINDOW: OnWindowWindow(); break;
+		case ID_WINDOW_MINIMIZEALL: OnWindowMinimizeAll(); break;
+		case ID_WINDOW_CASCADEALL: OnWindowCascade(); break;
+		case ID_WINDOW_STACKED: OnWindowStacked(); break;
+		case ID_WINDOW_SIDEBYSIDE: OnWindowSidebySide(); break;
+		case ID_WINDOW_RESTOREALL: OnWindowRestoreAll(); break;
+		case ID_WINDOW_UNDO: OnWindowUndo(); break;
+		case ID_HELP_INDEX2: OnHelpIndex(); break;
+		case ID_HELP_ABOUT: OnHelpAbout(); break;
+		default:
+			OnCommand(wp, lp);
+			break;
+		}
+		break;
+	}
+	case WM_NCHITTEST: {
+		retval = CFrameWnd::DefWindowProc(msg, wp ,lp);
+		if (ts.HideTitle>0) {
+			if ((retval == HTCLIENT) && AltKey()) {
+#ifdef ALPHABLEND_TYPE2
+			if(ShiftKey())
+				retval = HTBOTTOMRIGHT;
+			else
+				retval = HTCAPTION;
+#else
+			retval = HTCAPTION;
+#endif
+			}
+		}
+	}
+		break;
+	default:
+		retval = DefWindowProc(msg, wp, lp);
+		break;
+	}
+	return retval;
+}

Modified: trunk/teraterm/teraterm/vtwin.h
===================================================================
--- trunk/teraterm/teraterm/vtwin.h	2019-03-28 16:38:41 UTC (rev 7527)
+++ trunk/teraterm/teraterm/vtwin.h	2019-03-28 16:38:54 UTC (rev 7528)
@@ -31,7 +31,9 @@
 
 #ifdef __cplusplus
 
-class CVTWindow : public CFrameWnd
+#include "tmfc.h"
+
+class CVTWindow : public TTCFrameWnd
 {
 private:
   BOOL FirstPaint, Minimized;
@@ -51,11 +53,9 @@
     SetupMenu, ControlMenu, WinMenu, HelpMenu;
 
   // drag and drop handle
-  char **DropLists;
+  TCHAR **DropLists;
   int DropListCount;
   void DropListFree();
-  bool DropWithLeftbutton;
-  bool DropWithRightbutton;
 
   // window attribute
   BYTE Alpha;
@@ -79,19 +79,19 @@
 
 	//{{AFX_VIRTUAL(CVTWindow)
 	protected:
-	virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
 	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
 	//}}AFX_VIRTUAL
 
 public:
-#ifdef _DEBUG
+#if 0 //def _DEBUG
 	virtual void AssertValid() const;
-	virtual void Dump(CDumpContext& dc) const;
+//	virtual void Dump(CDumpContext& dc) const;
 #endif
 
 protected:
 	//{{AFX_MSG(CVTWindow)
-	afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
+#define afx_msg
+	afx_msg void OnActivate(UINT nState, HWND pWndOther, BOOL bMinimized);
 	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
 	afx_msg void OnClose();
 	afx_msg void OnAllClose();
@@ -98,65 +98,65 @@
 	afx_msg void OnDestroy();
 	afx_msg void OnDropFiles(HDROP hDropInfo);
 	afx_msg void OnGetMinMaxInfo(MINMAXINFO *lpMMI);
-	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
-	afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
+	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, HWND pScrollBar);
+	afx_msg void OnInitMenuPopup(HMENU hPopupMenu, UINT nIndex, BOOL bSysMenu);
 	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
 	afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
-	afx_msg void OnKillFocus(CWnd* pNewWnd);
-	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
-	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
-	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
-	afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
-	afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
-	afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);
-	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
+	afx_msg void OnKillFocus(HWND hNewWnd);
+	afx_msg void OnLButtonDblClk(UINT nFlags, POINTS point);
+	afx_msg void OnLButtonDown(UINT nFlags, POINTS point);
+	afx_msg void OnLButtonUp(UINT nFlags, POINTS point);
+	afx_msg void OnMButtonDown(UINT nFlags, POINTS point);
+	afx_msg void OnMButtonUp(UINT nFlags, POINTS point);
+	afx_msg int OnMouseActivate(HWND pDesktopWnd, UINT nHitTest, UINT message);
+	afx_msg void OnMouseMove(UINT nFlags, POINTS point);
 	afx_msg void OnMove(int x, int y);
-	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
-	afx_msg void OnNcCalcSize(BOOL valid, NCCALCSIZE_PARAMS *calcsize);
-	afx_msg void OnNcLButtonDblClk(UINT nHitTest, CPoint point);
-	afx_msg void OnNcRButtonDown(UINT nHitTest, CPoint point);
+	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, POINTS pt);
+//	afx_msg void OnNcCalcSize(BOOL valid, NCCALCSIZE_PARAMS *calcsize); // \x89\xBD\x82\xE0\x82\xB5\x82Ă\xA2\x82Ȃ\xA2\x81A\x95s\x97v
+	afx_msg void OnNcLButtonDblClk(UINT nHitTest, POINTS point);
+	afx_msg void OnNcRButtonDown(UINT nHitTest, POINTS point);
 	afx_msg void OnPaint();
-	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
-	afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
-	afx_msg void OnSetFocus(CWnd* pOldWnd);
+	afx_msg void OnRButtonDown(UINT nFlags, POINTS point);
+	afx_msg void OnRButtonUp(UINT nFlags, POINTS point);
+	afx_msg void OnSetFocus(HWND hOldWnd);
 	afx_msg void OnSize(UINT nType, int cx, int cy);
 	afx_msg void OnSizing(UINT fwSide, LPRECT pRect);
 	afx_msg void OnSysChar(UINT nChar, UINT nRepCnt, UINT nFlags);
-	afx_msg void OnSysColorChange();
+//	afx_msg void OnSysColorChange();		// \x89\xBD\x82\xE0\x82\xB5\x82Ă\xA2\x82Ȃ\xA2\x81A\x95s\x97v
 	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
 	afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
 	afx_msg void OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
-	afx_msg void OnTimer(UINT nIDEvent);
-	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
+	afx_msg void OnTimer(UINT_PTR nIDEvent);
+	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, HWND pScrollBar);
 	afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD_PTR dwData);
 //<!--by AKASI
-	afx_msg LONG OnWindowPosChanging(UINT wParam, LONG lParam);
-	afx_msg LONG OnSettingChange(UINT wParam, LONG lParam);
-	afx_msg LONG OnEnterSizeMove(UINT wParam, LONG lParam);
-	afx_msg LONG  OnExitSizeMove(UINT wParam, LONG lParam);
+	afx_msg LRESULT OnWindowPosChanging(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnSettingChange(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnEnterSizeMove(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnExitSizeMove(WPARAM wParam, LPARAM lParam);
 //-->
 	afx_msg LRESULT OnIMEStartComposition(WPARAM wParam, LPARAM lParam);
 	afx_msg LRESULT OnIMEEndComposition(WPARAM wParam, LPARAM lParam);
-	afx_msg LONG OnIMEComposition(UINT wParam, LONG lParam);
-	afx_msg LONG OnIMEInputChange(UINT wParam, LONG lParam);
-	afx_msg LONG OnIMENotify(UINT wParam, LONG lParam);
-	afx_msg LONG OnIMERequest(UINT wParam, LONG lParam);
-	afx_msg LONG OnAccelCommand(UINT wParam, LONG lParam);
-	afx_msg LONG OnChangeMenu(UINT wParam, LONG lParam);
-	afx_msg LONG OnChangeTBar(UINT wParam, LONG lParam);
-	afx_msg LONG OnCommNotify(UINT wParam, LONG lParam);
-	afx_msg LONG OnCommOpen(UINT wParam, LONG lParam);
-	afx_msg LONG OnCommStart(UINT wParam, LONG lParam);
-	afx_msg LONG OnDdeEnd(UINT wParam, LONG lParam);
-	afx_msg LONG OnDlgHelp(UINT wParam, LONG lParam);
-	afx_msg LONG OnFileTransEnd(UINT wParam, LONG lParam);
-	afx_msg LONG OnGetSerialNo(UINT wParam, LONG lParam);
-	afx_msg LONG OnKeyCode(UINT wParam, LONG lParam);
-	afx_msg LONG OnProtoEnd(UINT wParam, LONG lParam);
-	afx_msg LONG OnChangeTitle(UINT wParam, LONG lParam);
-	afx_msg LONG OnReceiveIpcMessage(UINT wParam, LONG lParam);
-	afx_msg LONG OnNonConfirmClose(UINT wParam, LONG lParam);
-	afx_msg LONG OnNotifyIcon(UINT wParam, LONG lParam);
+	afx_msg LRESULT OnIMEComposition(UINT wParam, LONG lParam);
+	afx_msg LRESULT OnIMEInputChange(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnIMENotify(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnIMERequest(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnAccelCommand(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnChangeMenu(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnChangeTBar(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnCommNotify(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnCommOpen(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnCommStart(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnDdeEnd(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnDlgHelp(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnFileTransEnd(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnGetSerialNo(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnKeyCode(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnProtoEnd(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnChangeTitle(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnReceiveIpcMessage(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnNonConfirmClose(WPARAM wParam, LPARAM lParam);
+	afx_msg LRESULT OnNotifyIcon(WPARAM wParam, LPARAM lParam);
 	afx_msg void OnFileNewConnection();
 	afx_msg void OnDuplicateSession();
 	afx_msg void OnCygwinConnection();
@@ -199,6 +199,7 @@
 	afx_msg void OnSetupTerminal();
 	afx_msg void OnSetupWindow();
 	afx_msg void OnSetupFont();
+	afx_msg void OnSetupDlgFont();
 	afx_msg void OnSetupKeyboard();
 	afx_msg void OnSetupSerialPort();
 	afx_msg void OnSetupTCPIP();
@@ -225,12 +226,17 @@
 	afx_msg void OnWindowRestoreAll();
 	afx_msg void OnWindowUndo();
 	afx_msg void OnHelpIndex();
-	afx_msg void OnHelpUsing();
+//	afx_msg void OnHelpUsing();		// \x8E\xC0\x91̂Ȃ\xB5\x95s\x97v
 	afx_msg void OnHelpAbout();
-	afx_msg LONG OnDropNotify(UINT ShowMenu, LONG lParam);
+	afx_msg LRESULT OnDropNotify(WPARAM ShowMenu, LPARAM lParam);
+	afx_msg LRESULT OnDpiChanged(WPARAM wParam, LPARAM lParam);
 	//}}AFX_MSG
-	DECLARE_MESSAGE_MAP();
+//	DECLARE_MESSAGE_MAP();
+#undef afx_msg
 	void Disconnect(BOOL confirm);
+	///
+	LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
+	virtual LRESULT Proc(UINT msg, WPARAM wp, LPARAM lp);
 };
 #endif
 


Ttssh2-commit メーリングリストの案内