WHS, VBS, JS: Getting coordinates of active window and issuing mouseclick event on offset coordinate


Is it possible to retrieve the x,y (or top, left) coordinates of an open window / program via VBS / JS / WSH?

Is it possible to send a "mouseclick" in the same way as you can send keystrokes via the Sendkeys method (WSH)?

I am interested in getting the coordinates of an open application and then send a mouseclick on some coordinates that are offset compared to the x,y / top, left coordinates of the application.

Thank you for any ideas!
Who is Participating?
If you are familiar with Windows API programming, then you can do it using

and GetActiveWindow, GetWindowRect API functions.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.