[SHELL32]
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 14 Aug 2017 15:25:58 +0000 (15:25 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 14 Aug 2017 15:25:58 +0000 (15:25 +0000)
commit551d8fa312b48996b505f4f4c080c67de6c008fd
tree42eaf65d9c8587a29b871352aefb7ff7521e2fef
parent9748e8bde3f8ebffa0008fb11bb5976d0eea8218
[SHELL32]
- CDefaultContextMenu: Make it respect the IContextMenu interface and expect menu id offsets instead of real menu ids and actually use the idCmdFirst and idCmdLast parameters in QueryContextMenu. Make the default part use and existed menu from the resources but changed accordingly so the ids of its elements can be adjusted to the next free id of the constructed menu. Rename InsertMenuItemsOfDynamicContextMenuExtension to AddShellExtensionsToMenu, DoDynamicShellExtensions to InvokeShellExt, and DoStaticShellExtensions to InvokeRegVerb. Make AddShellExtensionsToMenu and AddStaticContextMenusToMenu behave like QueryContextMenu to return the number of ids they occupy. Add two helpers SHGetMenuIdFromMenuMsg and SHSetMenuIdInMenuMsg to change the id that is contained in the lparam of WM_DRAWITEM and WM_MEASUREITEM before forwarding them.
- CDefView: When calling QueryContextMenu before using TrackPopupMenu, use 1 as the first id that will filled by the IContextMenu because we want 0 to be used as an indicator that the menu was canceled. Use SHGetMenuIdFromMenuMsg and SHSetMenuIdInMenuMsg to change the lparam of the messages forwarded to the IContextMenu accordingly.
- CDefViewBckgrndMenu: Add a hack so as to keep the code as simple as possible while respecting idCmdFirst and idCmdLast.
- CNewMenu: Remove a hack that was needed because WM_DRAWITEM didn't come with the menu id offset but with the real menu id.
- CDesktopFolder, CFSFolder: Make the callbacks avoid adding an extra separators.
After that shell extensions in menus should work better and callbacks to shell folders should really be able to add several menu items.

svn path=/trunk/; revision=75533
39 files changed:
reactos/dll/win32/shell32/CDefView.cpp
reactos/dll/win32/shell32/CDefViewBckgrndMenu.cpp
reactos/dll/win32/shell32/CDefaultContextMenu.cpp
reactos/dll/win32/shell32/CNewMenu.cpp
reactos/dll/win32/shell32/CNewMenu.h
reactos/dll/win32/shell32/folders/CDesktopFolder.cpp
reactos/dll/win32/shell32/folders/CFSFolder.cpp
reactos/dll/win32/shell32/lang/bg-BG.rc
reactos/dll/win32/shell32/lang/ca-ES.rc
reactos/dll/win32/shell32/lang/cs-CZ.rc
reactos/dll/win32/shell32/lang/da-DK.rc
reactos/dll/win32/shell32/lang/de-DE.rc
reactos/dll/win32/shell32/lang/el-GR.rc
reactos/dll/win32/shell32/lang/en-GB.rc
reactos/dll/win32/shell32/lang/en-US.rc
reactos/dll/win32/shell32/lang/es-ES.rc
reactos/dll/win32/shell32/lang/fi-FI.rc
reactos/dll/win32/shell32/lang/fr-FR.rc
reactos/dll/win32/shell32/lang/he-IL.rc
reactos/dll/win32/shell32/lang/hu-HU.rc
reactos/dll/win32/shell32/lang/it-IT.rc
reactos/dll/win32/shell32/lang/ja-JP.rc
reactos/dll/win32/shell32/lang/ko-KR.rc
reactos/dll/win32/shell32/lang/nl-NL.rc
reactos/dll/win32/shell32/lang/no-NO.rc
reactos/dll/win32/shell32/lang/pl-PL.rc
reactos/dll/win32/shell32/lang/pt-BR.rc
reactos/dll/win32/shell32/lang/pt-PT.rc
reactos/dll/win32/shell32/lang/ro-RO.rc
reactos/dll/win32/shell32/lang/ru-RU.rc
reactos/dll/win32/shell32/lang/sk-SK.rc
reactos/dll/win32/shell32/lang/sl-SI.rc
reactos/dll/win32/shell32/lang/sq-AL.rc
reactos/dll/win32/shell32/lang/sv-SE.rc
reactos/dll/win32/shell32/lang/tr-TR.rc
reactos/dll/win32/shell32/lang/uk-UA.rc
reactos/dll/win32/shell32/lang/zh-CN.rc
reactos/dll/win32/shell32/lang/zh-TW.rc
reactos/dll/win32/shell32/shresdef.h