Enumerating "Open With" applications and populating a menu
Take the .png file association as an example. I want to dynamically create a context menu which has entries for each application that is associated with the file extension. For example , there would be menu entries like "Open with MSPaint" and "Open With gimp" and whatever else might be installed for viewing/editing images
16 Replies
What problem are you having?
If you're asking how to add menu options to the file explorer context menu, I believe that is registry related
my app displays images.... the file path is in the tag. a dynamic context menu is created, one of the menu items is "Open With" and has sub menu items for each associated app
so right click open triggers an even to populate the menu structure based upon the file type (right now, always image, like a png)
I have Open, Open With, Open File Location and Properties.. All are working except I am having trouble building the Open With sub menu
If you are on Windows and want to look up the available file type handlers, you can do that via the Windows registry.
yes windows
You need to get the progids for a given extension and use that to look up the handler.
I have looked into reading the registry and the progids
Here is a sample console program that show the basic idea:
BlazeBin - vsajzkhmxpog
A tool for sharing your source code with the world!
but I had issues with getting friendly names for example
It might need some cleanup to handle edge cases, errors, etc.
have to enumerate win32apps and uwp apps
it seems like it should be straightfoward, but it gets convoluted easily... 🙂
success for win32apps

uwp is being problematic...
I don't know anything about UWP unfortunately.
lol me either... I'm just learning as I go.