Clicking mouse by sending messages

后端 未结 2 897
孤街浪徒
孤街浪徒 2021-01-18 11:01

I\'m trying to send mouse clicks to a program. As I don\'t want the mouse to move, I don\'t want to use SendInput or mouse_event, and because the window that should receive

相关标签:
2条回答
  • 2021-01-18 11:54

    You need to pack the coordinates correctly like Chris says, also remember that x and y are client coordinates, call ScreenToClient() to convert screen coordinates.

    0 讨论(0)
  • 2021-01-18 11:57

    The problem is with your packing of the x,y coordinates.

    1. y should be in the high order word
    2. You should use | (bitwise or) to combine the components of the coordinate pair

    You should have the following

    ((y << 0x10) | x)
    
    0 讨论(0)
提交回复
热议问题