Add menu item to windows context menu only for directory than contain specific child directory

0

Similar to https://stackoverflow.com/questions/2123762/add-menu-item-to-windows-context-menu-only-for-specific-filetype

Is is possible to add menu item to windows context menu only for directory than contain specific child directory?

Use case: display context menu for directory if and only if the directory contains child directory named .git/ (directly, i.e. not in subdirectory).

Thanks is advance.

mvorisek

Posted 2020-01-17T09:01:18.183

Reputation: 252

Answers

0

Based on other comments this is not possible without native context handler.

For C# this project https://github.com/dwmkerr/sharpshell can be used to create the native context handler.

mvorisek

Posted 2020-01-17T09:01:18.183

Reputation: 252

1

https://docs.microsoft.com/en-us/windows/win32/shell/handlers

So a context menu extension runs before the menu is shown allowing it to show/hide itself. It also get told about double clicks on the file and can take over the Open verb if so configured.

To see what you can do without programming see https://docs.microsoft.com/en-us/windows/win32/shell/context.

Mark

Posted 2020-01-17T09:01:18.183

Reputation: 243