Adding a context menu item to Windows Explorer

I searched for a few days about this, but found nothing. I am trying to figure out how to add a context menu item to Windows Explorer. I do not want this for specific file types, BUT I want it to appear in everything inside a specific path. For example, I want the right side of the "C: \ folder" menu to be able to right-click, but it should not appear outside this folder ...

Is it possible? Any help would be really appreciated!

Thanks in advance, John.

+6
source share
3 answers

You must write a shell extension to embed a custom menu item in the explorer context menu. Here is an example in CodeProject showing how to do this:

File rating - a practical example of a shell extension

+2
source

Beware of managed shell extensions, see here for details http://blogs.msdn.com/b/oldnewthing/archive/2006/12/18/1317290.aspx

About your current question - I know good series of shell extension tutorials, but they are for C ++ - see here http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=152 you need a section Shell Programming and IE

+1
source

The normal way to do this is to add it to the registry under:

HKEY_LOCAL_MACHINE/Software/Classes/Folder/Shell 

However, in your particular case, you want to do some preprocessing before displaying it (for example, in the specified directory), which will not work with a simple registry change.

I think there is a way to get you into any operation and add a hook to it. Now I'm talking about old school knowledge, and I can’t think what technology will be called. I think that, for example, you would, for example, run your way into the rendering engine to put custom skins in regular Explorer windows or add an additional button to the application title bar, as you used to see on the same day.

It just occurred to me that adding a button to the window title could give a starting point for a search, I found this article that refers to subclassing Windows components and overlaying my own behavior. I think this is what I am talking about above:

Hope this will give you a new direction of search.

0
source

Source: https://habr.com/ru/post/886401/


All Articles