System.Diagnostic.Process.Start vs System.Windows.Forms.Help.ShowHelp Open CHM file

Source: Internet
Author: User

CHM file, Microsoft Compiled HTML Help, which is "edited Help file", contains a series of HTML files, index files, and other navigation tools, often as the product's helper file [1].

In. NET programs, the simplest way to open such a file is to call the System.Windows.Forms.Help.ShowHelp () method. According to MSDN, there are four ways of calling [2] overloaded. Control is the parent, and string url,helpnavigator of the Help file is an enumeration type that can be opened with index or topic or other parameters to open the specified interface. An object is a string that specifies the interface.

1 //Displays the contents of the "Help file" at the specified URL.2ShowHelp (Control,String)3 //Displays the contents of the Help file found at the specified URL for a specific topic.4ShowHelp (Control,String, HelpNavigator)5 //Displays the contents of the Help file located at the URL supplied by the user.6ShowHelp (Contorl,String, HelpNavigator, Object)7 //Displays the contents of the Help file found at the specified URL for a specific keyword.8ShowHelp (Control,String,String)

The CHM file opened in this scenario is in the same process as the current application, and the CHM file exits together with the current application closing. However, we found in the application process, if the CHM files and applications are opened by CD-ROM, the path of the CHM file will be error, unable to open the corresponding interface, the contents of the display is unable to find the corresponding page.

System.Diagnostic.Process.Start is used to open a new process [3]. We can use this method to open the CHM file. For example System.Diagnostic.Process.Start (chmfilename), this open method opens the main interface of the CHM file. If you want to open the specified interface of the CHM file, you can take advantage of the hh.exe program provided by Microsoft. We can specify that filename is hh.exe,arguments as Filename::specificpage, which will open the specified interface. However, the CHM opened in this way does not close with the current application.

[1] Https://en.wikipedia.org/wiki/Microsoft_Compiled_HTML_Help

[2] Https://msdn.microsoft.com/en-us/library/system.windows.forms.help.showhelp (v=vs.110). aspx

[3] Https://msdn.microsoft.com/en-us/library/system.diagnostics.process%28v=vs.110%29.aspx?f=255&MSPPError= -2147217396

System.Diagnostic.Process.Start vs System.Windows.Forms.Help.ShowHelp Open CHM file

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.