|
-
Dec 29th, 2012, 11:02 AM
#1
Thread Starter
Addicted Member
Accessing "Open with" context menu
I have a file browser in my VB.net application and I'm trying to either
a) display the native Explorer file context menu so that users can manipulate files as in Explorer
or
b) create a vb.net context menu and list out the associated applications from the registry.
I have got nowhere with option a) and have been playing with option b).
So far I have got the default association for my "open" option (\shell\open\command), but poking around in the registry I can't see how to recreate the "open with" list.
Although in some cases I can see an open with stub and some progId stubs I can't seem to work out a definitive open with list that is standard for each file type.
Any thoughts on either of these?
-
Dec 29th, 2012, 11:16 AM
#2
Hyperactive Member
Re: Accessing "Open with" context menu
-
Dec 29th, 2012, 11:40 AM
#3
Re: Accessing "Open with" context menu
here's a simplified vb.net solution:
Code:
Process.Start("RUNDLL32.EXE", "shell32.dll,OpenAs_RunDLL " & FileName)
where FileName is a full file path
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Dec 29th, 2012, 12:13 PM
#4
Thread Starter
Addicted Member
Re: Accessing "Open with" context menu
Thanks but I've see that link and that is the choose program menu option dialog which as an aside could be useful but I'm after the "open with" context menu items to list them on my datagridview context menu.
-
Dec 29th, 2012, 09:28 PM
#5
Thread Starter
Addicted Member
Re: Accessing "Open with" context menu
After some further digging I've found various class references :
HKEY_LOCAL_MACHINE\SOFTWARE\Classes
HKEY_LOCAL_CURRENT_USER\SOFTWARE\Classes
Also something similar for Explorer....
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\
So somewhere between these and Microsoft.Win32.Registry.ClassesRoot seems to lie the list.
However it isn't as simple as the "openwith" registry key as it seems to use the "progid" in places too.
If anyone has a simple routine or algorithm to piece together the "open with" list puzzle it would be much appreciated.
-
Dec 30th, 2012, 03:50 PM
#6
Thread Starter
Addicted Member
Re: Accessing "Open with" context menu
I found a c# example of what I'm trying to do.
I'm not 100% sure it works yet and I need to translate it to vb.net, but it suggests and looks like it does what I need.
http://social.msdn.microsoft.com/For...6-28a781b37f72
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|