Record the client's active-window history (start time, window title, and dwell duration), newest first, skipping dwellings under 5 seconds and breaking the timing on idle, capped at 500 entries. Add an "Activity History" item inside the host's Client Management submenu that requests the snapshot over the main connection and shows it in a new dialog. The dialog rebuilds its edit control as a Unicode window so UTF-8 titles render correctly instead of degrading to "?" through the MBCS ANSI boundary. The menu item and dialog title go through _TR and are localized in en_US and zh_TW. Co-Authored-By: deepseek-v4-pro
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#pragma once
|
||
#include "afxcmn.h"
|
||
#include "IOCPServer.h"
|
||
|
||
class CActivityDialog : public CDialogBase
|
||
{
|
||
DECLARE_DYNAMIC(CActivityDialog)
|
||
|
||
public:
|
||
CActivityDialog(CWnd* pParent, Server* pServer, CONTEXT_OBJECT* pContext);
|
||
virtual ~CActivityDialog();
|
||
|
||
virtual void OnReceiveComplete();
|
||
void AppendLog(const std::string& text);
|
||
|
||
protected:
|
||
virtual BOOL OnInitDialog();
|
||
virtual void DoDataExchange(CDataExchange* pDX);
|
||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||
|
||
DECLARE_MESSAGE_MAP()
|
||
|
||
private:
|
||
// 把编辑框重建为 Unicode 类窗口(同 CKeyBoardDlg::RebuildEdit)。
|
||
// 工程是 MBCS,对话框模板创建的是 ANSI 编辑框,SetWindowTextW 会在 W->A
|
||
// 边界用 CP_ACP 转码,Dingbats(✻/✦)等字符会变 ?。重建为 Unicode 后
|
||
// W 版消息直通,不再走 CP_ACP。
|
||
void RebuildEdit(CEdit& m_edit);
|
||
|
||
CEdit m_editLog;
|
||
CFont m_font; // 编辑框字体(成员持有,随对话框销毁,避免堆泄漏)
|
||
|
||
#ifdef AFX_DESIGN_TIME
|
||
enum { IDD = IDD_DIALOG_CLIENT_LOG };
|
||
#endif
|
||
};
|