Share via


Adding a Global New Button Menu Item (Windows Embedded CE 6.0)

1/6/2010

When working with an OS design that supports the AYGShell API extensions, you can create global New button menu items by making two entries in the registry. The first entry registers a GUID for the COM object that serves as the New button menu item's object handler. This COM object must implement an INewMenuItemServer interface. The second entry contains the GUID of the COM object and provides the text string that appears in the New button menu to identify the item. These settings can be made as part of a one-time application installation or they can be made by an application as needed. For more information about these registry settings, see Shell Registry Settings.

When a user chooses the New button menu item, the shell sends a WM_NOTIFY message with the NMN_INVOKECOMMAND notification to the menu bar's parent window, the host application. If the host application is handling the notification itself, it returns TRUE. Otherwise, the parent application returns FALSE, causing the shell to call SHCreateNewItem to create the COM object for the new item. Typically, this launches the application associated with the New button menu item, passing it a command-line parameter or otherwise indicating that the application should create a new item of the chosen type.

It is recommended that you only add one permanent entry for your application to the New button menu. However, you can add multiple dynamic entries for an active foreground application. For more information, see Adding a Temporary New Button Menu Item.

See Also

Concepts

Windows Mobile 6 Professional Style New Button