C
C#•17h ago
RobG66

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
greyfox
greyfox•16h ago
What problem are you having?
mon
mon•16h ago
If you're asking how to add menu options to the file explorer context menu, I believe that is registry related
RobG66
RobG66OP•16h ago
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
mtreit
mtreit•16h ago
If you are on Windows and want to look up the available file type handlers, you can do that via the Windows registry.
RobG66
RobG66OP•16h ago
yes windows
mtreit
mtreit•16h ago
You need to get the progids for a given extension and use that to look up the handler.
RobG66
RobG66OP•16h ago
I have looked into reading the registry and the progids
mtreit
mtreit•16h ago
Here is a sample console program that show the basic idea:
mtreit
mtreit•16h ago
BlazeBin - vsajzkhmxpog
A tool for sharing your source code with the world!
RobG66
RobG66OP•16h ago
but I had issues with getting friendly names for example
mtreit
mtreit•16h ago
It might need some cleanup to handle edge cases, errors, etc.
RobG66
RobG66OP•16h ago
have to enumerate win32apps and uwp apps it seems like it should be straightfoward, but it gets convoluted easily... 🙂
RobG66
RobG66OP•14h ago
success for win32apps
No description
RobG66
RobG66OP•14h ago
uwp is being problematic...
mtreit
mtreit•14h ago
I don't know anything about UWP unfortunately.
RobG66
RobG66OP•14h ago
lol me either... I'm just learning as I go.

Did you find this page helpful?