程序代码:
<?php
/*$im2 = imagegrabscreen();
imagepng($im2, 'myscreenshot.png');
imagedestroy($im2);*/
$browser = new COM('InternetExplorer.Application');
$handle = $browser->HWND;
$browser->Visible = true;
$browser->Navigate('www.baidu.com');
while ($browser->Busy) {
com_message_pump(4000);
}
$im = imagegrabwindow($handle, 0);
$browser->Quit();
imagepng($im, 'iesnap.png');
?>
程序运行时会弹出一个窗口:
点击View the message即可。