Re: How to capture WMP events with script (and not HTML)?
- From: "Alessandro Angeli [MVP::DigitalMedia]" <nobody@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 16 May 2005 05:04:30 +0200
SorceryKid the goth-boi wrote:
> I find it unbelievable that Microsoft itself does not
> keep its own standards straight. They design other
> well-known ActiveX controls (like he one I showed above
> as well as others) that do expose specific properties for
> reassignment with scriptable event handlers. So the MSDN
> site, is not correct in asserting that script authors
> must use SCRIPT FOR..EVENT tags.
You don't understand how events work in ActiveX.
The generic and standard way to sink events from an object
requires the object's client to implement an event sink
interface as defined by the object and connect it to the
object instance. This is the general way but there is no way
to do this in script unless the script engine provides
special support for it and neither JScript nor VBScript do.
So, the script host has to provide a connection mechanism
instead: WSH provides the WScript.ConnectObject() method and
IE provides the <SCRIPT FOR EVENT> tag.
Few ActiveX classes meant to be used in scripting and web
pages, like MSHTML and XMLHTTP, add another custom mechanism
to the standard event dispatching mechanism thus they
provide custom single event connections using internal
properties to hold multicast or unicast event handler
references. This is done to make life easier to users of
those classes with scripts embedded in web pages, but it is
a custom way to handle events that do not work with generic
ActiveX controls because those controls only know about the
standard event sinking mechanism.
IE and WMP have no special support for each other so WMP
fires events the standard way and those events must be sunk
in IE the standard way, which means connection points which
are created in IE using the <SCRIPT FOR EVENT> tag.
--
// Alessandro Angeli
// MVP :: Digital Media
// a dot angeli at psynet dot net
.
- Follow-Ups:
- Re: How to capture WMP events with script (and not HTML)?
- From: SorceryKid the goth-boi
- Re: How to capture WMP events with script (and not HTML)?
- References:
- How to capture WMP events with script (and not HTML)?
- From: SorceryKid the goth-boi
- How to capture WMP events with script (and not HTML)?
- Prev by Date: How to capture WMP events with script (and not HTML)?
- Next by Date: How to improve the performance of playing?
- Previous by thread: How to capture WMP events with script (and not HTML)?
- Next by thread: Re: How to capture WMP events with script (and not HTML)?
- Index(es):
Relevant Pages
|