How to realize the relative coordinates of simulated Click window by c-sharp

C-sharp wrote a form with a window loaded with flash on the network. The flash has a button to click. I moved the mouse over this button with Point formPoint = this.PointToClient (Control.MousePosition); got the coordinates of the mouse relative to the upper-left corner of the form.
so how do I automatically move the mouse to that coordinate and click when I reopen the program?
(do not use the solution of full-screen absolute coordinates, because the program will run on different machines)

Mar.29,2021

just talk about ideas:

  1. use the PointToScreen (button relative coordinates) of the form to get the button screen coordinates
  2. use the win32 macro mouse_event to click, see https://stackoverflow.com/que.
Menu