Windows Media Player ActiveX Control Example

The following example creates a Windows Media Player in a rollout.

Sample Script:

rollout rActiveX "Windows Media Player in a Rollout"

(

local val

activeXControl ax "{05589FA1-C356-11CE-BF01-00AA0055595A}" height:200 width:300 align:#left

 

button btnPick "Pick Avi" pos:[320, 10]

button btnProps "Show Properties" pos:[320, 50]

listBox lbProps "Properties:" pos:[420, 10] width:170

editText etValue "Value:" pos:[385, 170] width:200

label lblStatus "" pos:[440, 190]

 

on btnPick pressed do

(

local f = getOpenFileName caption:"Pick Any Avi File" types:"*.avi"

if f != undefined then ax.FileName = f

)

on btnProps pressed do

 (

showProperties ax

lbProps.items = getPropNames ax

 )

 on lbProps selected sel do

(

if lbProps.items.count > 0 then

(

try ( val = getProperty ax lbProps.items[sel] ) 

catch ( val == undefined )

etValue.text = val as string   

)

)

on etValue entered text do

(

try( setProperty ax lbProps.selected (text as (classof val)) ) catch( etValue.text = "Set Failed" )

)

on ax timer do

(

sliderTime = animationRange.start + (ax.CurrentPosition * (animationRange.end - animationRange.start))/(ax.selectionEnd - ax.selectionStart)

)

on ax PositionChange oldPos newPos do

(

format "[%, %]\n" oldPos newPos

)

)

 

nf = newRolloutFloater "Test ActiveX" 650 300

addRollout rActiveX nf

ms_ActiveX01.gif

See also

Windows Media Player ActiveX Control

ActiveX Controls in MAXScript Rollouts