Registering AutoPlay Event Handlers
The system generates an AutoPlay event whenever the user inserts or attaches removable media to the computer while Windows Media Center is maximized. Each type of removable media causes a different AutoPlay event. When an AutoPlay event occurs, Windows Media Center checks the registry to find a handler for that event. As an OEM, you must register handlers for each type of AutoPlay event that your application handles. To do so, use the following steps:
Create the following keys in the system registry:
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENT VERSION\MEDIA CENTER\AutoPlayHandlers HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENT VERSION\MEDIA CENTER\AutoPlayHandlers\EventHandlers
Under the EventHandlers key, list the media events for which you wish to receive notifications by creating a key specifying the event:
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENT VERSION\MEDIA CENTER\AutoPlayHandlers\EventHandlers\EventHandler
Here, EventHandler is one or more of the following key names, based on the type of media detected:
Media Detected EventHandler key name Redbook audio CD PlayCDAudioOnArrival video DVD PlayDVDMovieOnArrival VCD PlayVCDMovieOnArrival SVCD PlaySVCDMovieOnArrival Video files (removable media) PlayVideoFilesOnArrival Music files (removable media) PlayMusicFilesOnArrival Digital (still) camera CameraOnArrival Sync device TransferOnArrival Photos ViewPictureFilesOnArrival Under each EventHandler key, create one string value for each application that handles the event. The string values have no associated data.
Next, specify the AutoPlay handling application (as a path to an .MCL file) that Windows Media Center should launch for each registered AutoPlay event handler specified in Steps 1 through 3. Start by creating the following key in the system registry:
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENT VERSION\MEDIA CENTER\AutoPlayHandlers\Handlers
Under the Handlers key, create one subkey for each string value specified in Step 3:
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENT VERSION\MEDIA CENTER\AutoPlayHandlers\Handlers\HandlerKeyName
where HandlerKeyName is the same as a string value created in Step 3.
Under each HandlerKeyName key, create the following strings:
Value Type Data Action REG_SZ Display name for the application (this name must be short enough to be displayed in the available space). InvokeMCL REG_SZ Fully-qualified path to the .MCL file that Windows Media Center should process when the AutoPlay event occurs.
See Also