[Ttssh2-commit] [5271] マクロコマンド show 1 で、マクロウィンドウを最前面に出すようにした

svnno****@sourc***** svnno****@sourc*****
2013年 5月 20日 (月) 22:13:16 JST


Revision: 5271
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5271
Author:   maya
Date:     2013-05-20 22:13:15 +0900 (Mon, 20 May 2013)
Log Message:
-----------
マクロコマンド show 1 で、マクロウィンドウを最前面に出すようにした

Modified Paths:
--------------
    trunk/doc/en/html/macro/command/show.html
    trunk/doc/ja/html/macro/command/show.html
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/ttpmacro/ttl.c
    trunk/teraterm/ttpmacro/ttmmain.cpp
    trunk/teraterm/ttpmacro/ttmmain.h
    trunk/teraterm/ttpmacro/ttmmsg.h

-------------- next part --------------
Modified: trunk/doc/en/html/macro/command/show.html
===================================================================
--- trunk/doc/en/html/macro/command/show.html	2013-05-20 03:54:08 UTC (rev 5270)
+++ trunk/doc/en/html/macro/command/show.html	2013-05-20 13:13:15 UTC (rev 5271)
@@ -25,7 +25,7 @@
 
 <p>
 Minimizes MACRO, if &lt;show flag&gt; is zero.<br>
-Restores MACRO, if &lt;show flag&gt; is greater than zero.<br>
+Restores MACRO<!-- and \x8DőO\x96ʂɕ\\x8E\xA6\x82\xB7\x82\xE9 -->, if &lt;show flag&gt; is greater than zero.<br>
 Hides MACRO, if &lt;show flag&gt; is less than zero.
 </p>
 

Modified: trunk/doc/ja/html/macro/command/show.html
===================================================================
--- trunk/doc/ja/html/macro/command/show.html	2013-05-20 03:54:08 UTC (rev 5270)
+++ trunk/doc/ja/html/macro/command/show.html	2013-05-20 13:13:15 UTC (rev 5271)
@@ -25,7 +25,7 @@
 
 <p>
 &lt;show flag&gt; \x82\xAA0\x82̏ꍇ\x81AMACRO \x82\xF0\x8Dŏ\xAC\x89\xBB\x82\xB7\x82\xE9\x81B<br>
-&lt;show flag&gt; \x82\xAA0\x82\xE6\x82\xE8\x91傫\x82\xA2\x8Fꍇ\x81AMACRO \x82\xF0\x8C\xB3\x82̑傫\x82\xB3\x82ɖ߂\xB7\x81B<br>
+&lt;show flag&gt; \x82\xAA0\x82\xE6\x82\xE8\x91傫\x82\xA2\x8Fꍇ\x81AMACRO \x82\xF0\x8C\xB3\x82̑傫\x82\xB3\x82ɖ߂\xB5\x82čőO\x96ʂɕ\\x8E\xA6\x82\xB7\x82\xE9\x81B<br>
 &lt;show flag&gt; \x82\xAA0\x82\xE6\x82菬\x82\xB3\x82\xA2\x8Fꍇ\x81AMACRO \x82\xF0\x89B\x82\xB7\x81B
 </p>
 

Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2013-05-20 03:54:08 UTC (rev 5270)
+++ trunk/teraterm/common/tttypes.h	2013-05-20 13:13:15 UTC (rev 5271)
@@ -151,6 +151,7 @@
 #define WM_USER_DDECMNDEND   WM_USER+22
 #define WM_USER_DDECOMREADY  WM_USER+23
 #define WM_USER_DDEEND       WM_USER+24
+#define WM_USER_MACROBRINGUP WM_USER+25
 
 #define MY_FORCE_FOREGROUND_MESSAGE	WM_USER+31
 

Modified: trunk/teraterm/ttpmacro/ttl.c
===================================================================
--- trunk/teraterm/ttpmacro/ttl.c	2013-05-20 03:54:08 UTC (rev 5270)
+++ trunk/teraterm/ttpmacro/ttl.c	2013-05-20 13:13:15 UTC (rev 5271)
@@ -4214,8 +4214,10 @@
 	if (Err!=0) return Err;
 	if (Val==0)
 		ShowWindow(HMainWin,SW_MINIMIZE);
-	else if (Val>0)
+	else if (Val>0) {
 		ShowWindow(HMainWin,SW_RESTORE);
+		PostMessage(HMainWin, WM_USER_MACROBRINGUP, 0, 0);
+	}
 	else
 		ShowWindow(HMainWin,SW_HIDE);
 	return Err;

Modified: trunk/teraterm/ttpmacro/ttmmain.cpp
===================================================================
--- trunk/teraterm/ttpmacro/ttmmain.cpp	2013-05-20 03:54:08 UTC (rev 5270)
+++ trunk/teraterm/ttpmacro/ttmmain.cpp	2013-05-20 13:13:15 UTC (rev 5271)
@@ -199,6 +199,7 @@
 	ON_MESSAGE(WM_USER_DDECMNDEND,OnDdeCmndEnd)
 	ON_MESSAGE(WM_USER_DDECOMREADY,OnDdeComReady)
 	ON_MESSAGE(WM_USER_DDEREADY,OnDdeReady)
+	ON_MESSAGE(WM_USER_MACROBRINGUP,OnMacroBringup)
 	ON_MESSAGE(WM_USER_DDEEND,OnDdeEnd)
 	//}}AFX_MSG_MAP
 END_MESSAGE_MAP()
@@ -573,3 +574,24 @@
 	}
 	return 0;
 }
+
+LONG CCtrlWindow::OnMacroBringup(UINT wParam, LONG lParam)
+{
+	DWORD pid;
+	DWORD thisThreadId;
+	DWORD fgThreadId;
+
+	thisThreadId = GetWindowThreadProcessId(GetSafeHwnd(), &pid);
+	fgThreadId = GetWindowThreadProcessId(::GetForegroundWindow(), &pid);
+
+	if (thisThreadId == fgThreadId) {
+		SetForegroundWindow();
+		BringWindowToTop();
+	} else {
+		AttachThreadInput(thisThreadId, fgThreadId, TRUE);
+		SetForegroundWindow();
+		BringWindowToTop();
+		AttachThreadInput(thisThreadId, fgThreadId, FALSE);
+	}
+	return 0;
+}

Modified: trunk/teraterm/ttpmacro/ttmmain.h
===================================================================
--- trunk/teraterm/ttpmacro/ttmmain.h	2013-05-20 03:54:08 UTC (rev 5270)
+++ trunk/teraterm/ttpmacro/ttmmain.h	2013-05-20 13:13:15 UTC (rev 5271)
@@ -47,6 +47,7 @@
 	afx_msg LONG OnDdeComReady(UINT wParam, LONG lParam);
 	afx_msg LONG OnDdeReady(UINT wParam, LONG lParam);
 	afx_msg LONG OnDdeEnd(UINT wParam, LONG lParam);
+	afx_msg LONG OnMacroBringup(UINT wParam, LONG lParam);
 	//}}AFX_MSG
 	DECLARE_MESSAGE_MAP()
 };

Modified: trunk/teraterm/ttpmacro/ttmmsg.h
===================================================================
--- trunk/teraterm/ttpmacro/ttmmsg.h	2013-05-20 03:54:08 UTC (rev 5270)
+++ trunk/teraterm/ttpmacro/ttmmsg.h	2013-05-20 13:13:15 UTC (rev 5271)
@@ -8,3 +8,4 @@
 #define WM_USER_DDECMNDEND WM_USER+22
 #define WM_USER_DDECOMREADY WM_USER+23
 #define WM_USER_DDEEND WM_USER+24
+#define WM_USER_MACROBRINGUP WM_USER+25



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