Know the coordinates and size of a browser's client window

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
wetware05
Posts: 750
Joined: 04 Dec 2020, 16:09

Know the coordinates and size of a browser's client window

Post by wetware05 » 14 Aug 2022, 12:28

Hi. :wave:

How to know the coordinates and size of a browser's client window? I don't know if I'm using the right language. I am referring to the window where the web page is seen, if the additions of the scroll bar, the favorites buttons, the address bar, the tabs and the status bar...

I've been looking all over the place, using different functions, but none of them give me this information. I need it to take a screenshot, but all the grabbers I've used take it from the whole browser, not just from the client window (I know it can be cropped afterwards, but I need it for an automatic process. I also know I can crop the image knowing what it looks like in my browser and screen, but I need it for any browser and screen size, so I can share the script. Not just that it works for me).

User avatar
SirSocks
Posts: 360
Joined: 26 Oct 2018, 08:14

Re: Know the coordinates and size of a browser's client window

Post by SirSocks » 14 Aug 2022, 15:36

AccViewer.ahk does display the active window region within a browser. You'd have to look into a method for extracting the coordinates.

wetware05
Posts: 750
Joined: 04 Dec 2020, 16:09

Re: Know the coordinates and size of a browser's client window

Post by wetware05 » 14 Aug 2022, 16:25

hi SirSock, what you tell me is what I am "investigating". I've already tried Acc.ahk, it's also a great resource UIAutomation viewtopic.php?f=6&t=104999, which is supposed to be the successor to Acc/MSAA. Through the UIAutomation inspector I can see the coordinates, but not "query" the library to give them to me in some variables. I'll ask there.

ImagePut is a good https://github.com/iseahound/ImagePut, fast and "silent" screen grabber, but it captures the application, not the client window.

Thanks for your interest.

wetware05
Posts: 750
Joined: 04 Dec 2020, 16:09

Re: Know the coordinates and size of a browser's client window

Post by wetware05 » 15 Aug 2022, 06:04

They answered me here. In case anyone is interested in the same subject: https://www.autohotkey.com/boards/viewtopic.php?p=477537#p477537

Post Reply

Return to “Ask for Help (v1)”