Click here to Skip to main content
15,902,840 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have developed a Windows Form application in C# that interacts with a phone system.

I would like to add click to dial functionality to the application.

When I click on a telephone number in a web browser I would like to copy the telephone number into a string and execute some code in my Windows Form application.

Any help would be appreciated.

Thanks in advance!

What I have tried:

I have looked into using Selenium but it seems that the user must be using an instance of Chrome that Selenium has created to complete the above task.
Posted
Updated 8-Mar-17 23:19pm

Did a Google for you , lots of answers;

get Text from any Browser (IE,Chrome, FireFox, etc)[^]
 
Share this answer
 
Comments
Member 12883479 9-Mar-17 5:28am    
Hi, i'd like to get text from web browser from outside of the Windows Form application. Chrome,IE etc.

From that article is uses "webbrowser1", how do I create this object and link it to my chosen internet browser? Thanks
F-ES Sitecore 9-Mar-17 6:40am    
the "webbrowser1" code is for when you are using an embedded WebBrowser control in a form in your app. You can embed WebBrowser the same way you embed a TextBox or GridView.
You'll probably need to implement a custom protocol handler for "tel". Chances are you already have one, look at the registry here;

HKEY_CLASSES_ROOT\tel

Regardless you'll need to hook into that

Registering an Application to a URI Scheme (Windows)[^]

This will obviously require the html is valid for a usable phone number

<a href="tel:0123456789">0123456789</a>


To preempt your next question, allowing this to work without the proper html markup isn't going to be possible as it would involve specific code to hook into each and every browser, or to provide a plug-in for every browser and there is no way you'll be able to do that easily or reliably.
 
Share this answer
 
Comments
Member 12883479 9-Mar-17 6:15am    
Brilliant, Thank you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900