PRB: Duplicate Menu Items In the File Menu For a Shell Context Menu Extension (214477)
The information in this article applies to:
- Microsoft Platform Software Development Kit (SDK) 1.0, when used with:
- Microsoft Windows NT Server 4.0
- Microsoft Windows NT Workstation 4.0
- the operating system: Microsoft Windows 2000
This article was previously published under Q214477 SYMPTOMSThis article discusses a Beta release of a Microsoft product. The information in this article is provided as-is and is subject to change without notice.
No formal product support is available from Microsoft for this Beta product. For information about how to obtain support for a Beta release, see the documentation that is included with the Beta product files, or check the Web location from which you downloaded the release.
On systems with Shell32.dll version 4.71 or higher, a context menu extension for a file folder that inserts one or more pop-up menus results in duplicates of these menu items. This occurs when the file menu is activated more than once for the selected object.
CAUSE
In a context menu extension, if pop-up menus are inserted using InsertMenu or AppendMenu, then the ID for the pop-up menu item cannot be specified. Instead, this field should take in the HMENU of the pop-up menu. Because the ID is not specified for the pop-up menu item, the Shell does not keep track of the menu item if the file menu is pulled down multiple times. As a result, the pop-up menu items are added multiple times in the context menu.
This problem occurs only when the file menu is pulled down, and does not happen when the context menu is invoked by using the right button or the context menu key.
RESOLUTION
To work around this problem, use InsertMenuItem and specify the ID of the pop-up menu item in the wID member of the MENUITEMINFO structure. Sample code
mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_CHECKMARKS | MIIM_STATE | MIIM_ID;
mii.wID = idCmdFirst++;
STATUS
This behavior is by design.
REFERENCES
Modification Type: | Minor | Last Reviewed: | 7/11/2005 |
---|
Keywords: | kbContMenu kbExtension kbprb KB214477 |
---|
|