Click the hyperlink to open the local EXE application in IE or word.ProgramWhat should I do?
For example, click a link like this.
<A Href= "VIP: 123-monacogp-19279-senna"> Open my protocol</A>
Will open my EXE application?
First, you need to modify the registry so that IE can understand protocols like href = "VIP: 123-monacogp-19279-senna.
C # How do I write the registry?
// write the registry registrykey = registry. classesroot. createsubkey ( "VIP" ); key. setvalue ( "" , "url: VIP protocol" ); key. setvalue ( "URL protocol" , "" ); registrykey subkey = key. createsubkey ( "defaulticon" ); subkey. setvalue ( "" , "EXE file path" ); subkey = key. createsubkey ( "shell" ). createsubkey ( "open" ). createsubkey ( "command" ); subkey. setvalue ( "" , "EXE file path" );
This sectionCodeIs in the RegistryKey for creating a VIP under hkey_classes_root
The structure is as follows:
Hkey_classes_root
VIP
(Default) = "url: VIP protocol"
URL protocol=""
Defaulticon
(Default) = "C: \ somepath \ apptest.exe"
Shell
Open
Command
(Default) = "C: \ somepath \ apptest.exe" "% 1"
After the creation, you can click the link (VIP: 123-monacogp-19279-senna) to open your own external application.
Of course, the winform application can also receive the value you pass.
For example, when the EXE application starts, it receives the 123-monacogp-19279-senna string from the link. You can capture this value when winform starts.
[stathread] static void main (< SPAN class = "kwrd"> string [] ARGs) { If (ARGs. length> 0) { // Arg [0] is the // value = Arg [0 ]; } application. enablevisualstyles (); application. setcompatibletextrenderingdefault ( false ); application. run ( New form1 () ;}
How do I add icons and buttons to the IE Toolbar and open my own applications from the menu?
Let's take a look at this article.
Http://www.codeproject.com/useritems/CorKatIEExtension.asp
Quick registry operations
You can refer
Http://www.codeproject.com/cs/system/quickregistry1.asp
This article source http://www.codeproject.com/aspnet/APPHyperlinks.asp
//
All links aboveArticleOfSource code
Http://www.blogjava.net/Files/wujun/APPTest.rar