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:

  1. 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
    
  2. 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 DetectedEventHandler key name
    Redbook audio CDPlayCDAudioOnArrival
    video DVDPlayDVDMovieOnArrival
    VCDPlayVCDMovieOnArrival
    SVCDPlaySVCDMovieOnArrival
    Video files (removable media)PlayVideoFilesOnArrival
    Music files (removable media)PlayMusicFilesOnArrival
    Digital (still) cameraCameraOnArrival
    Sync deviceTransferOnArrival
    PhotosViewPictureFilesOnArrival

  3. Under each EventHandler key, create one string value for each application that handles the event. The string values have no associated data.
  4. 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
    
  5. 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.

  6. Under each HandlerKeyName key, create the following strings:
    ValueTypeData
    ActionREG_SZDisplay name for the application (this name must be short enough to be displayed in the available space).
    InvokeMCLREG_SZFully-qualified path to the .MCL file that Windows Media Center should process when the AutoPlay event occurs.

See Also

Page view tracker