Page 1 of 1

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

Posted: 14 Aug 2022, 12:28
by wetware05
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).

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

Posted: 14 Aug 2022, 15:36
by SirSocks
AccViewer.ahk does display the active window region within a browser. You'd have to look into a method for extracting the coordinates.

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

Posted: 14 Aug 2022, 16:25
by wetware05
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.

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

Posted: 15 Aug 2022, 06:04
by wetware05
They answered me here. In case anyone is interested in the same subject: https://www.autohotkey.com/boards/viewtopic.php?p=477537#p477537