Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I open a Windows 8 application with a URL?

I am creating an app with a shared session capability. For example a private app-to-app chat session...

I would start the app and create a "chat room" then "share" with someone via email. What I would like to do is create a URL that when it is clicked on it opens the app on your computer... if I am inviting you to my "chat room".

I have poked around on the web but don't see this behavior called out anywhere.

like image 697
Ryan Pedersen Avatar asked Sep 11 '12 04:09

Ryan Pedersen


People also ask

How do I open applications in Windows 8?

There are several ways to open an app in Windows 8: Click the app icon on the taskbar. Double-click the app shortcut on the Desktop. Click the app tile in the Start screen.

How do you add a link to an app in Windows?

Navigate to the website that you want to make an app for, then navigate to the specific page that you want to use for the app. Now, click the menu button (three dots) in the top-right corner of the window and select Apps > Install this site as an app. Type a name for your new app, then click “Install.”

How can you an open an application in a computer?

To start an application program, click on the Start button and select the desired program from the menu. Click on All Programs to see more programs. You can also run applications by typing their name. Click the Start button and type the name of the application you would like to run (e.g. "Excel").


2 Answers

You can do this easily & simply with a metro application by adding a special section to your manifest, and making sure you handle the correct activation type in your activation handler.

You can easily add to the manifest by using the VS Editor for the manfiest:

  • Open the manifest by double clicking on it on solution explorer
  • Select "Declarations" tab
  • Under "Available declarations" select protocol, and then click add
  • Set the name field to the protocol you want. e.g. "myawesomeapp" (this will give you urls like myawesomeapp://foo/bar/baz)

To handle this protocol you need to look for the activation kind "Protocol". This is in your activation handler, and on the "Kind" property. Full details on MSDN here (prog. lang. switch is in the top right) for both JavaScript & C#/C++/VB.

like image 134
Dominic Hopton Avatar answered Sep 30 '22 03:09

Dominic Hopton


You can have your application install a protocol handler.

http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx

http://msdn.microsoft.com/en-us/library/windows/desktop/bb266526(v=vs.85).aspx

Since your app must be installed on both computers, both would have the protocol handler installed.

A protocol handler allows you to define a new protocol name, similar to http: or ftp:, and have your application handle requests for that protocol. I once wrote one for Enterprise Architect that allowed users to share links to diagrams in projects using the format ea://MyProjectName?diagram=SomeDiagram.

You can check out that protocol handler here:

http://sourceforge.net/projects/eaprotocol/

like image 33
Eric J. Avatar answered Sep 30 '22 02:09

Eric J.