void CMyDLLDialog::OnBnClickedmousemove() { //MozillaUIWindowClass //EmEditorMainFrame3 CWnd* wnd = FindWindow("EmEditorMainFrame3",NULL); CString x; x.Format("%d",wnd->m_hWnd); ::AfxMessageBox(x); //针对目标窗口 ::PostMessage(wnd->m_hWnd,WM_MOUSEMOVE,5,15); ::PostMessage(wnd->m_hWnd,WM_RBUTTONDOWN,500,500); ::PostMessage(wnd->m_hWnd,WM_RBUTTONUP,500,500); ::SendMessage(wnd->m_hWnd,WM_MOUSEMOVE,5,15); ::SendMessage(wnd->m_hWnd,WM_RBUTTONDOWN,1,1); ::SendMessage(wnd->m_hWnd,WM_RBUTTONUP,1,1); //针对注入的DLL窗口 PostMessage(WM_MOUSEMOVE,5,15); PostMessage(WM_RBUTTONDOWN,500,500); PostMessage(WM_RBUTTONUP,500,500); SendMessage(WM_MOUSEMOVE,5,15); SendMessage(WM_RBUTTONDOWN,1,1); SendMessage(WM_RBUTTONUP,1,1); }