Send Click Message to another application process

前端 未结 2 844
北荒
北荒 2021-01-26 19:45

I have a scenario, i need to send click events to an independent application. I started that application with the following code.

private Process app;
app = new          


        
相关标签:
2条回答
  • 2021-01-26 20:24

    For a single click you should send two mouse event at the same time for an exact mouse click event.

    SendMessage(nChildHandle, 0x201, 0, 0); //Mouse left down
    SendMessage(nChildHandle, 0x202, 0, 0); //Mouse left up
    

    It is working in my project.

    0 讨论(0)
  • 2021-01-26 20:25

    Save the cursor position, use mouse_event and move the cursor back. mouse_event is really the best way to do this.

    0 讨论(0)
提交回复
热议问题