External Events

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

When users click a button or press a key, you can respond to their input with event handlers. An event handler is a section of code that runs whenever the event is triggered.

The following events are supported by skin elements:

  • load
  • close
  • resize
  • timer
  • click
  • dblclick
  • error
  • mousedown
  • mouseup
  • mousemove
  • mouseover
  • mouseout
  • keypress
  • keydown
  • keyup

See the Skin Programming Reference for more details about specific events.

A typical external event handler would name the event and define the code that will run. For example, if you want to create code to start Windows Media Player when the user clicks on a button, you would put the following line in your button code.

onclick = "JScript: player.URL = 'https://proseware.com/laure.wma' ; "

This will play the file named laure.wma. Note that you add the word "on" to specific events.

Handling Events