question

JimWard-5713 avatar image
0 Votes"
JimWard-5713 asked Castorix31 commented

How can I view a specific chm help file topic in an edge browser (inside a WebView2 control)

I am converting a VB.Net Winforms application that targets .Net framework 4.8 using WebBrowser controls to use WebView2 controls

The Winforms application has a chm help file which is installed with the application and in the IE/WebBrowser world I can view a specific context sensitive help topic using the ms-its protocol

e.g. ms-its:C:/Program%20Files%20(x86)/Smart%20Communications%20Client%2026.0.0.1/SmartCommunications.chm::/BCSDocumentIntro.htm

This doesn't work with Edge/WebView2 and I get the message

Failed to launch 'ms-its:C:/Program%20Files%20(x86)/Smart%20Communications%20Client%2026.0.0.1/SmartCommunications.chm::/BCSDocumentIntro.htm' because the scheme does not have a registered handler.

How can I view a specific chm help file topic in an edge browser within a chm file (with navigation to previous, next and linked topics working)?

ms-edge
· 10
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I have tried using

file:///C:\Program%20Files%20(x86)\Smart%20Communications%20Client%2026.0.0.1\SmartCommunications.chm

This resulted in edge downloading the chm file (it's already on my hard drive) and I had to click on Open file to open the help file outside edge as if I had clicked on the chm directly
That's not what I need as I need to open the chm on a specific topic within the browser itself and not in another windows application.
The ms-its protocol lets you specify the topic following the chm file, if I try that using the file protocol it doesn't recognize the file name




0 Votes 0 ·

I know that if I de-compile the chm file I can use the file protocol to display the specific file but that's a poor solution as my setup program would need to be changed to install the de-compiled stuff as well as the chm file

The chm file is a compressed version of all the help files; it's not elegant to have to de-compile it, duplicating the information and tripling the amount of disk space used.

0 Votes 0 ·

Do you really need to use WebView2 to display it ?
Because they are other methods, like ShowHTMLDialogEx, from Mshtml.dll, which is used by Edge (for IE Mode), and supported to at least 2029, according to docs

0 Votes 0 ·

If that displays html then I still need to de-compile the chm file to use it. (it seems to me that it's a double whammy if I need to install help files and the chm file containing them)
Does it work with chm files too?
If so do you have an example?

0 Votes 0 ·

Yes, I tested with a MS help file from SDK (SHELLCC.CHM) and a random Topic
I quickly tested in C#, but I can convert it into VB if your code is in VB.NET

1 Vote 1 ·
Show more comments

0 Answers