[Ttssh2-commit] [5185] bringupmacro マクロコマンドを追加した。

svnno****@sourc***** svnno****@sourc*****
2013年 4月 3日 (水) 23:33:41 JST


Revision: 5185
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5185
Author:   yutakapon
Date:     2013-04-03 23:33:41 +0900 (Wed, 03 Apr 2013)
Log Message:
-----------
bringupmacro マクロコマンドを追加した。

Modified Paths:
--------------
    trunk/teraterm/common/helpid.h
    trunk/teraterm/teraterm/ttdde.c
    trunk/teraterm/ttpmacro/ttl.c
    trunk/teraterm/ttpmacro/ttmdde.h
    trunk/teraterm/ttpmacro/ttmparse.c
    trunk/teraterm/ttpmacro/ttmparse.h

-------------- next part --------------
Modified: trunk/teraterm/common/helpid.h
===================================================================
--- trunk/teraterm/common/helpid.h	2013-03-31 10:56:55 UTC (rev 5184)
+++ trunk/teraterm/common/helpid.h	2013-04-03 14:33:41 UTC (rev 5185)
@@ -174,6 +174,7 @@
 #define HlpMacroCommandChecksum16file   92207
 #define HlpMacroCommandChecksum32       92208
 #define HlpMacroCommandChecksum32file   92209
+#define HlpMacroCommandBringupMacro     92210
 
 #define HlpMacroCommandClearscreen      92006
 #define HlpMacroCommandClipb2var        92113

Modified: trunk/teraterm/teraterm/ttdde.c
===================================================================
--- trunk/teraterm/teraterm/ttdde.c	2013-03-31 10:56:55 UTC (rev 5184)
+++ trunk/teraterm/teraterm/ttdde.c	2013-04-03 14:33:41 UTC (rev 5185)
@@ -57,6 +57,36 @@
 
 #define CBBufSize TermWidthMax
 
+
+static void BringupMacroWindow(BOOL flash_flag)
+{
+	HWND hwnd;
+	DWORD pid_macro, pid;
+	DWORD targetid;
+	DWORD currentActiveThreadId;
+
+	currentActiveThreadId = GetWindowThreadProcessId(GetForegroundWindow(), &pid);
+
+	GetWindowThreadProcessId(HWndDdeCli, &pid_macro);
+	hwnd = GetTopWindow(NULL);
+	while (hwnd) {
+		targetid = GetWindowThreadProcessId(hwnd, &pid);
+		if (pid == pid_macro) {
+			if (flash_flag)
+				FlashWindow(hwnd, TRUE);
+
+			SendMessage(hwnd, MY_FORCE_FOREGROUND_MESSAGE, (WPARAM)hwnd, 0);
+		}
+		hwnd = GetNextWindow(hwnd, GW_HWNDNEXT);
+	}
+
+	// \x83}\x83N\x83\x8D\x83E\x83B\x83\x93\x83h\x83E\x96{\x91\xCC
+	ShowWindow(HWndDdeCli, SW_NORMAL);
+	SetForegroundWindow(HWndDdeCli);
+	BringWindowToTop(HWndDdeCli);
+}
+
+
 void GetClientHWnd(PCHAR HWndStr)
 {
 	int i;
@@ -338,6 +368,7 @@
 #define CmdDispStr      'U'
 #define CmdLogInfo      'V'
 #define CmdLogRotate    'W'
+#define CmdBringupMacro 'X'
 
 HDDEDATA AcceptExecute(HSZ TopicHSz, HDDEDATA Data)
 {
@@ -936,6 +967,10 @@
 		}
 		break;
 
+	case CmdBringupMacro:
+		BringupMacroWindow(FALSE);
+		break;
+
 	default:
 		return DDE_FNOTPROCESSED;
 	}
@@ -1146,30 +1181,7 @@
 	// \x8AY\x93\x96\x82\xB7\x82\xE9"ttpmacro"\x82\xF0\x83t\x83\x89\x83b\x83V\x83\x85\x82\xB7\x82\xE9\x81B
 	// (2010.4.2 yutaka, maya)
 	if ((FName == NULL && Startup == FALSE) && ConvH != 0) {
-		HWND hwnd;
-		DWORD pid_macro, pid;
-		DWORD targetid;
-		DWORD currentActiveThreadId;
-
-		currentActiveThreadId = GetWindowThreadProcessId(GetForegroundWindow(), &pid);
-
-		GetWindowThreadProcessId(HWndDdeCli, &pid_macro);
-		hwnd = GetTopWindow(NULL);
-		while (hwnd) {
-			targetid = GetWindowThreadProcessId(hwnd, &pid);
-			if (pid == pid_macro) {
-				FlashWindow(hwnd, TRUE);
-
-				SendMessage(hwnd, MY_FORCE_FOREGROUND_MESSAGE, (WPARAM)hwnd, 0);
-			}
-			hwnd = GetNextWindow(hwnd, GW_HWNDNEXT);
-		}
-
-		// \x83}\x83N\x83\x8D\x83E\x83B\x83\x93\x83h\x83E\x96{\x91\xCC
-		ShowWindow(HWndDdeCli, SW_NORMAL);
-		SetForegroundWindow(HWndDdeCli);
-		BringWindowToTop(HWndDdeCli);
-
+		BringupMacroWindow(TRUE);
 		return;
 	}
 

Modified: trunk/teraterm/ttpmacro/ttl.c
===================================================================
--- trunk/teraterm/ttpmacro/ttl.c	2013-03-31 10:56:55 UTC (rev 5184)
+++ trunk/teraterm/ttpmacro/ttl.c	2013-04-03 14:33:41 UTC (rev 5185)
@@ -2958,6 +2958,18 @@
 	return Err;
 }
 
+
+
+WORD TTLBringupMacro() 
+{
+	WORD Err;
+
+	Err = SendCmnd(CmdBringupMacro, 0);
+
+	return Err;
+}
+
+
 //
 // logrotate size value
 // logrotate rotate num
@@ -5391,6 +5403,8 @@
 			Err = TTLCommCmd(CmdBPlusRecv,IdTTLWaitCmndResult); break;
 		case RsvBPlusSend:
 			Err = TTLCommCmdFile(CmdBPlusSend,IdTTLWaitCmndResult); break;
+		case RsvBringupMacro:
+			Err = TTLBringupMacro(); break;
 		case RsvBreak:
 		case RsvContinue:
 			Err = TTLBreak(WId); break;

Modified: trunk/teraterm/ttpmacro/ttmdde.h
===================================================================
--- trunk/teraterm/ttpmacro/ttmdde.h	2013-03-31 10:56:55 UTC (rev 5184)
+++ trunk/teraterm/ttpmacro/ttmdde.h	2013-04-03 14:33:41 UTC (rev 5185)
@@ -61,6 +61,7 @@
 #define CmdDispStr      'U'
 #define CmdLogInfo      'V'
 #define CmdLogRotate    'W'
+#define CmdBringupMacro 'X'
 
 #ifdef __cplusplus
 extern "C" {

Modified: trunk/teraterm/ttpmacro/ttmparse.c
===================================================================
--- trunk/teraterm/ttpmacro/ttmparse.c	2013-03-31 10:56:55 UTC (rev 5184)
+++ trunk/teraterm/ttpmacro/ttmparse.c	2013-04-03 14:33:41 UTC (rev 5185)
@@ -150,6 +150,7 @@
 		else if (_stricmp(Str,"bplusrecv")==0) *WordId = RsvBPlusRecv;
 		else if (_stricmp(Str,"bplussend")==0) *WordId = RsvBPlusSend;
 		else if (_stricmp(Str,"break")==0) *WordId = RsvBreak;
+		else if (_stricmp(Str,"bringupmacro")==0) *WordId = RsvBringupMacro;
 		else if (_stricmp(Str,"basename")==0) *WordId = RsvBasename;
 		break;
 	case 'c':

Modified: trunk/teraterm/ttpmacro/ttmparse.h
===================================================================
--- trunk/teraterm/ttpmacro/ttmparse.h	2013-03-31 10:56:55 UTC (rev 5184)
+++ trunk/teraterm/ttpmacro/ttmparse.h	2013-04-03 14:33:41 UTC (rev 5185)
@@ -236,6 +236,7 @@
 #define RsvChecksum16File   207
 #define RsvChecksum32   208
 #define RsvChecksum32File   209
+#define RsvBringupMacro 210
 
 #define RsvOperator     1000
 #define RsvBNot         1001



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