Share via


THEME.openDialog

[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.]

The openDialog method opens a file dialog box.

        theme.openDialog(dialogType, parameters)

Parameters

dialogType

A String that specifies the type of dialog box. Must be set to "FILE_OPEN".

parameters

A String that can be used for additional information. Must be set to "FILES_ALLMEDIA".

Return Value

This method returns a String containing the URL of the selected file or "" (empty string) if the user clicks cancel.

Remarks

This method can be used for files on the local hard drives or on network drives.

Examples

<THEME>
  <VIEW id="View1" 
    backgroundImage="greenstone.bmp" 
    width=500 height=300 author="Microsoft Corp.">
    <BUTTON 
      id="Open" 
      image="Open.png" 
      onclick="jscript:
        player.URL = theme.openDialog('FILE_OPEN','FILES_ALLMEDIA')">
    </BUTTON>
  </VIEW>
</THEME>

Requirements

Requirement Value
Version
Windows Media Player version 7.0 or later

See also

THEME Element