[Ttssh2-commit] [7783] メッセージ振り分け処理など整理

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 6月 20日 (木) 23:41:07 JST


Revision: 7783
          https://osdn.net/projects/ttssh2/scm/svn/commits/7783
Author:   zmatsuo
Date:     2019-06-20 23:41:07 +0900 (Thu, 20 Jun 2019)
Log Message:
-----------
メッセージ振り分け処理など整理

- MsgDlgHelp(RegisterWindowMessage(HELPMSGSTRING))
  - コモンダイアログからのメッセージ
- WM_NCHITTEST
- 不要部分削除
- 未使用変数削除
- 文字列参照変数にconst追加

Modified Paths:
--------------
    trunk/teraterm/teraterm/tekwin.cpp
    trunk/teraterm/teraterm/tekwin.h
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/teraterm/vtwin.h

-------------- next part --------------
Modified: trunk/teraterm/teraterm/tekwin.cpp
===================================================================
--- trunk/teraterm/teraterm/tekwin.cpp	2019-06-20 14:40:56 UTC (rev 7782)
+++ trunk/teraterm/teraterm/tekwin.cpp	2019-06-20 14:41:07 UTC (rev 7783)
@@ -52,12 +52,6 @@
 
 #define TEKClassName _T("TEKWin32")
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
 static HINSTANCE AfxGetInstanceHandle()
 {
 	return hInst;
@@ -288,26 +282,6 @@
 /////////////////////////////////////////////////////////////////////////////
 // CTEKWindow message handler
 
-LRESULT CTEKWindow::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
-{
-	LRESULT Result;
-
-	if (message == MsgDlgHelp) {
-		OnDlgHelp(wParam,lParam);
-		return 0;
-	}
-	else if ((ts.HideTitle>0) &&
-	         (message == WM_NCHITTEST)) {
-		Result = CFrameWnd::DefWindowProc(message,wParam,lParam);
-		if ((Result==HTCLIENT) && AltKey()) {
-			Result = HTCAPTION;
-		}
-		return Result;
-	}
-
-	return (CFrameWnd::DefWindowProc(message,wParam,lParam));
-}
-
 BOOL CTEKWindow::OnCommand(WPARAM wParam, LPARAM lParam)
 {
 	if ((LOWORD(wParam)>=ID_WINDOW_1) && (LOWORD(wParam)<ID_WINDOW_1+9)) {
@@ -859,6 +833,10 @@
 LRESULT CTEKWindow::Proc(UINT msg, WPARAM wp, LPARAM lp)
 {
 	LRESULT retval = 0;
+	if (msg == MsgDlgHelp) {
+		OnDlgHelp(wp, lp);
+		return 0;
+	}
 	switch(msg)
 	{
 	case WM_ACTIVATE:
@@ -968,6 +946,15 @@
 		}
 		break;
 	}
+	case WM_NCHITTEST: {
+		retval = TTCFrameWnd::DefWindowProc(msg, wp, lp);
+		if (ts.HideTitle>0) {
+			if ((retval ==HTCLIENT) && AltKey()) {
+				retval = HTCAPTION;
+			}
+		}
+		break;
+	}
 	default:
 		retval = DefWindowProc(msg, wp, lp);
 		break;

Modified: trunk/teraterm/teraterm/tekwin.h
===================================================================
--- trunk/teraterm/teraterm/tekwin.h	2019-06-20 14:40:56 UTC (rev 7782)
+++ trunk/teraterm/teraterm/tekwin.h	2019-06-20 14:41:07 UTC (rev 7783)
@@ -51,7 +51,6 @@
 public:
 	//{{AFX_VIRTUAL(CTEKWindow)
 	protected:
-	virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
 	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
 	//}}AFX_VIRTUAL
 

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2019-06-20 14:40:56 UTC (rev 7782)
+++ trunk/teraterm/teraterm/vtwin.cpp	2019-06-20 14:41:07 UTC (rev 7783)
@@ -952,21 +952,6 @@
 
 /////////////////////////////////////////////////////////////////////////////
 
-#if 0 //def _DEBUG
-void CVTWindow::AssertValid() const
-{
-	CFrameWnd::AssertValid();
-}
-
-void CVTWindow::Dump(CDumpContext& dc) const
-{
-	CFrameWnd::Dump(dc);
-}
-
-#endif //_DEBUG
-
-/////////////////////////////////////////////////////////////////////////////
-
 int CVTWindow::Parse()
 {
 	// added ScrollLock (2006.11.14 yutaka)
@@ -1794,32 +1779,6 @@
 /////////////////////////////////////////////////////////////////////////////
 // CVTWindow message handler
 
-LRESULT CVTWindow::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
-{
-	LRESULT Result;
-
-	if (message == MsgDlgHelp) {
-		OnDlgHelp(wParam,lParam);
-		return 0;
-	}
-	else if ((ts.HideTitle>0) &&
-	         (message == WM_NCHITTEST)) {
-		Result = CFrameWnd::DefWindowProc(message,wParam,lParam);
-		if ((Result==HTCLIENT) && AltKey())
-#ifdef ALPHABLEND_TYPE2
-			if(ShiftKey())
-				Result = HTBOTTOMRIGHT;
-			else
-				Result = HTCAPTION;
-#else
-			Result = HTCAPTION;
-#endif
-		return Result;
-	}
-
-	return (CFrameWnd::DefWindowProc(message,wParam,lParam));
-}
-
 BOOL CVTWindow::OnCommand(WPARAM wParam, LPARAM lParam)
 {
 	WORD wID = LOWORD(wParam);
@@ -2666,15 +2625,6 @@
 	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, POINTS point)
 {
 	if (! Minimized && !ts.TermIsWin && (nHitTest == HTCAPTION)) {
@@ -2977,14 +2927,6 @@
 	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)
 {
 	if (nID==ID_SHOWMENUBAR) {
@@ -5080,9 +5022,8 @@
 static BOOL convertVirtualStore(char *path, char *filename, char *vstore_path, int vstore_pathlen)
 {
 	BOOL ret = FALSE;
-	int flag = 0;
-	char *s, **p;
-	char *virstore_env[] = {
+	const char *s, **p;
+	const char *virstore_env[] = {
 		"ProgramFiles",
 		"ProgramData",
 		"SystemRoot",
@@ -6481,11 +6422,6 @@
 	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;
@@ -6505,15 +6441,9 @@
 	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);
@@ -6713,8 +6643,8 @@
 #endif
 			}
 		}
+		break;
 	}
-		break;
 	default:
 		retval = DefWindowProc(msg, wp, lp);
 		break;

Modified: trunk/teraterm/teraterm/vtwin.h
===================================================================
--- trunk/teraterm/teraterm/vtwin.h	2019-06-20 14:40:56 UTC (rev 7782)
+++ trunk/teraterm/teraterm/vtwin.h	2019-06-20 14:41:07 UTC (rev 7783)
@@ -85,12 +85,6 @@
 	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
 	//}}AFX_VIRTUAL
 
-public:
-#if 0 //def _DEBUG
-	virtual void AssertValid() const;
-//	virtual void Dump(CDumpContext& dc) const;
-#endif
-
 protected:
 	//{{AFX_MSG(CVTWindow)
 #define afx_msg
@@ -238,7 +232,6 @@
 #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 メーリングリストの案内
Back to archive index