From dd845823b666b4b80e16ec20beb4925c429cc7dd Mon Sep 17 00:00:00 2001 From: yuanyuanxiang <962914132@qq.com> Date: Thu, 3 Sep 2026 13:29:39 +0200 Subject: [PATCH] Feature: Add get/set clipboard buttons to remote desktop toolbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add two toolbar buttons — get clipboard (letter C) and set clipboard (letter P) — after the screenshot button and before the minimize button, so clipboard sync stays reachable in fullscreen mode where the system menu cannot be opened. The buttons reuse the existing IDM_GET_CLIPBOARD / IDM_SET_CLIPBOARD system-menu handlers by posting WM_SYSCOMMAND to the parent. The toolbar button count grows from 16 to 18, and the slide/animation dimensions are widened from 640 to 720. Letter C/P icons and Simplified-Chinese source strings ("获取剪贴板", "设置剪贴板") are added, along with English and Traditional-Chinese translations. Co-Authored-By: deepseek-v4-pro --- server/2015Remote/2015Remote.rc | Bin 161668 -> 162044 bytes server/2015Remote/CIconButton.cpp | 12 ++++++++ server/2015Remote/CIconButton.h | 2 ++ server/2015Remote/ToolbarDlg.cpp | 45 ++++++++++++++++++++++-------- server/2015Remote/ToolbarDlg.h | 4 +++ server/2015Remote/lang/en_US.ini | 2 ++ server/2015Remote/lang/zh_TW.ini | 2 ++ server/2015Remote/resource.h | 2 ++ 8 files changed, 58 insertions(+), 11 deletions(-) diff --git a/server/2015Remote/2015Remote.rc b/server/2015Remote/2015Remote.rc index 4657c805e91158d0f26fd4e2689446b4e8c84b82..d9bb5a954bd6c23c297fbe05c332dbadad368648 100644 GIT binary patch delta 107 zcmZp9&-v#gXTui8IoyoS(;c}OMVZ|hTqk??NKP-|Vf2{J$HVBv7yy=-{NW+XWS<@h zkVL}t3(SmK(}9|b7%ip?GBY|(58z?UVl`nfWH6e}2sCDThZ&RDbOk#mu{K`DZM;k^ FSpd}&9ee-) delta 41 xcmezKk+bDJXTui8Io#7lco~bPi}5fzO+UfQm^J+Z52IAO4GetWindowRect(&btnRects[i]); @@ -331,6 +334,8 @@ BOOL CToolbarDlg::OnInitDialog() m_btnY.SubclassDlgItem(IDC_BTN_Y, this); m_btnZ.SubclassDlgItem(IDC_BTN_Z, this); m_btnScreenshot.SubclassDlgItem(IDC_BTN_SCREENSHOT, this); + m_btnGetClipboard.SubclassDlgItem(IDC_BTN_GET_CLIPBOARD, this); + m_btnSetClipboard.SubclassDlgItem(IDC_BTN_SET_CLIPBOARD, this); m_btnMinimize.SubclassDlgItem(IDC_BTN_MINIMIZE, this); m_btnClose.SubclassDlgItem(IDC_BTN_CLOSE, this); @@ -343,6 +348,8 @@ BOOL CToolbarDlg::OnInitDialog() // Y按钮图标在 UpdateButtonIcons 中根据音频状态动态设置 m_btnZ.SetIconDrawFunc(CIconButton::DrawIconLetterZ); // 预留按钮 Z m_btnScreenshot.SetIconDrawFunc(CIconButton::DrawIconScreenshot); + m_btnGetClipboard.SetIconDrawFunc(CIconButton::DrawIconLetterC); + m_btnSetClipboard.SetIconDrawFunc(CIconButton::DrawIconLetterP); m_btnMinimize.SetIconDrawFunc(CIconButton::DrawIconMinimize); m_btnClose.SetIconDrawFunc(CIconButton::DrawIconClose); m_btnClose.SetIsCloseButton(true); @@ -367,6 +374,8 @@ BOOL CToolbarDlg::OnInitDialog() m_tooltip.AddTool(&m_btnY, pParent->m_Settings.AudioEnabled ? _TR("关闭系统音频") : _TR("打开系统音频")); m_tooltip.AddTool(&m_btnZ, _TR("选择ROI")); m_tooltip.AddTool(&m_btnScreenshot, _TR("截图")); + m_tooltip.AddTool(&m_btnGetClipboard, _TR("获取剪贴板")); + m_tooltip.AddTool(&m_btnSetClipboard, _TR("设置剪贴板")); m_tooltip.AddTool(&m_btnMinimize, _TR("最小化")); m_tooltip.AddTool(&m_btnClose, _TR("关闭")); @@ -383,9 +392,9 @@ BOOL CToolbarDlg::OnInitDialog() int monWidth = rcMonitor.right - rcMonitor.left; int monHeight = rcMonitor.bottom - rcMonitor.top; - int hw = 640; + int hw = 720; int vw = 40; - int vh = 640; + int vh = 720; int hx = rcMonitor.left + (monWidth - hw) / 2; switch (m_nPosition) { @@ -514,7 +523,7 @@ void CToolbarDlg::LayoutButtons() { int btnSize = 32; int btnSpacing = 8; - int btnCount = 16; + int btnCount = 18; CWnd* btns[] = { &m_btnExit, @@ -531,6 +540,8 @@ void CToolbarDlg::LayoutButtons() &m_btnY, // 预留按钮 Y &m_btnZ, // 预留按钮 Z &m_btnScreenshot, + &m_btnGetClipboard, + &m_btnSetClipboard, &m_btnMinimize, &m_btnClose, }; @@ -588,9 +599,9 @@ void CToolbarDlg::UpdatePosition() int monWidth = rcMonitor.right - rcMonitor.left; int monHeight = rcMonitor.bottom - rcMonitor.top; - int hw = 640; + int hw = 720; int vw = 40; - int vh = 640; + int vh = 720; int hx = rcMonitor.left + (monWidth - hw) / 2; switch (m_nPosition) { @@ -785,6 +796,18 @@ void CToolbarDlg::OnBnClickedScreenshot() } } +void CToolbarDlg::OnBnClickedGetClipboard() +{ + // 与系统菜单 IDM_GET_CLIPBOARD 相同的处理逻辑 + GetParent()->PostMessage(WM_SYSCOMMAND, IDM_GET_CLIPBOARD, 0); +} + +void CToolbarDlg::OnBnClickedSetClipboard() +{ + // 与系统菜单 IDM_SET_CLIPBOARD 相同的处理逻辑 + GetParent()->PostMessage(WM_SYSCOMMAND, IDM_SET_CLIPBOARD, 0); +} + BOOL CToolbarDlg::PreTranslateMessage(MSG* pMsg) { if (m_tooltip.GetSafeHwnd()) { diff --git a/server/2015Remote/ToolbarDlg.h b/server/2015Remote/ToolbarDlg.h index c150fde..c323d50 100644 --- a/server/2015Remote/ToolbarDlg.h +++ b/server/2015Remote/ToolbarDlg.h @@ -39,6 +39,8 @@ public: CIconButton m_btnY; // 预留按钮 Y CIconButton m_btnZ; // 预留按钮 Z CIconButton m_btnScreenshot; + CIconButton m_btnGetClipboard; // 获取剪贴板 + CIconButton m_btnSetClipboard; // 设置剪贴板 CIconButton m_btnMinimize; CIconButton m_btnClose; @@ -80,6 +82,8 @@ public: afx_msg void OnBnClickedY(); // 预留按钮 Y 响应函数 afx_msg void OnBnClickedZ(); // 预留按钮 Z 响应函数 afx_msg void OnBnClickedScreenshot(); + afx_msg void OnBnClickedGetClipboard(); + afx_msg void OnBnClickedSetClipboard(); afx_msg BOOL OnEraseBkgnd(CDC* pDC); virtual BOOL OnInitDialog(); }; diff --git a/server/2015Remote/lang/en_US.ini b/server/2015Remote/lang/en_US.ini index 03b2514..12a898b 100644 --- a/server/2015Remote/lang/en_US.ini +++ b/server/2015Remote/lang/en_US.ini @@ -231,6 +231,8 @@ RTT=RTT =Send Back ͸=Opacity ͼ=Capture +ȡ=Get Clipboard +ü=Set Clipboard ; ============================================ ; Settings Dialog diff --git a/server/2015Remote/lang/zh_TW.ini b/server/2015Remote/lang/zh_TW.ini index 5bc825f..f2247c0 100644 --- a/server/2015Remote/lang/zh_TW.ini +++ b/server/2015Remote/lang/zh_TW.ini @@ -230,6 +230,8 @@ RTT=RTT =Œ ͸=͸ ͼ=XȡΞĻ +ȡ=ȡüN +ü=ON ; ============================================ ; Settings Dialog diff --git a/server/2015Remote/resource.h b/server/2015Remote/resource.h index 6b39021..6360ab1 100644 --- a/server/2015Remote/resource.h +++ b/server/2015Remote/resource.h @@ -582,6 +582,8 @@ #define IDC_BTN_X 2312 #define IDC_BTN_Y 2313 #define IDC_BTN_Z 2314 +#define IDC_BTN_GET_CLIPBOARD 2315 +#define IDC_BTN_SET_CLIPBOARD 2316 #define IDC_STATIC_ABOUTBOX_YamaV12_2340 2340 #define IDC_STATIC_ABOUTBOX_Copyleft__2341 2341 #define IDC_STATIC_FILE_MANAGER_LOCAL_PATH 2342