Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open CHM file on specified node TOC (.NET)

Tags:

.net

chm

Hi I need implement context help inside my .NET application. I have .chm file and I'm looking for possibility to open it in standard viewer and hightlight required topic of TOC (or Index entry)

Any idea how to archive that ?

EDIT:

Maybe MS application used to open CHM file has some command line parameters which allows archive that?

BTW: Where can I find that app?

like image 428
Maciej Avatar asked Jun 17 '09 10:06

Maciej


People also ask

How do I view the contents of a CHM file?

Solution: Run Windows Explorer, right-click on the CHM file, and select Properties from the popup menu. Click on the Unblock button immediately below the Advanced button on the General page. Click Apply to show the content. Once the CHM file has been unblocked, the Unblock button disappears.

How do I open CHM files in Windows 11?

To open a CHM file on Window 11/10, you just need to double-click on the file and then select the Microsoft HTML Help executable program to open it up. HTML Help executable program is provided by Microsoft to open CHM files on Windows PC. You can also use the Calibre software to open and view CHM files.

What is chm file?

CHM (Microsoft Compiled HTML Help) is the extension used by Windows help files and other files such as e-books. Cybercriminals have been known to abuse vulnerabilities in CHM files to execute arbitrary code.


2 Answers

I think one of the following URL could work or point you to more "web hits" via google. But I think there are some restrictions sometimes like: maybe works only in IE, only if chm in trusted location, some url may only work on certain windows version, ....

mk:@MSITStore:C:\test.chm::/testpage.htm

ms-its:.\test.chm::/html/test.htm

Seems I wasn't specific enough. You should be able to use the above to launch hh.exe from within your application directly and passing this as URI as an argument.

Using System.Diagnostics.Process and launching hh.exe like this

hh.exe mk:@MSITStore:C:\test.chm::/test.htm

should do what you want.

Check HTMLHelp commandline for more examples

like image 168
jitter Avatar answered Sep 28 '22 05:09

jitter


Thanks Jeff I've found solution.

Below method doing that - maybe somebody finds it useful. Thanks for help!

public static void ShowHelpByKeyword(Control sourceControl, string helpFile, string parameter) {
   Help.ShowHelp(sourceControl, helpFile, HelpNavigator.KeywordIndex, parameter);
}
like image 22
Maciej Avatar answered Sep 28 '22 04:09

Maciej