Reputation: 66935
I have a .NET application running on windows. I want clicking on some page element (button link flash app etc) to launch my app with some special parameters. (It should run not just in IE but on WebKit based windows browsers too) During App install we suppose that user is Admin and is running Vista or Windows 7 or Later.
So my question is - Where to get examples of such interaction (WITH source of course)?
So how to make WebKit based Browser or IE call your .Net application?
Upvotes: 7
Views: 3002
Reputation: 161773
Given that the application to be run, and the browser, are both running on Windows, a registered protocol handler is the best way to go, assuming all interesting browsers support it. Considering that the link above is from the MSDN documentation on Internet Explorer Development, I can imagine that some browsers might not want to support this mechanism.
Upvotes: 0
Reputation: 344547
Register a custom URL Protocol Handler. Then you can specify the url using links, etc:
<a href="myapp://doSomething/>Click to run my app!</a>
If you have Adobe Reader installed, the acrobat://
protocol is registered. Unfortunately, SO doesn't allow links using custom protocols, so I can't add an example here I'm afraid.
Upvotes: 11
Reputation: 38603
You can register a protocol handler that points to your application, then have a link pointing to a URL with that protocol and whatever parameters you need.
Upvotes: 0
Reputation: 138041
You can't have a Webkit-based browser to open an application directly. Your best hope (and what Apple does to open the iTunes Store) would be to have your .NET application register for opening certain types of URLs, use a link that points to an URL of this type.
For instance, if your application can open myapp://
URLs, you could use the following HTTP header:
Location: myapp://mysettings
or a more conventional link:
<a href="myapp://mysettings">Foo</a>
And then the browser will take care to open an application that can handle the myapp://
URL scheme (in this case, your application).
Upvotes: 3
Reputation: 120420
I'd suggest that the only way to do this is by roundtripping to the server. The webpage triggers something on the server. The app is also connected to the server. I think it's probably unreasonable to do it any other way. If you want to get really dirty, it's possible to use Flash's LocalConnection (which uses a memory mapped file for communication) to chat to a .net app. Darron Schall has managed it (but is not sharing).
If it requires an app, why bother with a web page?
Upvotes: 0