Feat: copy selected online host info to clipboard as CSV with menu bitmap

This commit is contained in:
yuanyuanxiang
2026-06-12 19:11:38 +02:00
parent b4ef42923a
commit 1335d636da
7 changed files with 47 additions and 2 deletions

Binary file not shown.

View File

@@ -640,6 +640,7 @@ CMy2015RemoteDlg::CMy2015RemoteDlg(CWnd* pParent): CDialogLangEx(CMy2015RemoteDl
m_bmOnline[55].LoadBitmap(IDB_BITMAP_COMPRESS); m_bmOnline[55].LoadBitmap(IDB_BITMAP_COMPRESS);
m_bmOnline[56].LoadBitmap(IDB_BITMAP_UNCOMPRESS); m_bmOnline[56].LoadBitmap(IDB_BITMAP_UNCOMPRESS);
m_bmOnline[57].LoadBitmap(IDB_BITMAP_UNINSTALL); m_bmOnline[57].LoadBitmap(IDB_BITMAP_UNINSTALL);
m_bmOnline[58].LoadBitmap(IDB_BITMAP_COPY);
for (int i = 0; i < PAYLOAD_MAXTYPE; i++) { for (int i = 0; i < PAYLOAD_MAXTYPE; i++) {
m_ServerDLL[i] = nullptr; m_ServerDLL[i] = nullptr;
m_ServerBin[i] = nullptr; m_ServerBin[i] = nullptr;
@@ -990,6 +991,7 @@ BEGIN_MESSAGE_MAP(CMy2015RemoteDlg, CDialogEx)
ON_COMMAND(ID_VIEW_HIDE_LOG, &CMy2015RemoteDlg::OnViewHideLog) ON_COMMAND(ID_VIEW_HIDE_LOG, &CMy2015RemoteDlg::OnViewHideLog)
ON_MESSAGE(WM_SPLITTER_MOVED, &CMy2015RemoteDlg::OnSplitterMoved) ON_MESSAGE(WM_SPLITTER_MOVED, &CMy2015RemoteDlg::OnSplitterMoved)
ON_MESSAGE(WM_SPLITTER_RELEASED, &CMy2015RemoteDlg::OnSplitterReleased) ON_MESSAGE(WM_SPLITTER_RELEASED, &CMy2015RemoteDlg::OnSplitterReleased)
ON_COMMAND(ID_COPY_CLIENT_INFO, &CMy2015RemoteDlg::OnCopyClientInfo)
END_MESSAGE_MAP() END_MESSAGE_MAP()
@@ -4022,6 +4024,7 @@ void CMy2015RemoteDlg::OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult)
Menu.SetMenuItemBitmaps(ID_MACHINE_LOGOUT, MF_BYCOMMAND, &m_bmOnline[23], &m_bmOnline[23]); Menu.SetMenuItemBitmaps(ID_MACHINE_LOGOUT, MF_BYCOMMAND, &m_bmOnline[23], &m_bmOnline[23]);
Menu.SetMenuItemBitmaps(ID_PROXY_PORT_STD, MF_BYCOMMAND, &m_bmOnline[24], &m_bmOnline[24]); Menu.SetMenuItemBitmaps(ID_PROXY_PORT_STD, MF_BYCOMMAND, &m_bmOnline[24], &m_bmOnline[24]);
Menu.SetMenuItemBitmaps(ID_CANCEL_SHARE, MF_BYCOMMAND, &m_bmOnline[50], &m_bmOnline[50]); Menu.SetMenuItemBitmaps(ID_CANCEL_SHARE, MF_BYCOMMAND, &m_bmOnline[50], &m_bmOnline[50]);
Menu.SetMenuItemBitmaps(ID_COPY_CLIENT_INFO, MF_BYCOMMAND, &m_bmOnline[58], &m_bmOnline[58]);
Menu.ModifyMenuL(ID_ONLINE_AUTHORIZE, MF_BYCOMMAND | MF_STRING, ID_ONLINE_AUTHORIZE, _T("发送授权")); Menu.ModifyMenuL(ID_ONLINE_AUTHORIZE, MF_BYCOMMAND | MF_STRING, ID_ONLINE_AUTHORIZE, _T("发送授权"));
@@ -11270,3 +11273,39 @@ LRESULT CMy2015RemoteDlg::OnSplitterReleased(WPARAM, LPARAM)
THIS_CFG.SetInt("settings", "SplitPos", m_nSplitPos); THIS_CFG.SetInt("settings", "SplitPos", m_nSplitPos);
return 0; return 0;
} }
void CMy2015RemoteDlg::OnCopyClientInfo()
{
CString csv;
EnterCriticalSection(&m_cs);
int nItem = m_CList_Online.GetNextItem(-1, LVNI_SELECTED);
while (nItem != -1) {
context* ctx = GetContextByListIndex(nItem);
if (ctx) {
CString line;
for (int col = 1; col < g_Column_Count_Online; ++col) {
if (col > 1) line += _T(",");
line += ctx->GetClientData(col - 1);
}
csv += line + _T("\r\n");
}
nItem = m_CList_Online.GetNextItem(nItem, LVNI_SELECTED);
}
LeaveCriticalSection(&m_cs);
if (csv.IsEmpty()) return;
if (!OpenClipboard()) return;
EmptyClipboard();
int len = (csv.GetLength() + 1) * sizeof(TCHAR);
HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, len);
if (hMem) {
memcpy(GlobalLock(hMem), (LPCTSTR)csv, len);
GlobalUnlock(hMem);
#ifdef UNICODE
SetClipboardData(CF_UNICODETEXT, hMem);
#else
SetClipboardData(CF_TEXT, hMem);
#endif
}
CloseClipboard();
}

View File

@@ -380,7 +380,7 @@ public:
bool IsDllRequestLimited(const std::string& ip); bool IsDllRequestLimited(const std::string& ip);
void RecordDllRequest(const std::string& ip); void RecordDllRequest(const std::string& ip);
CMenu m_MainMenu; CMenu m_MainMenu;
CBitmap m_bmOnline[58]; // 21 original + 4 context menu + 2 tray menu + 26 main menu + 3 new menu icons + 1 snapshot CBitmap m_bmOnline[59]; // 21 original + 4 context menu + 2 tray menu + 26 main menu + 3 new menu icons + 1 snapshot + 1 copy
uint64_t m_superID; uint64_t m_superID;
std::map<HWND, CDialogBase *> m_RemoteWnds; std::map<HWND, CDialogBase *> m_RemoteWnds;
FileTransformCmd m_CmdList; FileTransformCmd m_CmdList;
@@ -630,4 +630,5 @@ public:
afx_msg void OnViewHideLog(); afx_msg void OnViewHideLog();
afx_msg LRESULT OnSplitterMoved(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnSplitterMoved(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnSplitterReleased(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnSplitterReleased(WPARAM wParam, LPARAM lParam);
afx_msg void OnCopyClientInfo();
}; };

View File

@@ -1749,6 +1749,7 @@ Ghostִ
复制选中=Copy Selected 复制选中=Copy Selected
清空日志=Clear Log 清空日志=Clear Log
隐藏日志=Hide Message 隐藏日志=Hide Message
复制信息=Copy Information
FRPS 运行在本机=FRPS runs on localhost FRPS 运行在本机=FRPS runs on localhost
内网地址:=LAN Address: 内网地址:=LAN Address:
该地址必须为FRP代理服务器IP=Address must be FRP proxy server IP 该地址必须为FRP代理服务器IP=Address must be FRP proxy server IP

View File

@@ -1742,6 +1742,7 @@ Ghostִ
复制选中=复制選中 复制选中=复制選中
清空日志=清空日誌 清空日志=清空日誌
隐藏日志=隐藏日誌 隐藏日志=隐藏日誌
复制信息=复制信息
FRPS 运行在本机=FRPS 运行在本机 FRPS 运行在本机=FRPS 运行在本机
内网地址:=内網地址: 内网地址:=内網地址:
该地址必须为FRP代理服务器IP=該地址必須為FRP代理服務器IP 该地址必须为FRP代理服务器IP=該地址必須為FRP代理服務器IP

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

View File

@@ -266,6 +266,7 @@
#define IDB_BITMAP_COMPRESS 386 #define IDB_BITMAP_COMPRESS 386
#define IDB_BITMAP_UNCOMPRESS 387 #define IDB_BITMAP_UNCOMPRESS 387
#define IDB_BITMAP9 388 #define IDB_BITMAP9 388
#define IDB_BITMAP_COPY 389
#define IDC_MESSAGE 1000 #define IDC_MESSAGE 1000
#define IDC_ONLINE 1001 #define IDC_ONLINE 1001
#define IDC_STATIC_TIPS 1002 #define IDC_STATIC_TIPS 1002
@@ -997,6 +998,8 @@
#define ID_UNINSTALL_SOFTWARE 33059 #define ID_UNINSTALL_SOFTWARE 33059
#define ID_33060 33060 #define ID_33060 33060
#define ID_VIEW_HIDE_LOG 33061 #define ID_VIEW_HIDE_LOG 33061
#define ID_33062 33062
#define ID_COPY_CLIENT_INFO 33063
#define ID_EXIT_FULLSCREEN 40001 #define ID_EXIT_FULLSCREEN 40001
// Next default values for new objects // Next default values for new objects
@@ -1004,7 +1007,7 @@
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 389 #define _APS_NEXT_RESOURCE_VALUE 389
#define _APS_NEXT_COMMAND_VALUE 33062 #define _APS_NEXT_COMMAND_VALUE 33064
#define _APS_NEXT_CONTROL_VALUE 2542 #define _APS_NEXT_CONTROL_VALUE 2542
#define _APS_NEXT_SYMED_VALUE 105 #define _APS_NEXT_SYMED_VALUE 105
#endif #endif