Prevent duplicate menus being created by explorer
commit9daba91bf3dc9c9ea3185a7f4357e0621be663cf
authorjohnstevenson <john-stevenson@blueyonder.co.uk>
Fri, 1 Nov 2013 22:17:22 +0000 (1 22:17 +0000)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 2 Nov 2013 04:14:26 +0000 (1 23:14 -0500)
tree2826843c6a50cd57ccc704a3bbbffb7e3b34a368
parent1c2f90efbdec06410553029765ce694efdeeecc2
Prevent duplicate menus being created by explorer

On Vista duplicated Git menu entries are added when you right-click a
folder in the Folders pane.

This is because the Shell calls the handler for the Directory\Background
progid first (with a folder pidl), then calls it again for the other
entries with a data object. So the trick is to check if the Git menu has
already been written.

One way you can do this is by using InsertMenuItem on all menu entries
and adding a unique identifier (your module handle, for example) to the
dwItemData member of the item structure. Then in the QueryContextMenu
function you can check if any menu item has this value and act
accordingly.

[JES: moved hInst back into the Explorer-specific part]

Signed-off-by: johnstevenson <john-stevenson@blueyonder.co.uk>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
explorer/dll.c
explorer/ext.h
explorer/menu.c