IE calls local applications based on browser applications, which are not expressive enough. We often think that in a webpage, click a link, how nice it is to be able to directly call the installed executable program. According to Microsoft's recommendation, ActiveX is used to embed executable programs into webpages, such as flash ActiveX. In this way, we need to purchase ActiveX signatures. If we do not use signatures, we cannot load them in IE6. It is too expensive to purchase ActiveX signatures for a small project. In addition, it is often necessary to consider what to do if the user suddenly closes the browser. This has little impact on playing a flash, song, and so on. However, in many cases, the battlefield cannot be cleaned before it is closed, causing catastrophic consequences. Generally, in enterprise applications, we always directly call exe through IE.
In windows, the registry contains information about various protocols (http, ftp, telnet, and so on), including parameters of the default open mode. Try it. Enter telnet: // www.163.com in the address bar of IE. What is the problem? A command line window is displayed to start the telnet operation. Why can't IE complete "telnet1: // parameter?
REGEDIT4 [HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ notenote] @ = "URL: notenoteProtocol "www.2cto.com" URL Protocol "=" notepad.exe "[HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ notenote \ DefaultIcon] @ =" notepad.exe, 1 "[HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ notenote \ shell] [HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ notenote \ shell \ open] [HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ notenote \ shell \ open \ command] @ = "\" notepad.exe \", \ "% 1 \""
Import this item to the Registry, and then input notenote in the browser: // you will be pleasantly surprised. Here, the idea is clear. In our installer, set up a protocol in the registry, such as the notenote above, and then write the path information of the exe to be executed, directly click a hyperlink on the webpage, and the Protocol: // parameter is OK. The exe file accepts this parameter for processing. Done. Remember, Protocol: // All strings following are considered as a parameter. Then, the exe file will always have only two parameters. parameter 0 is its complete execution path, and parameter 1 is the character string transmitted from the webpage.
Author wenuy