7

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?

Maciej
  • 10,423
  • 17
  • 64
  • 97

3 Answers3

6

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

jitter
  • 53,475
  • 11
  • 111
  • 124
  • Can you please give me more info what I shall do wietk this synax? Open it via iExplore, run as new process from c# ?? I just wanted to open Microsoft HTML Help application with specified help item highlighted and it's content displayed – Maciej Jun 17 '09 at 12:46
  • I made my answer more specific – jitter Jun 17 '09 at 14:55
  • +1 because it really works. But I've found Jeff's post as best approach. Thanks – Maciej Jun 18 '09 at 15:47
4

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);
}
Maciej
  • 10,423
  • 17
  • 64
  • 97
3

You might want to look into the Help class. It's what I use to display help in Winforms applications.

Jeff Moser
  • 19,727
  • 6
  • 65
  • 85