Share via


Windows XP Media Center Edition SDK Registering an HTML Application 

banner art
Previous Next

Registering an HTML Application

Beginning with Windows XP Media Center Edition 2005, an HTML application must be registered with Media Center. Registering an application adds information about the application to the system registry. Media Center uses the information to manage the application and to include application entry points at various locations in the Media Center user interface. An application entry point is a link to a particular page of an HTML application. It consists of an identifier (GUID), a title, a description, the URL of an HTML page in the application, and the URL of an image to represent the entry point in Media Center. Each entry point is associated with one or more Media Center categories that specify the locations in Media Center where the entry point appears.

An HTML application can be registered in either of the following ways:

  • A previously registered Media Center HTML application or add-in can call the MediaCenter.RegisterApplication or ApplicationInfo.RegisterApplication method to register your application.
  • You can create a setup program that the user copies from disk or downloads from the Web onto the Media Center PC. The setup program uses the RegisterMCEApp.exe command-line utility, located in the \Windows\ehome directory, to register your application.

Unless you already have a registered HTML application or add-in that can call RegisterApplication on behalf of the new application, using RegisterMCEApp.exe is the most appropriate way to register an HTML application. Both registration methods involve using XML code to define your application and its entry points. The RegisterMCEApp.exe utility takes the XML code in the form of a file, while the RegisterApplication methods take the XML code as a string. The XML consists of an application element and one or more nested entrypoint elements. Each entrypoint element can contain one or more nested category elements, one for each category in which the entry point is to appear.

The following code shows how to register an application by calling the MediaCenter.RegisterApplication method.:

  

The GUIDs used in the id attribute of the application and entrypoint elements are standard GUIDs. To generate GUIDs for your HTML application, use a GUID-generating utility such as guidgen.exe from Microsoft. Debugging an application typically involves examining the application's registry entries. To make debugging easier, consider using consecutively numbered GUIDs for your application. That way, the GUIDs appear as adjacent entries in the registry.

See Also

Previous Next

© 2005 Microsoft Corporation. All rights reserved.