1

I want to develop a webapp using ASP.NET but it have to use some client-side functionality provided by desktop application also developed by me.

Existing example: in Picasa Web Album you can click a link called "Download to Picasa" which opens Picasa desktop application and downloads album.

I suppose it require different approaches on different platforms. What are the possibilities to make it work on both Windows and Mac OS X?

rotman
  • 1,641
  • 1
  • 12
  • 25
  • please describe a use case in more details... do you want something to happen in the windows forms host application when you click a button in the web page rendered inside the embedded web browser control? do you have full control of all code in both applications web and windows? – Davide Piras Jul 05 '11 at 06:41
  • Yes, both application would be developed by me. Let's say it's ASP.NET page embedded in WebBrowser control. User clicks some button, application captures this event in some way, then calls some "desktop" method (like communication with a device) and returns a result to the webpage. – rotman Jul 05 '11 at 06:59
  • Which devices do you want to communicate with? – Purplegoldfish Dec 21 '11 at 10:00
  • It doesn't matter what this desktop application does. Communicating with devices was only an example. The desktop application is suposed to do many different things which I'm sure are not possible to do by webapp. – rotman Dec 21 '11 at 10:29

2 Answers2

1

Register a custom URL Protocol Handler. Look here: https://stackoverflow.com/a/2429803/449906

Community
  • 1
  • 1
Jakub Konecki
  • 45,581
  • 7
  • 87
  • 126
  • Thanks Kuba :) It seems that it is exactly what I needed. I was also thinking about some feedback from the desktop app but I suppose it would be easier to communicate directly with the ASP.NET server. – rotman Dec 21 '11 at 10:39
1

I don't know Picasa in detail, but your case sounds like, you start a download by clicking the link "download to picasa". This download will start a link like this:

picasa:///downloadfeed/?uname=ASDFASDFASDF .....

According to your OS any protocol may be associated with a different external program. For information on this you may have a look at the mozilla board .

REGEDIT4

[HKEY_CLASSES_ROOT\foo]
@="URL:foo Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\foo\shell]

[HKEY_CLASSES_ROOT\foo\shell\open]

[HKEY_CLASSES_ROOT\foo\shell\open\command]
@="\"C:\\Program Files\\Application\\program.exe\" \"%1\"" 

If you start such a link, your external programm will start and do what ever you want.

Picasa External Program Start

hth

Pilgerstorfer Franz
  • 8,303
  • 3
  • 41
  • 54