Send Click Message to another application process

前端 未结 2 849
北荒
北荒 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.

提交回复
热议问题