Winform event handler to capture params from email hyperlink

Posted on 2011-02-18
Last Modified: 2012-05-11
How do I get a Winforms application event handler to receive three parameters from an email (actually, a user clicking something in the email).

my experience is email body contains a hyperlink similar to¶mB=2¶mC=3
a web service receives the values of each of the three parameters and processing them as necessary.

In this case a C#.NET Winforms application needs to receive the three parameters and process them. It is like we are automating the application by sending filter information before it displays a DataGridView. I can format the email hyperlink (or something better) as needed, because I control the creation of the emails.

What C#.NET class should I use to create a handler to receive the parameters, and how do I create inter-process messaging like this?
Question by:tonygallo10
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2

Accepted Solution

razisyed earned 500 total points
ID: 34929445
This is basically done through a custom url protocol handler and. You can use something like myapp://servlet?paramA=1&paramB=2 which will launch your windows winform app.

Take a look at the following msdn articles explaining how to do it:


Author Comment

ID: 34929592
Sorry. I did not explain that the Winform application may be running already, so I cannot use args[0].

It is okay if a window (with DataGridView) popups up automatically from the Winform application, because the action was caused by the user clicking in the email text.

Somehow, I need to get the Winform app to "listen" for the event caused by a user clicking on hyperlink myapp://servlet?paramA=1&paramB=2 in the email.

Expert Comment

ID: 34930268
You can actually still use the same. You would have to make your application a single instance application, and then handle the load event that fires when someone clicks and the application is launced again.
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.


Author Comment

ID: 34943855
command line args are not working, because this is a ClickOnce deployed program see and the blog entry at

Also, I can see problems creating the keys in the registry as I deploy this application to many users who are not administrators on their computer. I stalled in the Microsoft instructions, when i needed to enter the path to the exe in the registry key HKEY_CLASSES_ROOT/TestStatusAlert/shell/open/command

Click Once applications do not have an explicit and consistently (through multiple version updates) available path to the exe.
LVL 17

Expert Comment

by:Jesse Houwing
ID: 34970629
In that case you should look at a different way to distribute your application. Clickonce doesn't fit the requirements of your app.

Author Comment

ID: 34971685
The feature we need to add is just one part of a large application, which has been deployed with ClickOnce. It is the standard deployment strategy of my client. There IT doesn't want to give admin privileges on user desktops, and I agree from a security standpoint.

The one suggestion I have from the experts requires modifying the registry, which requires admin rights. There must be another way.
LVL 17

Expert Comment

by:Jesse Houwing
ID: 34982615
You could create an outlook addin to do it from the mailclient or something similar, but there is no other way to do it by simply clicking a link.

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question