mirror of
https://github.com/yuanyuanxiang/SimpleRemoter.git
synced 2026-01-21 15:03:09 +08:00
Fix: TestRun run as windows service can't unlock screen
This commit is contained in:
@@ -239,7 +239,11 @@ BOOL LaunchAsAdmin(const char* szFilePath, const char* verb)
|
||||
|
||||
BOOL CMy2015RemoteApp::InitInstance()
|
||||
{
|
||||
#if _DEBUG
|
||||
BOOL runNormal = TRUE;
|
||||
#else
|
||||
BOOL runNormal = THIS_CFG.GetInt("settings", "RunNormal", 0);
|
||||
#endif
|
||||
char curFile[MAX_PATH] = { 0 };
|
||||
GetModuleFileNameA(NULL, curFile, MAX_PATH);
|
||||
if (!runNormal && !IsRunningAsAdmin() && LaunchAsAdmin(curFile, "runas")) {
|
||||
|
||||
@@ -142,6 +142,13 @@ void CPasswordDlg::OnCbnSelchangeComboBind()
|
||||
std::string hardwareID = CMy2015RemoteDlg::GetHardwareID(m_nBindType);
|
||||
m_sDeviceID = getFixedLengthID(hashSHA256(hardwareID)).c_str();
|
||||
m_EditDeviceID.SetWindowTextA(m_sDeviceID);
|
||||
auto master = THIS_CFG.GetStr("settings", "master", "");
|
||||
if (m_nBindType == 1) {
|
||||
MessageBoxA("请确认是否正确设置公网地址(IP或域名)?\r\n"
|
||||
"绑定IP后主控只能使用指定IP,绑定域名后\r\n"
|
||||
"主控只能使用指定域名。当前公网地址: \r\n"
|
||||
+ CString(master.empty() ? "未设置" : master.c_str()), "提示", MB_OK | MB_ICONWARNING);
|
||||
}
|
||||
}
|
||||
|
||||
void CPasswordDlg::OnOK()
|
||||
|
||||
@@ -346,7 +346,7 @@ public:
|
||||
}
|
||||
virtual bool IsEqual(context *ctx) const
|
||||
{
|
||||
return this == ctx || (GetPeerName() == ctx->GetPeerName() && GetPort() == ctx->GetPort());
|
||||
return this == ctx || this->GetPort() == ctx->GetPort();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user