|
@@ -5,6 +5,7 @@
|
|
|
#include "stdafx.h"
|
|
|
#include "WeChats.h"
|
|
|
#include "WeChatsDlg.h"
|
|
|
+#include "CWxObject.h"
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
#define new DEBUG_NEW
|
|
@@ -44,7 +45,7 @@ END_MESSAGE_MAP()
|
|
|
|
|
|
// CWeChatsDlg 对话框
|
|
|
|
|
|
-
|
|
|
+HWND g_hWxWnd = NULL;
|
|
|
|
|
|
|
|
|
CWeChatsDlg::CWeChatsDlg(CWnd* pParent /*=NULL*/)
|
|
@@ -64,6 +65,7 @@ BEGIN_MESSAGE_MAP(CWeChatsDlg, CDialog)
|
|
|
ON_WM_QUERYDRAGICON()
|
|
|
//}}AFX_MSG_MAP
|
|
|
ON_BN_CLICKED(BTN_OPEN_WX, &CWeChatsDlg::OnBnClickedOpenWx)
|
|
|
+ ON_WM_CTLCOLOR()
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
@@ -141,6 +143,8 @@ void CWeChatsDlg::OnPaint()
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ if (g_hWxWnd)
|
|
|
+ ::UpdateWindow(g_hWxWnd);
|
|
|
CDialog::OnPaint();
|
|
|
}
|
|
|
}
|
|
@@ -157,4 +161,61 @@ HCURSOR CWeChatsDlg::OnQueryDragIcon()
|
|
|
void CWeChatsDlg::OnBnClickedOpenWx()
|
|
|
{
|
|
|
// TODO: 在此添加控件通知处理程序代码
|
|
|
+
|
|
|
+#ifdef _DEBUG
|
|
|
+ //vector<DWORD> vtPID = FindAllProcess(_T("lyfzServer.exe"));
|
|
|
+ vector<DWORD> vtPID = FindAllProcess(WECHAT);
|
|
|
+ //vector<DWORD> vtPID = FindAllProcess(_T("cheatengine-x86_64.exe"));
|
|
|
+ //vector<DWORD> vtPID = FindAllProcess(_T("AliIM.exe"));
|
|
|
+ //vector<DWORD> vtPID = FindAllProcess(_T("AliIM.exe"));
|
|
|
+ if (vtPID.size() != 0)
|
|
|
+ {
|
|
|
+ CWxObject wxobj(*vtPID.begin(), _T("E:\\bin\\WeChats2017\\hook.dll"));
|
|
|
+ //if (wxobj.FindWxMainWnd())
|
|
|
+ if (wxobj.FindWxLoginWnd())
|
|
|
+ {
|
|
|
+ //g_hWxWnd = wxobj.GetWxMainWnd();
|
|
|
+ g_hWxWnd = wxobj.GetWxLoginWnd();
|
|
|
+ if (g_hWxWnd != NULL)
|
|
|
+ {
|
|
|
+ // 获取微信窗口的样式;
|
|
|
+ DWORD dwStyle = ::GetWindowLong(g_hWxWnd, GWL_STYLE);
|
|
|
+ // WS_CLIPSIBLINGS告诉父窗口不要绘制子窗口出现的区域;
|
|
|
+ dwStyle |= WS_CLIPSIBLINGS;
|
|
|
+ // 重新设置窗口样式 ;
|
|
|
+ ::SetWindowLong(g_hWxWnd, GWL_STYLE, dwStyle);
|
|
|
+
|
|
|
+ CRect rect;
|
|
|
+ GetDlgItem(WX_RECT)->GetWindowRect(&rect);
|
|
|
+ // 设置背景透明;
|
|
|
+ ::SetParent(g_hWxWnd, GetDlgItem(WX_RECT)->m_hWnd);//set parent of ms paint to our dialog.
|
|
|
+ //::SetParent(hWxWnd, m_hWnd);
|
|
|
+ // 擦除背景;
|
|
|
+ //SetWindowLong(hWxWnd, GWL_STYLE, WS_VISIBLE);//eraze title of ms paint window.
|
|
|
+ //Positioning ms paint.
|
|
|
+ ScreenToClient(wxobj.m_rcWnd);
|
|
|
+ ::MoveWindow(g_hWxWnd, wxobj.m_rcWnd.left, wxobj.m_rcWnd.top, wxobj.m_rcWnd.right, wxobj.m_rcWnd.bottom, true);
|
|
|
+ //ClientToScreen(&rect);
|
|
|
+ //ScreenToClient(&rect);
|
|
|
+ //::SetWindowPos(hWxWnd, NULL, rect.left, rect.top, rect.right, rect.bottom, SWP_SHOWWINDOW | SWP_HIDEWINDOW);
|
|
|
+ //窗口重绘,(因创建exe时,设置为SW_HIDE,导致exe窗口会被父窗口覆盖一部分)
|
|
|
+ //Invalidate();
|
|
|
+ ::UpdateWindow(g_hWxWnd);
|
|
|
+ ::ShowWindow(g_hWxWnd, SW_SHOW);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+#endif
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+HBRUSH CWeChatsDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
|
|
|
+{
|
|
|
+ HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
|
|
|
+
|
|
|
+ // TODO: 在此更改 DC 的任何特性
|
|
|
+ //pDC->SetBkMode(TRANSPARENT);
|
|
|
+
|
|
|
+ // TODO: 如果默认的不是所需画笔,则返回另一个画笔
|
|
|
+ return hbr;
|
|
|
}
|