[Ttssh2-commit] [7526] ファイル転送関連を高DPI化

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


Revision: 7526
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7526
Author:   zmatsuo
Date:     2019-03-29 01:38:29 +0900 (Fri, 29 Mar 2019)
Log Message:
-----------
ファイル転送関連を高DPI化

Modified Paths:
--------------
    trunk/teraterm/teraterm/filesys.cpp
    trunk/teraterm/teraterm/ftdlg.cpp
    trunk/teraterm/teraterm/ftdlg.h
    trunk/teraterm/teraterm/protodlg.cpp
    trunk/teraterm/teraterm/protodlg.h

-------------- next part --------------
Modified: trunk/teraterm/teraterm/filesys.cpp
===================================================================
--- trunk/teraterm/teraterm/filesys.cpp	2019-03-28 16:38:16 UTC (rev 7525)
+++ trunk/teraterm/teraterm/filesys.cpp	2019-03-28 16:38:29 UTC (rev 7526)
@@ -28,7 +28,10 @@
  */
 
 /* TERATERM.EXE, file transfer routines */
-#include "stdafx.h"
+#include <stdio.h>
+#include <io.h>
+#include <process.h>
+
 #include "teraterm.h"
 #include "tttypes.h"
 #include "ttftypes.h"
@@ -255,11 +258,9 @@
 static PFileTransDlg SendDlg = NULL;
 static PProtoDlg PtDlg = NULL;
 
-BOOL OpenFTDlg(PFileVar fv)
+static BOOL OpenFTDlg(PFileVar fv)
 {
 	PFileTransDlg FTDlg;
-	HWND HFTDlg;
-	char uimsg[MAX_UIMSG];
 
 	FTDlg = new CFileTransDlg();
 
@@ -272,7 +273,7 @@
 
 	if (FTDlg!=NULL)
 	{
-		FTDlg->Create(fv, &cv, &ts);
+		FTDlg->Create(hInst, HVTWin, fv, &cv, &ts);
 		FTDlg->RefreshNum();
 		if (fv->OpId == OpLog) {
 			HWndLog = FTDlg->m_hWnd; // steven add
@@ -284,32 +285,9 @@
 	else
 		SendDlg = FTDlg; /* File send */
 
-	HFTDlg=FTDlg->GetSafeHwnd();
-
-	GetDlgItemText(HFTDlg, IDC_TRANS_FILENAME, uimsg, sizeof(uimsg));
-	get_lang_msg("DLG_FILETRANS_FILENAME", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(HFTDlg, IDC_TRANS_FILENAME, ts.UIMsg);
-	GetDlgItemText(HFTDlg, IDC_FULLPATH_LABEL, uimsg, sizeof(uimsg));
-	get_lang_msg("DLG_FILETRANS_FULLPATH", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(HFTDlg, IDC_FULLPATH_LABEL, ts.UIMsg);
-	GetDlgItemText(HFTDlg, IDC_TRANS_TRANS, uimsg, sizeof(uimsg));
-	get_lang_msg("DLG_FILETRANS_TRNAS", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(HFTDlg, IDC_TRANS_TRANS, ts.UIMsg);
-	GetDlgItemText(HFTDlg, IDC_TRANS_ELAPSED, uimsg, sizeof(uimsg));
-	get_lang_msg("DLG_FILETRANS_ELAPSED", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(HFTDlg, IDC_TRANS_ELAPSED, ts.UIMsg);
-	GetDlgItemText(HFTDlg, IDCANCEL, uimsg, sizeof(uimsg));
-	get_lang_msg("DLG_FILETRANS_CLOSE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(HFTDlg, IDCANCEL, ts.UIMsg);
-	GetDlgItemText(HFTDlg, IDC_TRANSPAUSESTART, uimsg, sizeof(uimsg));
-	get_lang_msg("DLG_FILETRANS_PAUSE", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(HFTDlg, IDC_TRANSPAUSESTART, ts.UIMsg);
-	GetDlgItemText(HFTDlg, IDC_TRANSHELP, uimsg, sizeof(uimsg));
-	get_lang_msg("BTN_HELP", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(HFTDlg, IDC_TRANSHELP, ts.UIMsg);
-
 	fv->StartTime = GetTickCount();
 	if (fv->OpId == OpSendFile) {
+		HWND HFTDlg = FTDlg->GetSafeHwnd();
 		InitDlgProgress(HFTDlg, IDC_TRANSPROGRESS, &fv->ProgStat);
 		ShowWindow(GetDlgItem(HFTDlg, IDC_TRANS_ELAPSED), SW_SHOW);
 	}
@@ -1479,8 +1457,6 @@
 {
 	int vsize;
 	PProtoDlg pd;
-	HWND Hpd;
-	char uimsg[MAX_UIMSG];
 
 	ProtoId = IdProto;
 
@@ -1540,29 +1516,8 @@
 		ProtoVar = NULL;
 		return FALSE;
 	}
-	pd->Create(fv,&ts);
+	pd->Create(hInst, HVTWin, fv, &ts);
 
-	Hpd=pd->GetSafeHwnd();
-
-	GetDlgItemText(Hpd, IDC_PROT_FILENAME, uimsg, sizeof(uimsg));
-	get_lang_msg("DLG_PROT_FILENAME", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(Hpd, IDC_PROT_FILENAME, ts.UIMsg);
-	GetDlgItemText(Hpd, IDC_PROT_PROT, uimsg, sizeof(uimsg));
-	get_lang_msg("DLG_PROT_PROTO", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(Hpd, IDC_PROT_PROT, ts.UIMsg);
-	GetDlgItemText(Hpd, IDC_PROT_PACKET, uimsg, sizeof(uimsg));
-	get_lang_msg("DLG_PROT_PACKET", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(Hpd, IDC_PROT_PACKET, ts.UIMsg);
-	GetDlgItemText(Hpd, IDC_PROT_TRANS, uimsg, sizeof(uimsg));
-	get_lang_msg("DLG_PROT_TRANS", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(Hpd, IDC_PROT_TRANS, ts.UIMsg);
-	GetDlgItemText(Hpd, IDC_PROT_ELAPSED, uimsg, sizeof(uimsg));
-	get_lang_msg("DLG_PROT_ELAPSED", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(Hpd, IDC_PROT_ELAPSED, ts.UIMsg);
-	GetDlgItemText(Hpd, IDCANCEL, uimsg, sizeof(uimsg));
-	get_lang_msg("BTN_CANCEL", ts.UIMsg, sizeof(ts.UIMsg), uimsg, ts.UILanguageFile);
-	SetDlgItemText(Hpd, IDCANCEL, ts.UIMsg);
-
 	(*ProtoInit)(ProtoId,FileVar,ProtoVar,&cv,&ts);
 
 	PtDlg = pd;

Modified: trunk/teraterm/teraterm/ftdlg.cpp
===================================================================
--- trunk/teraterm/teraterm/ftdlg.cpp	2019-03-28 16:38:16 UTC (rev 7525)
+++ trunk/teraterm/teraterm/ftdlg.cpp	2019-03-28 16:38:29 UTC (rev 7526)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2007-2017 TeraTerm Project
+ * (C) 2007-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -28,11 +28,15 @@
  */
 
 /* TERATERM.EXE, file transfer dialog box */
-#include "stdafx.h"
+#include <stdio.h>
+#include <windows.h>
+#include <commctrl.h>
+#include <tchar.h>
 #include "teraterm.h"
 #include "tttypes.h"
 #include "ttftypes.h"
 #include "ttlib.h"
+#include "dlglib.h"
 #include "tt_res.h"
 #include "ftdlg.h"
 
@@ -45,15 +49,9 @@
 /////////////////////////////////////////////////////////////////////////////
 // CFileTransDlg dialog
 
-BEGIN_MESSAGE_MAP(CFileTransDlg, CDialog)
-	//{{AFX_MSG_MAP(CFileTransDlg)
-	//}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-BOOL CFileTransDlg::Create(PFileVar pfv, PComVar pcv, PTTSet pts)
+BOOL CFileTransDlg::Create(HINSTANCE hInstance, HWND hParent, PFileVar pfv, PComVar pcv, PTTSet pts)
 {
 	BOOL Ok;
-	WNDCLASS wc;
 	int fuLoad = LR_DEFAULTCOLOR;
 	HWND hwnd;
 
@@ -61,28 +59,14 @@
 	cv = pcv;
 	cv->FilePause &= ~fv->OpId;
 	ts = pts;
-	LOGFONT logfont;
-	HFONT font;
 
-	wc.style = CS_PARENTDC;
-	wc.lpfnWndProc = AfxWndProc;
-	wc.cbClsExtra = 0;
-	wc.cbWndExtra = DLGWINDOWEXTRA;
-	wc.hInstance = AfxGetInstanceHandle();
-	wc.hIcon = NULL;
-	wc.hCursor = LoadCursor(NULL,IDC_ARROW);
-	wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
-	wc.lpszMenuName = NULL;
-	wc.lpszClassName = "FTDlg32";
-	RegisterClass(&wc);
-
 	Pause = FALSE;
-	hwnd = GetForegroundWindow()->GetSafeHwnd();
+	hwnd = GetForegroundWindow();
 	if (fv->OpId == OpLog) { // parent window is desktop
-		Ok = CDialog::Create(CFileTransDlg::IDD, GetDesktopWindow());
+		Ok = TTCDialog::Create(hInstance, GetDesktopWindow(), CFileTransDlg::IDD);
 	}
 	else { // parent window is VT window
-		Ok = CDialog::Create(CFileTransDlg::IDD, NULL);
+		Ok = TTCDialog::Create(hInstance, NULL, CFileTransDlg::IDD);
 	}
 
 	if (!fv->HideDialog) {
@@ -100,22 +84,6 @@
 
 	fv->HWin = GetSafeHwnd();
 
-	font = (HFONT)SendMessage(WM_GETFONT, 0, 0);
-	GetObject(font, sizeof(LOGFONT), &logfont);
-	if (get_lang_font("DLG_SYSTEM_FONT", fv->HWin, &logfont, &DlgFont, ts->UILanguageFile)) {
-		SendDlgItemMessage(IDC_TRANS_FILENAME, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_TRANSFNAME, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_FULLPATH_LABEL, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_EDIT_FULLPATH, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_TRANS_TRANS, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_TRANSBYTES, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_TRANS_ELAPSED, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_TRANS_ETIME, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_TRANSPAUSESTART, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDCANCEL, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_TRANSHELP, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-	}
-
 	return Ok;
 }
 
@@ -182,9 +150,21 @@
 
 /////////////////////////////////////////////////////////////////////////////
 // CFileTransDlg message handler
+#define AddModalHandle(p1)		// TODO
+#define	RemoveModalHandle(p1)
 
 BOOL CFileTransDlg::OnInitDialog()
 {
+	static const DlgTextInfo TextInfos[] = {
+		{ IDC_TRANS_FILENAME, "DLG_FILETRANS_FILENAME" },
+		{ IDC_FULLPATH_LABEL, "DLG_FILETRANS_FULLPATH" },
+		{ IDC_TRANS_TRANS, "DLG_FILETRANS_TRNAS" },
+		{ IDC_TRANS_ELAPSED, "DLG_FILETRANS_ELAPSED" },
+		{ IDCANCEL, "DLG_FILETRANS_CLOSE" },
+		{ IDC_TRANSPAUSESTART, "DLG_FILETRANS_PAUSE" },
+		{ IDC_TRANSHELP, "BTN_HELP" },
+	};
+
 	int fuLoad = LR_DEFAULTCOLOR;
 
 	if (fv->HideDialog) {
@@ -202,27 +182,32 @@
 	// \x83\x8D\x83O\x83t\x83@\x83C\x83\x8B\x82̓t\x83\x8B\x83p\x83X\x95\\x8E\xA6\x82ɂ\xB7\x82\xE9(2004.8.6 yutaka)
 	SetDlgItemText(IDC_EDIT_FULLPATH, &(fv->FullName[0]));
 
+	SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), ts->UILanguageFile);
+
 	if (IsWindowsNT4()) {
 		fuLoad = LR_VGACOLOR;
 	}
-	SmallIcon = LoadImage(AfxGetInstanceHandle(),
-		MAKEINTRESOURCE(IDI_TTERM),
-		IMAGE_ICON, 16, 16, fuLoad);
+	SmallIcon = LoadImage(m_hInst,
+						  MAKEINTRESOURCE(IDI_TTERM),
+						  IMAGE_ICON, 16, 16, fuLoad);
 	::PostMessage(GetSafeHwnd(), WM_SETICON, ICON_SMALL,
-		(LPARAM)SmallIcon);
+				  (LPARAM)SmallIcon);
 
-	BigIcon = LoadImage(AfxGetInstanceHandle(),
-			MAKEINTRESOURCE(IDI_TTERM),
-			IMAGE_ICON, 0, 0, fuLoad);
+	BigIcon = LoadImage(m_hInst,
+						MAKEINTRESOURCE(IDI_TTERM),
+						IMAGE_ICON, 0, 0, fuLoad);
 	::PostMessage(GetSafeHwnd(), WM_SETICON, ICON_BIG,
-		(LPARAM)BigIcon);
+				  (LPARAM)BigIcon);
 
-	return 1;
+	AddModalHandle(m_hWnd);
+
+	return TRUE;
 }
 
-void CFileTransDlg::OnCancel( )
+BOOL CFileTransDlg::OnCancel( )
 {
 	::PostMessage(fv->HMainWin,WM_USER_FTCANCEL,fv->OpId,0);
+	return TRUE;
 }
 
 BOOL CFileTransDlg::OnCommand(WPARAM wParam, LPARAM lParam)
@@ -238,21 +223,15 @@
 			::PostMessage(fv->HMainWin,WM_USER_DLGHELP2,0,0);
 			return TRUE;
 		default:
-			return (CDialog::OnCommand(wParam,lParam));
+			return (TTCDialog::OnCommand(wParam,lParam));
 	}
 }
 
-void CFileTransDlg::PostNcDestroy()
+BOOL CFileTransDlg::PostNcDestroy()
 {
 	// logopen\x82\xC6logclose\x82\xF0\x8CJ\x82\xE8\x95Ԃ\xB7\x82ƁAGDI\x83\x8A\x83\\x81[\x83X\x83\x8A\x81[\x83N\x82ƂȂ\xE9\x96\xE2\x91\xE8\x82\xF0\x8FC\x90\xB3\x82\xB5\x82\xBD\x81B
-	//   - CreateFontIndirect()\x82ō쐬\x82\xB5\x82\xBD\x98_\x97\x9D\x83t\x83H\x83\x93\x83g\x82\xF0\x8D폜\x82\xB7\x82\xE9\x81B
 	//   - LoadImage()\x82ɂ\xE6\x82\xE9\x83A\x83C\x83R\x83\x93\x83\x8A\x83\\x81[\x83X\x82\xF0\x89\xF0\x95\xFA\x82\xB7\x82\xE9\x81B
 	// (2016.10.5 yutaka)
-	if (DlgFont) {
-		DeleteObject(DlgFont);
-		DlgFont = NULL;
-	}
-
 	if (SmallIcon) {
 		DestroyIcon((HICON)SmallIcon);
 		SmallIcon = NULL;
@@ -263,10 +242,8 @@
 		BigIcon = NULL;
 	}
 
+	RemoveModalHandle(m_hWnd);
+
 	delete this;
+	return TRUE;
 }
-
-LRESULT CFileTransDlg::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
-{
-	return DefDlgProc(GetSafeHwnd(),message,wParam,lParam);
-}

Modified: trunk/teraterm/teraterm/ftdlg.h
===================================================================
--- trunk/teraterm/teraterm/ftdlg.h	2019-03-28 16:38:16 UTC (rev 7525)
+++ trunk/teraterm/teraterm/ftdlg.h	2019-03-28 16:38:29 UTC (rev 7526)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2007-2017 TeraTerm Project
+ * (C) 2007-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,55 +29,38 @@
 
 /* TERATERM.EXE, file transfer dialog box */
 
+#include "tmfc.h"
+
 /////////////////////////////////////////////////////////////////////////////
 // CFileTransDlg dialog
 
-class CFileTransDlg : public CDialog
+class CFileTransDlg : public TTCDialog
 {
-private:
-	PFileVar fv;
-	PComVar cv;
-	BOOL Pause;
-#ifndef NO_I18N
-	PTTSet ts;
-	HFONT DlgFont;
-#endif
-	HANDLE SmallIcon;
-	HANDLE BigIcon;
-
 public:
 	CFileTransDlg() {
-		DlgFont = NULL;
 		SmallIcon = NULL;
 		BigIcon = NULL;
 	}
 
-#ifndef NO_I18N
-	BOOL Create(PFileVar pfv, PComVar pcv, PTTSet pts);
-#else
-	BOOL Create(PFileVar pfv, PComVar pcv);
-#endif
+	BOOL Create(HINSTANCE hInstance, HWND hParent, PFileVar pfv, PComVar pcv, PTTSet pts);
 	void ChangeButton(BOOL PauseFlag);
 	void RefreshNum();
 
-	//{{AFX_DATA(CFileTransDlg)
 	enum { IDD = IDD_FILETRANSDLG };
-	//}}AFX_DATA
 
-	//{{AFX_VIRTUAL(CFileTransDlg)
-	protected:
-	virtual void OnCancel( );
+protected:
+	virtual BOOL OnCancel();
 	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
-	virtual void PostNcDestroy();
-	virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
-	//}}AFX_VIRTUAL
+	virtual BOOL PostNcDestroy();
+	virtual BOOL OnInitDialog();
 
-protected:
-
-	//{{AFX_MSG(CFileTransDlg)
-	virtual BOOL OnInitDialog();
-	//}}AFX_MSG
-	DECLARE_MESSAGE_MAP()
+private:
+	PFileVar fv;
+	PComVar cv;
+	BOOL Pause;
+	PTTSet ts;
+	HANDLE SmallIcon;
+	HANDLE BigIcon;
 };
 
 typedef CFileTransDlg *PFileTransDlg;

Modified: trunk/teraterm/teraterm/protodlg.cpp
===================================================================
--- trunk/teraterm/teraterm/protodlg.cpp	2019-03-28 16:38:16 UTC (rev 7525)
+++ trunk/teraterm/teraterm/protodlg.cpp	2019-03-28 16:38:29 UTC (rev 7526)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2007-2017 TeraTerm Project
+ * (C) 2007-2019 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -28,7 +28,6 @@
  */
 
 /* TERATERM.EXE, file-transfer-protocol dialog box */
-#include "stdafx.h"
 #include "teraterm.h"
 #include "tt_res.h"
 #include "tttypes.h"
@@ -46,39 +45,14 @@
 /////////////////////////////////////////////////////////////////////////////
 // CProtoDlg dialog
 
-BEGIN_MESSAGE_MAP(CProtoDlg, CDialog)
-	//{{AFX_MSG_MAP(CProtoDlg)
-	//}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-BOOL CProtoDlg::Create(PFileVar pfv, PTTSet pts)
+BOOL CProtoDlg::Create(HINSTANCE hInstance, HWND hParent, PFileVar pfv, PTTSet pts)
 {
-	BOOL Ok;
-	LOGFONT logfont;
-	HFONT font;
-
+	m_pts = pts;
 	fv = pfv;
 
-	Ok = CDialog::Create(CProtoDlg::IDD, NULL);
+	BOOL Ok = TTCDialog::Create(hInstance, hParent, CProtoDlg::IDD);
 	fv->HWin = GetSafeHwnd();
 
-	font = (HFONT)SendMessage(WM_GETFONT, 0, 0);
-	GetObject(font, sizeof(LOGFONT), &logfont);
-	if (get_lang_font("DLG_SYSTEM_FONT", GetSafeHwnd(), &logfont, &DlgFont, pts->UILanguageFile)) {
-		SendDlgItemMessage(IDC_PROT_FILENAME, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_PROTOFNAME, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_PROT_PROT, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_PROTOPROT, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_PROT_PACKET, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_PROTOPKTNUM, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_PROT_TRANS, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_PROTOBYTECOUNT, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_PROT_ELAPSED, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_PROTOELAPSEDTIME, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDC_PROTOPERCENT, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-		SendDlgItemMessage(IDCANCEL, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0));
-	}
-
 	return Ok;
 }
 
@@ -85,9 +59,25 @@
 /////////////////////////////////////////////////////////////////////////////
 // CProtoDlg message handler
 
-void CProtoDlg::OnCancel( )
+BOOL CProtoDlg::OnInitDialog()
 {
+	static const DlgTextInfo TextInfos[] = {
+		{ IDC_PROT_FILENAME, "DLG_PROT_FILENAME" },
+		{ IDC_PROT_PROT, "DLG_PROT_PROTO" },
+		{ IDC_PROT_PACKET, "DLG_PROT_PACKET"},
+		{ IDC_PROT_TRANS, "DLG_PROT_TRANS" },
+		{ IDC_PROT_ELAPSED, "DLG_PROT_ELAPSED" },
+		{ IDCANCEL, "BTN_CANCEL" },
+	};
+	SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), m_pts->UILanguageFile);
+	return TRUE;
+}
+
+
+BOOL CProtoDlg::OnCancel()
+{
 	::PostMessage(fv->HMainWin,WM_USER_PROTOCANCEL,0,0);
+	return TRUE;
 }
 
 BOOL CProtoDlg::OnCommand(WPARAM wParam, LPARAM lParam)
@@ -97,11 +87,12 @@
 			::PostMessage(fv->HMainWin,WM_USER_PROTOCANCEL,0,0);
 			return TRUE;
 		default:
-			return (CDialog::OnCommand(wParam,lParam));
+			return (TTCDialog::OnCommand(wParam,lParam));
 	}
 }
 
-void CProtoDlg::PostNcDestroy()
+BOOL CProtoDlg::PostNcDestroy()
 {
 	delete this;
+	return TRUE;
 }

Modified: trunk/teraterm/teraterm/protodlg.h
===================================================================
--- trunk/teraterm/teraterm/protodlg.h	2019-03-28 16:38:16 UTC (rev 7525)
+++ trunk/teraterm/teraterm/protodlg.h	2019-03-28 16:38:29 UTC (rev 7526)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2007-2017 TeraTerm Project
+ * (C) 2007-2018 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -28,39 +28,25 @@
  */
 
 /* TERATERM.EXE, file-transfer-protocol dialog box */
+#include "tmfc.h"
+#include "tttypes.h"
 
 // CProtoDlg dialog
-class CProtoDlg : public CDialog
+class CProtoDlg : public TTCDialog
 {
-private:
-  PFileVar fv;
-#ifndef NO_I18N
-	HFONT DlgFont;
-#endif
 
 public:
-#ifndef NO_I18N
-	BOOL Create(PFileVar pfv, PTTSet pts);
-#else
-	BOOL Create(PFileVar pfv);
-#endif
+	BOOL Create(HINSTANCE hInstance, HWND hParent, PFileVar pfv, PTTSet pts);
 
-	//{{AFX_DATA(CProtoDlg)
 	enum { IDD = IDD_PROTDLG };
-	//}}AFX_DATA
-
-	//{{AFX_VIRTUAL(CProtoDlg)
-	protected:
-	virtual void OnCancel( );
+protected:
+	virtual BOOL OnCancel();
 	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
-	virtual void PostNcDestroy();
-	//}}AFX_VIRTUAL
-
-protected:
-
-	//{{AFX_MSG(CProtoDlg)
-	//}}AFX_MSG
-	DECLARE_MESSAGE_MAP()
+	virtual BOOL OnInitDialog();
+	virtual BOOL PostNcDestroy();
+private:
+	PFileVar fv;
+	TTTSet *m_pts;
 };
 
 typedef CProtoDlg *PProtoDlg;


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