R
R
rrud2011-09-12 13:06:36
Screenshots
rrud, 2011-09-12 13:06:36

How to program automatic screenshot creation in FF, Chrome and Opera

You need to write a program with one button. Open a browser (any), open some page in it, click on the button in the program. The output is a file with a screenshot of a long web page.
A la, how it is implemented in FastStone Capture.

To implement this, you need to determine the current position of the visible area relative to the page and automatically scroll the window. It turned out to write an implementation for IE. But with FF, Chome and Opera - difficulties.

How can I determine the full size of the scrollbox window? I'm trying to do it through GetScrollInfo. For some windows, the function returns normal values ​​(notepad, explorer), for others it returns zeros. Ideally, I need to get the size of the web page loaded in the browser by passing the browser window handle to the function.

Or suggest another implementation.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vasily, 2011-09-12
@VasiliyIsaichkin

Not all yogurt programs are equally useful written. And therefore, not everyone uses WinAPI to create UI objects in their window, and therefore GetScrollInfo will not work everywhere - the conclusion is that if the program does not have some kind of API for obtaining information and it does not use the generally accepted API that could provide it, it will be extremely difficult.

G
GavriKos, 2011-09-12
@GavriKos

Are you sure that GetScrollInfo is taken from the desired inner window? In theory, in any case, if the scroll component is standard, then it can be obtained, but maybe the reason is in the wrong "bulkhead" of the window components?
As an alternative - "tear out" the address from the browser, load it inside the program and "screen" it already inside. But here is an ambush - the page will not look the same as in the target browser.

K
Kindman, 2011-09-12
@Kindman

And besides Internet Explorer (and WinWord ), does any other browser support
COM automation ? That is, something like this:

COM("InternetExplorer.Application");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question