Avoiding Pop-up Windows, New Windows, and Dialog Boxes

Do not use pop-up windows in your Windows Media Center application. Pop-up windows present problems for the user when using the remote control because it can be difficult or impossible to get back to the main window. If a dialog box is necessary, Windows Media Center provides its own style of dialog boxes that are created by calling the MediaCenterEnvironment.Dialog and MediaCenterEnvironment.DialogNotification methods. For purposes of promotion or advertising, a page inserted before the target page can be a good substitute for a separate pop-up window.

Some tasks, such as downloading your application, may cause the user's security settings to automatically trigger a standard Windows warning dialog box. Because this can be an awkward experience for a remote control user, it is important to anticipate when this is going to happen and, before loading the page that triggers the dialog box, direct the user to a computer that has a keyboard and mouse. In this case, be sure to exit Microsoft DirectX exclusive mode (see the MediaCenterEnvironment.DirectXExclusive property) so that the dialog boxes do not open out of sight behind the Windows Media Center window. If the download process takes place while navigating to a new page, prevent Windows Media Center from going back into exclusive mode until all dialog boxes are addressed. To keep Windows Media Center from re-entering exclusive mode, include an event handler for the MediaCenterEnvironment.PropertyChanged event in your application to determine whether the DirectXExclusive property changes.

To avoid extra dialog boxes during the download of your ActiveX controls, be sure the controls are properly signed and marked safe for initializing and scripting. For more information about doing this correctly, see Signing and Marking ActiveX Controls on the MSDN web site.

For the process of logging on to a secure site, you should not depend on a standard Windows logon dialog box for the user to enter a user name and password; instead, implement a user interface specifically for this purpose using the same design principles outlined here for the rest of the experience.

If it is necessary to open a standard browser window, use the MediaCenterEnvironment.CreateDesktopShortcut method, which automatically gives the user the option to place a shortcut to the new location on the desktop instead of opening the window immediately.

See Also