手動建立簡單CHM幫助檔案

2021-07-25 17:22:09 字數 3093 閱讀 5139

chm是英語「compiled help manual」的簡寫,即「已編譯的幫助檔案」。這是乙個html格式的幫助文件,原始檔就是html檔案以及jpg、gif等等html所支援的元素。網上有許多的資料介紹如何建立chm幫助檔案,更多的只是推薦使用工具來建立,如微軟官方的mircosoft html help workshop 、強大的esay chm等等。我們卻不知道chm真正的面目是什麼,在收集了網上的一些資料後,也自己在此記錄下一些資訊以了解chm的建立過程。

手動建立簡單chm幫助檔案步驟:

1.首先新建個資料夾專門放html檔案,新建乙個html檔案,命名可以取之為"index.html",在這裡我簡單寫個html檔案來測試:

<

html

>

<

head

>

<

title

>無幻部落格

title

>

head

>

<

body

>

<

h1>歡迎光臨[無幻部落格]

h1>

<

h2>

h2>

body

>

html

>

[options]

compatibility=1.1 or later 

compiled file=mychm.chm 

display compile progress=no 

language=0x804 中文(中國) 

[files]

index.html 

4.在此資料夾下就生成了乙個"mychm.chm"檔案,開啟之後如下圖所示:

doctype

html

public

"-//ietf//dtd html//en"

>

<

html

>

<

head

>

<

meta

name="generator"

content="microsoft® html help workshop 4.1"

>

head

>

<

body

>

<

object

type="text/site properties"

>

<

param

name="imagetype"

value="folder"

>

object

>

<

ul>

<

li>

<

object

type="text/sitemap"

>

<

param

name="name"

value="無幻部落格"

>

<

param

name="local"

value="index.html"

>

object

>

ul>

body

>

html

>

將此檔案另存為mychm.hhc;

2.修改"mychm.hhp"檔案為:

[options]

compatibility=1.1 or later 

compiled file=mychm.chm 

contents file=mychm.hhc 

display compile progress=no 

language=0x804 中文(中國) 

[files]

index.html 

3.跟上面一樣,用"hhc.exe"編譯成chm檔案,開啟之後如下圖所示:

doctype

html

public

"-//ietf//dtd html//en"

>

<

html

>

<

head

>

<

meta

name="generator"

content="microsoft® html help workshop 4.1"

>

head

>

<

body

>

<

ul>

<

li>

<

object

type="text/sitemap"

>

<

param

name="name"

value="無幻部落格"

>

<

param

name="local"

value="index.html"

>

object

>

ul>

body

>

html

>

將此檔案另存為mychm.hhk;

2.修改"mychm.hhp"檔案為:

[options]

compatibility=1.1 or later 

compiled file=mychm.chm 

default window=chmmain 

display compile progress=no 

language=0x804 中文(中國) 

[windows]

chmmain="無幻部落格","mychm.hhc","mychm.hhk","index.html",,,,,,0x2020,,0x3006,,,,,,,,0

[files]

index.html 

3.跟上面一樣,用"hhc.exe"編譯成chm檔案,開啟之後如下圖所示:

參考資料:

1.hhp格式解析 

2.chm格式電子書製作詳解 

3.用微軟的ms html help workshop工具來製作chm格式電子書 

CHM幫助檔案

在visual c 6中呼叫html help沒有現成的函式,需要呼叫htmlhelp 這個api函式。而在呼叫這個函式之前,還需要在你的工程中加上htmlhelp的庫和標頭檔案 1.指定htmlhelp.h的路徑。選擇選單 project settings.開啟 project settings ...

CHM幫助檔案製作流程

1.熟悉目標系統 熟悉需要製作幫助檔案的系統功能,收集相關的背景資料 2.製作幫助檔案內容大綱 幫助檔案內容大綱常常表現為.hhc目錄檔案 3.編寫幫助檔案內容 例如可以使用ms word 2000編寫doc幫助檔案,再匯出為html檔案。技巧1 為文字建立html超級鏈結 選中文字 選擇 插入 超...

VB程式中呼叫CHM幫助檔案

visual basic程式中呼叫chm幫助檔案的方法。方法三 使用shell函式 private sub cmdhelp click shell hh.exe help.chm vbnormalfocus help.chm為指定的幫助檔案,可包含路徑。end sub 方法四 使用htmlhelp函...