开发者

How to do click on specific screen text?

开发者 https://www.devze.com 2023-02-16 12:16 出处:网络
Do you know how to do click on a specific screen text? I need to do click on a text inside a GUI Object from a ex开发者_C百科ternal application; I need to automate this with C#. What is the reference

Do you know how to do click on a specific screen text?

I need to do click on a text inside a GUI Object from a ex开发者_C百科ternal application; I need to automate this with C#. What is the reference that I need to this? I'm new in C#


You need to learn two tricks to accomplish this:

  1. How to find the HWND (the handle) to the window that you want to send the click event to. There are some APIs in the Forms namespace to help with this or you can use PInvoke.

  2. How to send the appropriate windows messages (WM_MOUSEDOWN, WM_MOUSEUP) using SendMessage.

Put these two together and you should be able to simulate a click event.

0

精彩评论

暂无评论...
验证码 换一张
取 消