I want to capture a screenshot using PHP on my local Vista machine. To get started, I just wanted to set a standard example:
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->Navigate("http://www.libgd.org");
while ($browser->Busy) {
com_message_pump(4000);
}
$im = imagegrabwindow($handle, 0);
$browser->Quit();
imagepng($im, "iesnap.png");
imagedestroy($im);
When I run the script (command line), it opens two IE windows. One (the first) remains empty, and the second goes to the specified URL. The picture is taken, saved, and the first window closes. The window that is sent to the URL remains open. The picture itself was taken from the first, empty IE window.
How to target the second window?
- β 1 -
- .:(
: http://iecapt.sourceforge.net/ http://cutycapt.sourceforge.net/, , , .
"" PHP.