Determines whether to play media inserted by a user and if so using what restrictions.
HRESULT AllowAutoPlay( LPCWSTR pszPath, DWORD dwContentType, LPCWSTR pszLabel, DWORD dwSerialNumber );
The drive letter in the form D:</b>
The type of content as specified by the following flags.
Use the Autorun.inf file. This is the traditional AutoRun behavior.
AutoRun audio CDs.
AutoPlay blank CD-Rs and CD-RWs.
AutoPlay blank DVD-Rs and DVD-RAMs.
AutoRun if the media is formatted and the content does not fall under a type covered by one of the other flags.
AutoPlay if the content consists of file types defined as pictures, such as .bmp and .jpg files.
AutoPlay if the content consists of file types defined as music, such as MP3 files.
AutoPlay if the content consists of file types defined as video files.
Introduced in Windows Vista. AutoPlay video CDs (VCDs).
Introduced in Windows Vista. AutoPlay Super Video CD (SVCD) media.
Introduced in Windows Vista. AutoPlay DVD-Audio media.
AutoPlay blank recordable high definition DVD media in the Blu-ray Disc™ format (BD-R or BD-RW). Note: Prior to Windows 7, this value was defined to specify non-recordable media in the HD DVD format.
Introduced in Windows Vista. AutoPlay high definition DVD media in the Blu-ray Disc™ format.
Introduced in Windows 8.
Introduced in Windows 8.
Introduced in Windows Vista. AutoPlay empty but formatted media.
Introduced in Windows Vista. A mask that denotes valid ARCONTENT flag values for media types. This mask does not include ARCONTENT_PHASE values.
Introduced in Windows Vista. AutoPlay is searching the media. The phase of the search (presniff, sniffing, or final) is unknown.
Introduced in Windows Vista. The contents of the media are known before the media is searched, due to the media type; for instance, audio CDs and DVD movies.
Introduced in Windows Vista. AutoPlay is currently searching the media. Any results reported during this phase should be considered a partial list as more content types might still be found.
Introduced in Windows Vista. AutoPlay has finished searching the media. Results reported are final.
Introduced in Windows Vista. A mask that denotes valid ARCONTENT_PHASE values.
The media label.
The media serial number.
Returns S_OK to allow AutoRun or S_FALSE to cancel AutoRun.
Applications register an instance of the IQueryCancelAutoPlay interface in the running object table (ROT). Before the Shell starts AutoRun or AutoPlay, when the user inserts new media, it checks the ROT for a component implementing IQueryCancelAutoPlay. If it finds one, the Shell calls that implementation's IQueryCancelAutoPlay::AllowAutoPlay method to determine whether it should proceed, and using what restrictions.
Upon presentation of media, the Shell searches the ROT for a component implementing IQueryCancelAutoPlay. If one is found, the class identifier (CLSID) of that component's moniker is extracted. The presence of a ROT registration informs the Shell that the component might want to cancel AutoRun or AutoPlay. For confirmation, the Shell must also find a registry key for that same CLSID at the following location:
SOFTWARE Microsoft Windows Current Version Explorer AutoplayHandlers CancelAutoplay CLSID The component's CLSIDThis value is added by the application or hardware, usually at installation time. It isn't assigned a data value.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|