Share via


MediaCenter.DialogEx Method

Shows a Windows Media Center-style dialog box that can contain custom buttons and images, and can pass a result code to an application-defined event handler.

Note   This method has been deprecated.

Syntax

  MediaCenter.DialogEx(
  text
  , 
  caption
  , 
  buttons
  ,
   timeout, modal
  ,
   imagePath
  , 
  onClose
  )

Parameters

text

A String that contains the body text for the dialog box.

caption

A String that contains the text for the caption.

buttons

A collection containing strings and integers that define the buttons to include in the dialog box. For each string in the collection, the method adds a custom button that contains the string. For each number, the method creates a standard button. The standard buttons have the following values:

Value Description
1 OK button
2 Cancel button
4 Yes button
8 No button

timeout

A Number (long) that indicates the time-out duration, in seconds, for the dialog box, at the end of which the dialog box will automatically close. A value of -1 or 0 for a modal dialog box indicates an infinite time-out duration. For a modeless dialog box, Windows Media Center does not allow infinite time-out. If the time-out is set to -1 or 0, a modeless dialog box will close after about five seconds. Modeless dialog boxes have a maximum time-out of 120 seconds.

modal

A Boolean that indicates whether the dialog box is modal (true) or modeless (false). A modal dialog box must be closed by the user or time out before you can continue working with the rest of the application. A modeless dialog box lets you change focus away from it without having to close the dialog box.

imagePath

A String that specifies the path to the PNG-format image to display in the dialog box.

onClose

A String that contains the name of an application-defined event handler. When the dialog box is dismissed, Windows Media Center calls the event handler, passing an integer value that indicates how the dialog box was dismissed. If the user dismissed the dialog box by clicking a standard button, or if the dialog box timed out, the event hander receives one of the following values:

Value Description
0 OK button
1 Cancel button
2 Yes button
3 No button
5 Timed out

If the user clicked a custom button, the event handler receives an integer value greater than or equal to 100. Windows Media Center assigns integer values to custom buttons; the first custom button has a value of 100, the second has a value of 101, and so on.

Return Value

A Number (long) indicating how the dialog box was dismissed. For a modal dialog box, the return value is one of the values listed in the description of the onClose parameter. For a modeless dialog box, the return value is always 4, indicating that the dialog box is active. Regardless of the type of the dialog box, if no valid buttons are specified, the dialog box does not appear and the return value is -1.

Remarks

These dialog boxes are specially designed to integrate with the Windows Media Center user experience; they should be used instead of standard Windows dialog boxes.

Requirements

Platform: HTML application hosted within Windows XP Media Center Edition 2005 through Windows Vista

See Also