Share via


Context Menus

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

Online stores can provide custom context menus. To do this, the online store plug-in implements the IWMPContentPartner::GetCommands method. Windows Media Player calls this method to provide information about the location in the user interface where the context menu is displayed (where the user right-clicked). The plug-in returns an array of WMPContextMenuInfo structures that describe each context menu item, including a command ID for each.

After Windows Media Player has retrieved the array, the Player uses the array to build the context menu the user sees. When the user clicks an item in the context menu, the Player calls IWMPContentPartner::InvokeCommand, passing the command ID associated with the menu item through the dwCommandID parameter. The Player also passes a library location value and an array of IDs that represents the items the menu was invoked upon, such as an array of track IDs. By using this information, the plug-in can start any appropriate process in response to the user's mouse click.

About Type 1 Online Stores