PRB: Duplicate Menu Items In the File Menu For a Shell Context Menu ExtensionID: Q214477
|
BETA INFORMATION BETA INFORMATION BETA INFORMATION |
This 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. |
BETA INFORMATION BETA INFORMATION BETA INFORMATION |
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.
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.
mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_CHECKMARKS | MIIM_STATE | MIIM_ID;
mii.wID = idCmdFirst++;
This behavior is by design.
Additional query words:
Keywords : kbContMenu kbExtension kbNTOS400 kbWinOS2000 kbSDKPlatform kbWinOS95 kbWinOS98 kbGrpShell
Version : WINDOWS:95,98
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: May 19, 1999