mirror of
https://github.com/yuanyuanxiang/SimpleRemoter.git
synced 2026-01-21 23:13:08 +08:00
Fix: Small issues related to remote desktop control
This commit is contained in:
Binary file not shown.
@@ -604,6 +604,7 @@ BEGIN_MESSAGE_MAP(CMy2015RemoteDlg, CDialogEx)
|
|||||||
ON_COMMAND(ID_PARAM_LOGIN_NOTIFY, &CMy2015RemoteDlg::OnParamLoginNotify)
|
ON_COMMAND(ID_PARAM_LOGIN_NOTIFY, &CMy2015RemoteDlg::OnParamLoginNotify)
|
||||||
ON_COMMAND(ID_PARAM_ENABLE_LOG, &CMy2015RemoteDlg::OnParamEnableLog)
|
ON_COMMAND(ID_PARAM_ENABLE_LOG, &CMy2015RemoteDlg::OnParamEnableLog)
|
||||||
ON_COMMAND(ID_PROXY_PORT, &CMy2015RemoteDlg::OnProxyPort)
|
ON_COMMAND(ID_PROXY_PORT, &CMy2015RemoteDlg::OnProxyPort)
|
||||||
|
ON_COMMAND(ID_HOOK_WIN, &CMy2015RemoteDlg::OnHookWin)
|
||||||
END_MESSAGE_MAP()
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
|
||||||
@@ -1280,6 +1281,8 @@ BOOL CMy2015RemoteDlg::OnInitDialog()
|
|||||||
m_needNotify = THIS_CFG.GetInt("settings", "LoginNotify", 0);
|
m_needNotify = THIS_CFG.GetInt("settings", "LoginNotify", 0);
|
||||||
SubMenu->CheckMenuItem(ID_PARAM_LOGIN_NOTIFY, m_needNotify ? MF_CHECKED : MF_UNCHECKED);
|
SubMenu->CheckMenuItem(ID_PARAM_LOGIN_NOTIFY, m_needNotify ? MF_CHECKED : MF_UNCHECKED);
|
||||||
SubMenu->CheckMenuItem(ID_PARAM_ENABLE_LOG, m_settings.EnableLog ? MF_CHECKED : MF_UNCHECKED);
|
SubMenu->CheckMenuItem(ID_PARAM_ENABLE_LOG, m_settings.EnableLog ? MF_CHECKED : MF_UNCHECKED);
|
||||||
|
m_bHookWIN = THIS_CFG.GetInt("settings", "HookWIN", 0);
|
||||||
|
SubMenu->CheckMenuItem(ID_HOOK_WIN, m_bHookWIN ? MF_CHECKED : MF_UNCHECKED);
|
||||||
std::map<int, std::string> myMap = {{SOFTWARE_CAMERA, "摄像头"}, {SOFTWARE_TELEGRAM, "电报" }};
|
std::map<int, std::string> myMap = {{SOFTWARE_CAMERA, "摄像头"}, {SOFTWARE_TELEGRAM, "电报" }};
|
||||||
std::string str = myMap[n];
|
std::string str = myMap[n];
|
||||||
LVCOLUMN lvColumn;
|
LVCOLUMN lvColumn;
|
||||||
@@ -4201,10 +4204,10 @@ LRESULT CALLBACK CMy2015RemoteDlg::LowLevelKeyboardProc(int nCode, WPARAM wParam
|
|||||||
do {
|
do {
|
||||||
static CDialogBase* operateWnd = nullptr;
|
static CDialogBase* operateWnd = nullptr;
|
||||||
KBDLLHOOKSTRUCT* pKey = (KBDLLHOOKSTRUCT*)lParam;
|
KBDLLHOOKSTRUCT* pKey = (KBDLLHOOKSTRUCT*)lParam;
|
||||||
if (pKey->vkCode == VK_LWIN || pKey->vkCode == VK_RWIN) {
|
if (g_2015RemoteDlg->m_bHookWIN && (pKey->vkCode == VK_LWIN || pKey->vkCode == VK_RWIN)) {
|
||||||
HWND hFore = ::GetForegroundWindow();
|
HWND hFore = ::GetForegroundWindow();
|
||||||
auto screen = (CScreenSpyDlg*)g_2015RemoteDlg->GetRemoteWindow(hFore);
|
auto screen = (CScreenSpyDlg*)g_2015RemoteDlg->GetRemoteWindow(hFore);
|
||||||
if (screen) {
|
if (screen && screen->m_bIsCtrl) {
|
||||||
MSG msg = { 0 };
|
MSG msg = { 0 };
|
||||||
msg.hwnd = hFore;
|
msg.hwnd = hFore;
|
||||||
msg.message = (UINT)wParam;
|
msg.message = (UINT)wParam;
|
||||||
@@ -4224,9 +4227,9 @@ LRESULT CALLBACK CMy2015RemoteDlg::LowLevelKeyboardProc(int nCode, WPARAM wParam
|
|||||||
msg.pt.x = 0;
|
msg.pt.x = 0;
|
||||||
msg.pt.y = 0;
|
msg.pt.y = 0;
|
||||||
screen->SendScaledMouseMessage(&msg, false);
|
screen->SendScaledMouseMessage(&msg, false);
|
||||||
|
// 返回 1 阻止本地系统处理
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
// 返回 1 阻止本地系统处理
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
// 只在按下时处理
|
// 只在按下时处理
|
||||||
if (wParam == WM_KEYDOWN) {
|
if (wParam == WM_KEYDOWN) {
|
||||||
@@ -4465,13 +4468,6 @@ bool IsDateGreaterOrEqual(const char* date1, const char* date2)
|
|||||||
return d1 >= d2;
|
return d1 >= d2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <windows.h>
|
|
||||||
#include <wincrypt.h>
|
|
||||||
|
|
||||||
#pragma comment(lib, "advapi32.lib")
|
|
||||||
|
|
||||||
std::string GetAuthKey(const char* token, long long timestamp)
|
std::string GetAuthKey(const char* token, long long timestamp)
|
||||||
{
|
{
|
||||||
char tsStr[32];
|
char tsStr[32];
|
||||||
@@ -4557,3 +4553,12 @@ void CMy2015RemoteDlg::OnProxyPort()
|
|||||||
MessageBoxA(CString("请通过") + ip.c_str() + ":" + std::to_string(localPort).c_str() + "访问代理端口!",
|
MessageBoxA(CString("请通过") + ip.c_str() + ":" + std::to_string(localPort).c_str() + "访问代理端口!",
|
||||||
"提示", MB_ICONINFORMATION);
|
"提示", MB_ICONINFORMATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CMy2015RemoteDlg::OnHookWin()
|
||||||
|
{
|
||||||
|
m_bHookWIN = !m_bHookWIN;
|
||||||
|
THIS_CFG.SetInt("settings", "HookWIN", m_bHookWIN);
|
||||||
|
CMenu* SubMenu = m_MainMenu.GetSubMenu(2);
|
||||||
|
SubMenu->CheckMenuItem(ID_HOOK_WIN, m_bHookWIN ? MF_CHECKED : MF_UNCHECKED);
|
||||||
|
}
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ protected:
|
|||||||
std::string m_superPass;
|
std::string m_superPass;
|
||||||
BOOL m_needNotify = FALSE;
|
BOOL m_needNotify = FALSE;
|
||||||
DWORD g_StartTick;
|
DWORD g_StartTick;
|
||||||
|
BOOL m_bHookWIN = TRUE;
|
||||||
// 生成的消息映射函数
|
// 生成的消息映射函数
|
||||||
virtual BOOL OnInitDialog();
|
virtual BOOL OnInitDialog();
|
||||||
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||||
@@ -384,4 +384,5 @@ public:
|
|||||||
afx_msg void OnParamLoginNotify();
|
afx_msg void OnParamLoginNotify();
|
||||||
afx_msg void OnParamEnableLog();
|
afx_msg void OnParamEnableLog();
|
||||||
afx_msg void OnProxyPort();
|
afx_msg void OnProxyPort();
|
||||||
|
afx_msg void OnHookWin();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -107,5 +107,8 @@ BOOL CToolbarDlg::OnInitDialog()
|
|||||||
GetDlgItem(IDC_BTN_CLOSE)->SetWindowPos(NULL,
|
GetDlgItem(IDC_BTN_CLOSE)->SetWindowPos(NULL,
|
||||||
startX + (btnWidth + btnSpacing) * 2, y, btnWidth, btnHeight, SWP_NOZORDER);
|
startX + (btnWidth + btnSpacing) * 2, y, btnWidth, btnHeight, SWP_NOZORDER);
|
||||||
|
|
||||||
|
CScreenSpyDlg* pParent = (CScreenSpyDlg*)GetParent();
|
||||||
|
GetDlgItem(CONTROL_BTN_ID)->SetWindowTextA(pParent->m_bIsCtrl ? "暂停控制" : "控制屏幕");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user