SHInvokeContextMenuCommand

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

This function invokes a command from a context menu. It issues the command in the extension that added it to the menu.


BOOL SHInvokeContextMenuCommand(
  HWND hwndOwner,
  UINT idCmd,
  HANDLE hCMExtensions
);

hwndOwner

[in] Handle to the window that owns the menu, message boxes, and so on.

idCmd

[in] Command ID to execute.

hCMExtensions

[in] Handle to the context menu extensions abstraction object.

This function returns TRUE if it is successful and FALSE if it fails.

The extension will usually have at its disposal an abstraction interface from the application that it can use to obtain application-specific information. This will help make the extension more flexible and powerful. If an application abstraction is available, the shell will set it to the site of the extension using IObjectWithSite::SetSite. The extension should implement IObjectWithSite::SetSite.

Thus, when the user chooses a command from the extended menu and the application calls SHInvokeContextMenuCommand,which in turn calls IContextMenu::InvokeCommand, the extension can get a reference to the app abstraction interface by calling IObjectWithSite::GetSite.

Headeraygshell.h
Libraryaygshell.lib
Windows Embedded CEWindows CE 3.0 and later
Windows MobilePocket PC 2000 and later

Community Additions

Show: