HTMLHelp-FAQ-100001 - Help Information

Direkt zum Seiteninhalt

HTMLHelp-FAQ-100001

Wissensbasis > HTMLHelp
Titel

It's a Visual Basic sample only but I think C# is near by. I assume that you use sandcastle Help File Builder (SHFB).

If the images are not being used in MAML topics, just set the BuildAction in the SHFB project to Content and place them in an images folder. They'll get copied into the working folder automatically and compiled into the CHM help file.

Steps to import the [images]-folder into SHFB Project Explorer, not referenced by MAML topics:

  1. Select Add and Existing Folder... from tree context menu, select the [images]-Folder
  2. For each image-file, set BuildAction from Image to Content
  3. In SHFB, push the Build the help file button

After the build, you have a CHM help file with images.

I attached some snaps of the Visual Basic project, SHFB und the resulting CHM.

Blockquote sample

Code:


				def add(num1, num 2):
				   return num 1 + num 2
				
				Module Module1
				  Private Declare Function HTMLHelp_BaseCall _
				          Lib "hhctrl.ocx" Alias "HtmlHelpA" _
				          (ByVal hWnd As IntPtr, _
				          ByVal lpHelpFile As String, _
				          ByVal wCommand As Int32, _
				          ByVal dwData As Int32) As Int32
				
				  Public Sub OpenHelpToTopic(ByVal topicName$)
				    Dim currDir = Application.StartupPath
				    If InStr(currDir, "Debug") > 0 Then currDir = "D:\_temp\"
				    Dim pathName = currDir & "CHM-example.chm"
				    Dim RetVal As Long = HTMLHelp_BaseCall(0, pathName & "::" & topicName, &H0, 0)
				  End Sub
				End Module
				

enter image description here

enter image description here

enter image description here

Beschreibungstext
Zurück zum Seiteninhalt