Link to home
Start Free TrialLog in
Avatar of tonygallo10
tonygallo10

asked on

Winform event handler to capture params from email hyperlink

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
http://www.website.com/App/Servlet?paramA=1¶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?
ASKER CERTIFIED SOLUTION
Avatar of razisyed
razisyed

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tonygallo10
tonygallo10

ASKER

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.
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.
command line args are not working, because this is a ClickOnce deployed program see https://www.experts-exchange.com/questions/24433669/Starting-a-console-application-that-was-deployed-with-ClickOnce.html and the blog entry at http://gregdotnet.blogspot.com/2005/12/passing-arguments-to-clickonce.html

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.
Avatar of Jesse Houwing
In that case you should look at a different way to distribute your application. Clickonce doesn't fit the requirements of your app.
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.
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.