[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 497
  • Last Modified:

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!
1 Solution
If you are familiar with Windows API programming, then you can do it using

and GetActiveWindow, GetWindowRect API functions.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now