Next Post >>
<< Previous Post



Posted by Michael Horvath under Technology  PRESS News  on Sep 07 2021

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--
share the love!



comments

there are no comments for this post. be the first to post one!


post your comment

name (*) - required
email address (*) - required
site address
your comment (*) - required

(*) - required


Next Post >>
<< Previous Post