Improve: Save user customized remote desktop cursor settings to registry
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user