Is there a way to find the application associated with a protocol?
-
Wednesday, September 19, 2012 2:18 PM
Hi all,
I'm trying to understand how to get information on the application that manages a specific protocol.
Just to clarify with an example, I'd like to understand if the protocol 'specificProt:' is associated with some application. The application itself is not important, I need only the anwer to the question "is 'specificProt:' associated with some application?"
To add further information, I have a HyperlinkButton with NavigateUri="specificProt:someURI" and I'd like to hide it if the protocol 'specificProt:' is not associated.
Thanks in advance for any help
All Replies
-
Wednesday, September 19, 2012 2:59 PM
I don't think that it is possible. It is really easy to do from desktop application and I have a tool that do something similar - https://github.com/AndreiMarukovich/AppXplorer - but you will not be able to implement it from Metro app because of system restrictions.
- Edited by Andrei MarukovichMVP Wednesday, September 19, 2012 3:31 PM
- Marked As Answer by Min ZhuMicrosoft Contingent Staff, Moderator Monday, September 24, 2012 1:46 AM
-
Thursday, September 20, 2012 1:01 PM
Thanks for your reply...
Indeed, the example does not work in my Metro Style App.
It is strange there is no way to have the answer to the question "is 'specificProt:' associated with some application?", I don't see any security issue if the application name/location is not passed.
-
Thursday, September 20, 2012 1:42 PMThis is the way how it is designed. From other side, if you will try to use a protocol that is not supported by any currently installed app, Windows will propose to search for an app on the store. So eventually user might get a new app that will support the required contract.
-
Thursday, September 20, 2012 3:56 PM
I think what you're asking for is more configurational, rather than runtime inspection. In other words, the question is "what application is "such and such" protocol associated to?". For example, "http" is associated to C:\Windows\System32\ieframe.dll on my machine.
If that's what you're looking for, you can read the registry under HKEY_CLASSES_ROOT\<protocol in question>.
Here's more information about it:
http://msdn.microsoft.com/en-us/library/aa767914(v=VS.85).aspx
-
Thursday, September 20, 2012 4:09 PMYes, I know that, but I think it is more professional to test it before showing the button...
-
Thursday, September 20, 2012 4:10 PM
thank you, I don't think a metro style app can have access to this information... However, I'll try...
-
Thursday, September 20, 2012 4:17 PMYou're right, no Registry access from a metro style app. Bummer.
-
Thursday, September 20, 2012 4:31 PMModerator
This isn't a security issue. It's a "the user is in control" issue. The design is for the user to be in control of how the document or protocol is handled, not for the application.
As Andrei says, launching it will give the user the opportunity to choose a different app to load the document in (I suspect I'm not the only one who opens many non-registered file types in Notepad) or to look for and install a new one. Not launching it means the user cannot get the content at all.
--Rob
-
Thursday, September 20, 2012 5:53 PM
I understand this new philosophy, but I still think that in a scenario where a user can chose between multiple buttons, the possibility to hide those that are not necessary improves the user interface...


