Share via


MediaCenter.Dialog Method

Shows a Windows Media Center-style dialog box that has a caption, body text, buttons, and a time-out duration.

Note   This method has been deprecated.

Syntax

  MediaCenter.Dialog(
  text
  , 
  caption
  , 
  nType, timeout, modal
  )

Parameters

text

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

caption

A String that contains the text for the caption.

nType

A Number (long) that indicates the types of standard buttons to add to the dialog box. The standard buttons have the following values:

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

To specify multiple buttons on a dialog box, add the numbers for the individual buttons. The complete list is in the following table. Descriptions show resulting buttons in left-to-right order as they will appear in the dialog box.

Value Description
1 OK
2 Cancel
3 OK, Cancel
4 Yes
5 OK, Yes
6 Yes, Cancel
7 OK, Cancel, Yes
8 No
9 OK, No
10 No, Cancel
11 OK, No, Cancel
12 Yes, No
13 OK, Yes, No
14 Yes, No, Cancel
15 OK, Yes, No, Cancel

Although you can specify any combination, it is best to avoid the following combinations because they may be unclear to the user:

  • OK, Yes
  • OK, Cancel, Yes
  • No, Cancel
  • OK, Yes, No
  • OK, Yes, No, Cancel

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 modeless dialog boxes, 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. A modeless dialog box can be used to present information to the user, but there is no return value to indicate what button was selected to close the dialog box.

Return Value

A Number (long) that indicates how the dialog box was dismissed. It must be one of the following values:

Value Description
-1 No valid nType
0 OK button
1 Cancel button
2 Yes button
3 No button
4 Closed (for modeless dialog boxes)
5 Timed out
6 Active (for modeless dialog boxes)

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.

Modeless dialog boxes do not return a value indicating what button is pressed to close the dialog box. If your application needs to get information from the user (Yes, No, OK or Cancel) you should set the modal parameter to true to make your dialog box modal.

If no valid nType is specified, the dialog box does not appear and the return value is -1.

Requirements

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

See Also