TinyRun&TestRun: Read configuration when it's available

This commit is contained in:
yuanyuanxiang
2025-07-27 15:20:16 +08:00
parent c9d5e82037
commit c4a613a2e1
3 changed files with 68 additions and 5 deletions

View File

@@ -93,6 +93,12 @@ static UINT Indicators[] =
IDR_STATUSBAR_STRING
};
std::string EventName() {
char eventName[64];
snprintf(eventName, sizeof(eventName), "EVENT_%d", GetCurrentProcessId());
return eventName;
}
//////////////////////////////////////////////////////////////////////////
// 保存 unordered_map 到文件
@@ -1151,6 +1157,14 @@ void CMy2015RemoteDlg::OnTimer(UINT_PTR nIDEvent)
{
if (nIDEvent == TIMER_CHECK)
{
static int count = 0;
static std::string eventName = EventName();
HANDLE hEvent = OpenEventA(SYNCHRONIZE, FALSE, eventName.c_str());
if (hEvent) {
CloseHandle(hEvent);
}else if (++count == 10) {
THIS_APP->UpdateMaxConnection(count);
}
if (!m_superPass.empty()) {
Mprintf(">>> Timer is killed <<<\n");
KillTimer(nIDEvent);