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

Posted on 2005-04-15
Last Modified: 2008-01-09

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!
Question by:geokon
    1 Comment
    LVL 4

    Accepted Solution

    If you are familiar with Windows API programming, then you can do it using

    and GetActiveWindow, GetWindowRect API functions.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Bartender - Printing Duplicate Records On Label 2 139
    Adobe Customization Wizard XI issues 26 136
    sumNumber challenge 16 79
    Line meaning 9 57
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
    The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now