我想做一个鼠标自动点击的程序,但执行后鼠标往下面一闪就没了,更别说在游戏中发挥作用了。
#include <windows.h>int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
 
mouse_event(MOUSEEVENTF_MOVE,0,50000,50000,GetMessageExtraInfo());
mouse_event(MOUSEEVENTF_LEFTDOWN,0,50000,50000,GetMessageExtraInfo());
mouse_event(MOUSEEVENTF_LEFTUP,0,50000,50000,GetMessageExtraInfo());  
return 0;
}另外,50000坐标有没有超出屏幕?

解决方案 »

  1.   

    what's this?
    where's the message loop?
      

  2.   

    你可以设计自己定义的坐标,10000,10000都可以
    CRect rectClient;
    GetClientRect(rectClient);
             pDC->SetMapMode(MM_ANISOTROPIC);
    pDC->SetWindowExt(10000,10000);
    pDC->SetViewportExt(rectClient.right,-rectClient.bottom);
    pDC->SetViewportOrg(rectClient.right/2,rectClient.bottom/2);