Files
SimpleRemoter/server/2015Remote/ToolbarDlg.h
yuanyuanxiang dd845823b6 Feature: Add get/set clipboard buttons to remote desktop toolbar
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
2026-09-03 13:29:39 +02:00

90 lines
3.0 KiB
C++

#pragma once
#include "Resource.h"
#include "LangManager.h"
#include "CIconButton.h"
class CScreenSpyDlg;
class CToolbarDlg : public CDialogLangEx
{
DECLARE_DYNAMIC(CToolbarDlg)
private:
int m_lastY = 0; // 记录上一次的 Y 坐标
public:
CScreenSpyDlg* m_pParent = nullptr;
CToolbarDlg(CScreenSpyDlg* pParent = nullptr);
virtual ~CToolbarDlg();
enum { IDD = IDD_TOOLBAR_DLG };
int m_nHeight = 40;
bool m_bVisible = false;
bool m_bLocked = false; // 是否锁定工具栏
int m_nPosition = 0; // 工具栏位置 (0=上, 1=下, 2=左, 3=右)
int m_nOpacityLevel = 0; // 透明度级别 (0=100%, 1=75%, 2=50%)
// Icon buttons
CIconButton m_btnExit;
CIconButton m_btnControl;
CIconButton m_btnLock;
CIconButton m_btnPosition;
CIconButton m_btnOpacity;
CIconButton m_btnSwitchScreen;
CIconButton m_btnBlockInput;
CIconButton m_btnStatusInfo;
CIconButton m_btnQuality;
CIconButton m_btnRestoreConsole;
CIconButton m_btnX; // 切换窗口按钮
CIconButton m_btnY; // 预留按钮 Y
CIconButton m_btnZ; // 预留按钮 Z
CIconButton m_btnScreenshot;
CIconButton m_btnGetClipboard; // 获取剪贴板
CIconButton m_btnSetClipboard; // 设置剪贴板
CIconButton m_btnMinimize;
CIconButton m_btnClose;
bool m_bBlockInput = false; // 远程输入锁定状态
bool m_bShowStatusInfo = true; // 状态信息窗口显示状态
CToolTipCtrl m_tooltip;
void SlideIn();
void SlideOut();
void CheckMousePosition();
void UpdatePosition(); // 更新工具栏位置
void LayoutButtons(); // 重新排列按钮布局
void LoadSettings(); // 从注册表加载设置
void SaveSettings(); // 保存设置到注册表
void ApplyOpacity(); // 应用透明度
void UpdateButtonIcons(); // 更新状态相关按钮的图标和提示文本
RECT GetParentMonitorRect(); // 获取父窗口所在显示器的矩形区域
protected:
virtual void DoDataExchange(CDataExchange* pDX);
virtual BOOL PreTranslateMessage(MSG* pMsg);
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedExitFullscreen();
afx_msg void OnBnClickedCtrl();
afx_msg void OnBnClickedMinimize();
afx_msg void OnBnClickedClose();
afx_msg void OnBnClickedLock();
afx_msg void OnBnClickedPosition();
afx_msg void OnBnClickedOpacity();
afx_msg void OnBnClickedSwitchScreen();
afx_msg void OnBnClickedBlockInput();
afx_msg void OnBnClickedStatusInfo();
afx_msg void OnBnClickedQuality();
afx_msg void OnBnClickedRestoreConsole();
afx_msg void OnBnClickedX(); // 切换窗口响应函数
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();
};