|
void CQQDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
if(!flag)
{
KillTimer(0);
CQQDlg::shuangjishubiao();//双击鼠标
flag = true;
SetTimer(1,925000,NULL);
}
else
{
KillTimer(1);
CQQDlg::dingyishubiaoweizhi();//定义鼠标位置
flag = false;
SetTimer(0,5000,NULL);
}
CDialog::OnTimer(nIDEvent);
}
void CQQDlg::Onwakuang()
{
// TODO: Add your control notification handler code here
zuobiao.x = 723;
zuobiao.y = 376;
//SetTimer(0,2000,NULL);
//GetDlgItem(IDC_jiancha)->SetWindowText("未检测到" + m_banben);
if(!CQQDlg::jiancha())
{
MessageBox("未检测到" +m_banben +",请启动游戏再挖矿");
}
else
{
SetTimer(0,2000,NULL);
}
}
void CQQDlg::shuangjishubiao()
{
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
}
void CQQDlg::dingyishubiaoweizhi()
{
if(biaoshix<4)
{
zuobiao.x = zuobiao.x +40;
}
else
{
zuobiao.x = 723;
}
if(zuobiao.x == 723)
{
if(zuobiao.y < 536)
{
zuobiao.y += 40;
}
else
{
CDialog::OnCancel();
}
biaoshix = 0;
}
biaoshix++;//定义鼠标位置
SetCursorPos(zuobiao.x,zuobiao.y);
}
BOOL CQQDlg:reTranslateMessage(MSG *pMsg)
{
if(pMsg->message == WM_HOTKEY && pMsg->wParam == VK_F3)
{
AfxMessageBox("123");
}
return CDialog:reTranslateMessage(pMsg);
} |
|