Invoking the Click-To-Record Feature

The Windows Media Center click-to-record feature can be invoked by a Windows Media Center application, by an external application, or by the user launching a click-to-record XML document from the Windows shell.

Invoking from a Windows Media Center Application

A Windows Media Center application makes a click-to-record request by passing the appropriate XML to the EventSchedule.CreateScheduleRequest method. Windows Media Center responds by displaying a dialog box prompting the user to confirm the recording request. If the user approves the request, Windows Media Center attempts to fulfill the request, resulting in one of the following outcomes:

  • The recording request succeeds and Windows Media Center displays a confirmation dialog box.
  • The recording request fails. Windows Media Center displays a dialog box indicating that no matching TV program was found and recording was not scheduled.
  • The recording request results in a conflict. Windows Media Center displays a dialog box prompting the user to either resolve the conflict or cancel the recording request. In a system with a single TV tuner, a conflict occurs when the user tries to record two different channels at the same time. In a two-tuner system, a conflict occurs when the user tries to record three different channels at the same time.

Invoking from an External Application

An external application can make a click-to-record request by calling the EventSchedule.CreateScheduleRequest method in the Microsoft.MediaCenter.TV.Epg namespace. This method is defined in the following assembly:

%windir%\ehome\ehrecobj.dll

External click-to-record applications have special privileges and can schedule recordings without the user's direct involvement. Because of this, the EventSchedule.CreateScheduleRequest method includes the conflictPolicy parameter, which specifies how Windows Media Center should resolve any scheduling conflicts that may occur.

For an example, see Creating a Click-To-Record Request with the CreateScheduleRequest Method.

Invoking from the Windows Shell

The user can invoke the click-to-record feature from anywhere from the Windows shell by double-clicking an XML document that contains elements from the Click-To-Record XML Reference. For example, the user can launch a click-to-record document attached to an e-mail message simply by double-clicking the document.

A click-to-record XML document must have the .c2r file extension. The system registry contains a file association for the .c2r file extension.

Click-to-record documents downloaded from a web server must be defined with the following MIME type:

text/vnd-ms.click2record+xml

Note   Only the EventSchedule.CreateScheduleRequest method can correctly interpret these features of the input XML file. The deprecated ClickToRecord.Submit method for managed code, the MediaCenter.ScheduleRecording method for hosted HTML, and invoking the click-to-record feature from the Windows shell cannot accept this XML and may simply ignore these features.

See Also