Browse Source

Z991239-5285 #comment monitor the var TerminalStage, when it turns to N, close the output window

chenliangyu 1 năm trước cách đây
mục cha
commit
5a259c27de
1 tập tin đã thay đổi với 15 bổ sung0 xóa
  1. 15 0
      Module/mod_guiconsole/guitask.cpp

+ 15 - 0
Module/mod_guiconsole/guitask.cpp

@@ -30,6 +30,7 @@ void GUITask::InitBack(CEntityBase* pEntity)
 {
 	m_pEntity = pEntity;
 	m_pEntity->GetFunction()->RegistSysVarEvent("UIState", this);
+	m_pEntity->GetFunction()->RegistSysVarEvent("TerminalStage", this);
 }
 
 ErrorCodeEnum GUITask::Kickoff(CEntityBase *pEntity)
@@ -817,6 +818,20 @@ void GUITask::OnSysVarEvent(const char *pszKey,
 			m_pEntity->GetFunction()->UnregistSysVarEvent("UIState");
 		}
 	}
+
+	if ((_strnicmp(pszKey, "TerminalStage", strlen("TerminalStage")) == 0))
+	{
+		if (_strnicmp(pszValue, "N", strlen("N")) == 0)
+		{
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("close start page");
+#if defined(_MSC_VER)
+			if (m_hWndStartPage) {
+				PostMessageA(m_hWndStartPage, WM_CLOSE, -1, -1);
+			}
+#endif //_MSC_VER
+			m_pEntity->GetFunction()->UnregistSysVarEvent("TerminalStage");
+		}
+	}
 }
 
 ErrorCodeEnum GUITask::HideGuiConsole()