note 36475 added to ref.com
| From: | superzouz at rn2 dot php dot net | Date: | Fri, 10 Oct 2003 21:46:29 +0000 |
| Subject: | note 36475 added to ref.com | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-58213@lists.php.net to get a copy of this message | ||
-- Catching COM events --
Hello everyone.
Anyone who did VB + COM would know something is missing here: events!
Here's how to catch IE events using some undocumented functions:
----------
class ieSinker {
var $terminated = false;
function TitleChange($text) {
echo("title has changed: $test \n");
}
function OnQuit() {
echo "Quit!\n";
$this->terminated = true;
}
}
$ie = new COM("InternetExplorer.Application");
$ieSink =& new ieSinker();
com_event_sink($ie, $ieSink, "DWebBrowserEvents2");
while(!$ieSink->terminated) {
com_message_pump(10);
}
----------
Works perfect for me with php 4.3
You can find more info on the undocumented functions in the YACL documentation.
Note the "DWebBrowserEvents2" interface. You can find more information about these in the
microsoft platform SDK documentation, under "web development". Or maybe they have a
smaller web development SDK? I wasn't able to use any other interface, so what I do is send
messages from IE to the PHP script by changing the title of the html document with JavaScript.
By the way, I cant take credit for the above code, I stole it from some website of which I lost the
address.
Thats it... bye...
----
Manual Page -- http://www.php.net/manual/en/ref.com.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36475
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36475&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36475&report=yes
Search -- http://master.php.net/manage/user-notes.php