Just today I ran into an issue of opening my compiled html help file for the PRESS project to a specific topic under program control. Long story short found some help from Stack Overflow and here. The secret found on the site we linked to in this post is the -mapid switch of the hh.exe found in SysWow64 folder under Windows folder.
Here's what my completed method for help looks like:
private void Help_Click(object sender, RoutedEventArgs e) { string path; path = System.IO.Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); var editedPath = path.Replace("file:\\",""); System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); // don't hide it unless you really don't want the user to see the help, but what would the point of that be? // startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; startInfo.FileName = @"c:\Windows\SysWow64\hh.exe"; // help topic 13 startInfo.Arguments = " -mapid 13 \"" + editedPath + @"\PRESS v3.1 Help.chm" + "\""; process.StartInfo = startInfo; process.Start(); }
Tagged --no tags--
0 Comments