Re: How to capture WMP events with script (and not HTML)?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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



.



Relevant Pages

  • Re: Some Early Topics
    ... The same way anything else would be considered a de-facto standard. ... But invalid markup does _not_ appear to be widely accepted, ... standard than any other of their mistakes. ... etc.—and none would close the script tag on discovery of ETAGO. ...
    (comp.lang.javascript)
  • Re: RfD: N>R and NR>
    ... You are running backwards - generating HTML, ... You came close to an effective system for standard scripting functions ... in a shell script. ...
    (comp.lang.forth)
  • Re: preferred way of handling events
    ... browser developers must at least glance at the standards, ... bet that a standard approach will be more widely supported. ... script. ... for example - some browsers feature document.addEventListener, ...
    (comp.lang.javascript)
  • Re: Desktop Wallpaper & Group Policy
    ... You could use a script at logon to check for several wallpaper's in the ... You would also need to make sure that the four standard ... strWallpaper = objShell.RegRead ... The script reads the regisrty and checks the keys and uses the sub to reset ...
    (microsoft.public.windows.group_policy)
  • Re: Adding custom attributes through XMLSchema
    ... I want to add custom attributes to my xhtml documents to use with ... > that uses the custom attributes. ... He can write the script without them, ... > that no standard would use. ...
    (comp.infosystems.www.authoring.html)