Windows Explorer New Menu

Gliddador

Member
Joined
Jan 22, 2023
Messages
22
Programming Experience
5-10
In an application I wrote formerly, a very small application, there was code for modifying the Windows Registry, so that the Explorer's New Menu might also be modified. This code worked well on Windows 10, but now, on Windows 11, the changes in the new menu are only seen after logging back into Windows. I did change the code a little, but it remains so sufficiently unmodified that it should still do the same thing.

I know I didn't share my code yet, but by reading this post can you see any problem, so that I must add code to notify the shell? Also, how would I do that?

Thank you.
 
Okay, I think I have to call SHChangeNotify in my code, but I don't want to copy DLL P/Invoke declarations into my code. Is there a good Win32 API NuGet Package that has the SHChangeNotify function and other declarations it needs? Even though I know I probably need to call SHChangeNotify, I'm not sure which event code to pass as an argument. I originally thought it should be the one about file type associations but now I'm not sure.
 
Thank you, but now I have another problem. I somehow changed my code so that the ShellNew thing didn't work properly when creating a new file. I could fix it, but that's not the main problem. The problem is this: I am ignorant of the many ways the registry can be configured to do things with file associations. I was not aware of the OpenWithProgIds key until I saw it in the registry.

I need to display the file type in a listview. I also need someway of combining the data from the current user and the local machine. I'm not sure if using ClassesRoot would work.

Does anyone know a source for learning how to configure the Windows registry? Thank you.

One more question? Is it ShellNew/Open/Command or ShellNew/Command/Open? Thank you.
 
Last edited:
I ordered a book pertaining to the Windows Registry, and intend to finish developing my program after I have gotten the necessary knowledge.
 
Last edited:
Usually the information about the registry is documented in Microsoft's documentation. The hard part maybe that there isn't always a unifying piece of documentation that explains how things are inter-related. Often people just figure it out on their own. Hopefully that book that you ordered provides the needed higher level view.
 
After testing my code again, I realized that it still worked properly. However, I do not know how to retrieve a file type based on its extension from the Windows Registry. Can anyone provide this information, or a resource with this information? Thank you.

Also, I had added a call to SHChangeNotify to my code several days ago, and that caused the Explorer's file new menu to update whenever changes to it are made by my application.
 
Also, I had added a call to SHChangeNotify to my code several days ago, and that caused the Explorer's file new menu to update whenever changes to it are made by my application.

Sounds like the API is working by design.
 
However, I do not know how to retrieve a file type based on its extension from the Windows Registry. Can anyone provide this information, or a resource with this information?

So you've been hacking on the registry but you don't know what you are doing while hacking on the registry. Sounds awfully dangerous to me.
 
I don't have a full understanding of the registry, but I know enough to do certain things, while avoiding making changes that are dangerous. Also, if I were doing anything serious, I would make a backup of the registry, which I ought to do every time that I change it.

I think that I will add a feature in my program to reverse whatever change is made. So far I haven't made any serious mistakes with Registry .NET API, but I have to be careful. I will make sure I back up the registry before each test, and that the program works perfectly before I publish it or make my repository public.

Thank you for the link. I think that, if accurate, it is helpful.
 
You are correct, however, that I should not be messing with the Windows Registry, while having an insufficient understanding. So I will depend on documentation, which is what I've been looking for.
 
Also, I put that I have 5 to 10 years of experience programming, but I have gotten very rusty since I worked for a small startup, and have not done that much coding since then, which was about 10 years ago. I worked there for four years, and had been programming for several years (interrupted years) before that. So even though I am not very skilled now, I provided an honest answer.

To be honest, I was never as good as someone working for Microsoft, or as someone with a computer science background, but I was good enough to do my job, and only had trouble with it when my mental health issues started to flare up again.
 
Last edited:
Back
Top Bottom