MediaCenter.RegisterApplication Method

Registers an HTML application and its entry points with Windows Media Center, or unregisters an application, removing all of its entry points from Windows Media Center.

Note   This method has been deprecated.

Syntax

  MediaCenter.RegisterApplication(
  sXMLAppInfo, fUnRegister, fAllUsers)

Parameters

sXMLAppInfo

A String that contains the application, entrypoint, and category XML elements that identify the HTML application, its entry points, and the Windows Media Center categories in which the entry points appear. Alternatively, this parameter can specify the path to an XML file that contains the application, entrypoint, and category elements for the HTML application.

fUnRegister

A Boolean that indicates whether to unregister the HTML application. Set this parameter to true to unregister, or false otherwise.

fAllUsers

A Boolean that indicates whether to register or unregister the HTML application for all users, or just for the current user. Set this parameter to true to register for all users, or false to register for just the current user.

Return Value

A Number (long) that is zero if the method succeeded, and nonzero if it failed.

Remarks

As an alternative to using this method, you can create a setup program that uses the RegisterMCEApp.exe utility to register your application. This utility is included in the %windir%\ehome\ directory.

This method registers an HTML application and its supported entry points with Windows Media Center. An entry point is a link to a particular page in an HTML application, and consists of an identifier, a URL, a title, a description, and an image. Each entry point must be associated with at least one Windows Media Center category, which determines the locations in the Windows Media Center UI where the entry point is placed.

The XML code specified in the xmlAppInfo parameter must contain a single application element with one or more nested entrypoint elements. Each entrypoint element must have one or more nested category elements.

If you have more than one URL associated with your application, use one entrypoint element for each URL. Each entry point may appear in several categories in the Windows Media Center UI; include one category element inside the entrypoint element for each category in which you want the entry point to appear. Be sure that each category element has exactly one category attribute. For a list of Windows Media Center categories (which are possible values for the category attribute), see category Element.

When an HTML application calls this method, Windows Media Center displays a dialog box that lets the user confirm or cancel the registration.

Note that the Add Link to More Programs dialog box displays the source URL, not the destination URL.

To unregister an HTML application, use the same xmlAppInfo string that was used to register the application.

If you call this method for an HTML application that is already registered, Windows Media Center removes the previous registration before reregistering the application.

This method throws the following exceptions:

  • "The specified application is already registered"
  • "The specified application is not registered"
  • "The specified application cannot be registered, access denied"

For code examples of registering applications, see [WMCSDK_InstallPath]\Samples\Register Application.

Requirements

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

See Also