1

I'm attempting to open an old chm (compiled HTML) file to a specified bookmark using C# - Don't ask why ;)

var psi = new ProcessStartInfo("hh.exe");
psi.Arguments = @"ms-its:X:/MyApplication/Help/MYHELPFILE.chm::MYHELPFILE.htm#36531"; // 36531 is my "topic path"
var cmdProcess = Process.Start(psi);

This opens the correct file, however it fails to open to the bookmarked location (36531).

When I call hh directly from the command line, it displays the correct file at the bookmarked location:

hh ms-its:X:/MyApplication/Help/MYHELPFILE.chm::MYHELPFILE.htm#36531

I am using the command line arguments as specified here.

Why are these two methods of passing args not equivalent? Why is my bookmark ignored when I call through Process.Start?

Blair
  • 3,671
  • 4
  • 29
  • 40

1 Answers1

1

The issue was related to opening the file over the network, which MS has blocked by default for security reasons.

The following fix works for opening files directly: https://www.helpscribble.com/chmnetwork.html

However, when opening through a child process, this does not work (loads the file, but no HTML content).

The solution: Copy all the .chm files to a local directory, e.g., C:/help/ and read from there.

Blair
  • 3,671
  • 4
  • 29
  • 40