easychm,制作chm非常好用的软件,可惜破解版不稳定。找了点资料,作此品。
XCHM,和大多数chm制作软件一样,调用微软发布的hhc.exe和hha.dll文件,编译hhp配置文件生成chm。
使用AutoIt语言制作,win平台上小巧好用的类vbs编程语言。
XCHM内嵌了hhc.exe和hha.dll文件,
默认隐藏“目录、索引、搜索、收藏”标签,
默认有“首页、打印、上一页”等常用工具栏按钮。
界面不太美观,交互也很简单,业务逻辑基本没有破绽,最大缺憾是太慢,使用的递归,扫描文件的同时向3个配置文件写入。xchm扫描的需要10分钟的目录,人家只要不到1分钟,汗...。有时间再优化吧。
关于3个文件的介绍,开始是百度文库中一篇5月2号上传的文档中了解到的,很详细。又对比easychm编译时生成的文件,作了点补充或改动:
hhp文件
半标准的ini文件。有3个标签option,windows,files.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
[options] #binary index=yes #binary toc=yes #citation=made by xchm compatibility=1.1 or later 版本 compiled file="xchm.chm" 手动。完成后chm文件的位置 contents file"xchm.hhc" 左侧目录选项卡,列表文件的文件名 #copyright=www.cuiweiyou.com #create chi file=yes default topic="index.html" 手动。目标chm文件的首页 default windows=xchm 目标文件窗体控制参数.windows小节 #display compile notes=yes #display compile progress=yes 是否显示编译进度 #enhanced decompilation=yes 支持增强反编译 #error log file=error.log 错误日志 flat=yes 编译文件不包括文件夹 full-text search=yes 是否支持全文检索信息 imagetype=folder 图标类型,默认为picture后面会有介绍 index file="xchm.hhk" 左侧索引选项卡,索引文件的位置 language=0x804 中文 title="XCHM" 手动。标题栏显示的标题 [windows] #只有一行值: xchm=,"xchm.hhc","xchm.hhk",,,,,,,0x73520,271,0x4306E,[80,80,825,589],, , , 1,,,0 1 2 3 45678 9 10 11 12 13 14 15 16 17181920212223 第1个参数,标题,这里为空时会读取option小节中的"title" 第2个参数,列表文件. 第3个参数,索引文件. 第4个参数,首页文件,即[option]小节中的default topic. 第5个参数,主页,如果此项为空时,点击工具栏上的"主页"会打开第四参数的值的地址,如果不为空是则打开此值地址. 第6个参数,自定义链接一地址 第7个参数,自定义链接一标题. 第8个参数,自定义链接二地址. 第9个参数,自定义链接二标题. chm文件中可以有两个自定义链接按钮,即由上面四个参数控制.如果此值为空,则不显示其按钮. 第10个参数,控制工具栏所显示的按钮,其值及意义如下: 书签=1000 高级搜索=20000 搜索=400 全无=20(去掉) 自动同步(当前标题改变时目录和索引自动同步)=100 自动显示隐藏导航面板=1 显示msdn菜单=10000(最上面出现一行菜单) 不显示工具栏=8000 不显示工具栏按钮文本=40 保存窗体位置=40000 第11个参数, 目标文件左侧列表栏初始化时的宽度. 第12个参数, 目标文件工具栏显示的按钮.其值及意义如下: 此项为空时,有"显示/隐藏",有后退,有打印,有选项 0x2=只有显示隐藏 0x4=后退 0x8=前进 10=停止 20=刷新 40=主页 0x800=只有定位 0x1000=选项 2000=打印 0x40000=自定义按钮及链接一 80000=自定义链接二 100000=字体 0x200000=下一步 0x400000=上一步 第13-16,在中括号里的四个参数是确定目标文件初始化时窗体的位置. 最后第四个参数,初始化时左侧列表的状态.此值为1时不显示左侧列表,为0时默认显示. 最后第三个参数,初始化时左侧列表的默认选项卡,此值为0时默认显示目录,为1时默认显示索引,为2时默认显示搜索,为3时默认显示书签. 最后第二个参数,初始化时左侧列表的选项卡位置,此值为0时默认显示在上边,为1时显示在左边,为2时显示在右边. [files] #全部页面文件 c:/fkchm/compile_date.htm c:/fkchm/scanner_camera_add.htm c:/fkchm/scanner_camera_deletepix.htm #此小节中是目标chm文件中所包含的文件列表. 这里一般只有htm或html文件,html文件所需要的一些支持文件如gif,css等文件,编译器会自动寻找并添加到目标chm文件中. |
hhc文件
左侧目录标签中的文件层级列表。是一个html文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<html> <body> <ul> <li> <object type="text/sitemap"> <param name="name" value="display_name"> <param name="local" value="a.html"> <param name="imagenumber" value="11"> </ojbect> </ul> </body> </html> |
<ul>代表父项,代表文件夹。
<li>代表子项,代表文件。
只要在 <li>后面加个 <ul>,再添加相应的子项,就可以把<li>的项变成父项.
我们主要要分析的是 <object>对象,它里面的<param>对象又才是主要描述了内容。
属性 值 代表的意思
name name value指定了显示在列表框中的名称
local value指定了该项对象的html文档
imagenumber value指定了该项使用何种图标, http://pic002.cnblogs.com/images/2011/68707/2011122115021157.jpg
hhk文件
左侧索引标签中的文件列表。一个html文件,内容只有两项
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<html> <body> <ul> <li> <object type="text/sitemap"> <param name="name" value="某某某文件1"> <param name="local" value="a1.html"> </ojbect> <li> <object type="text/sitemap"> <param name="name" value="某某某文件2"> <param name="local" value="a2.html"> </ojbect> <li> <object type="text/sitemap"> <param name="name" value="某某某文件3"> <param name="local" value="a3.html"> </ojbect> <li>... </ul> </body> </html> |
AutoIt可以使用ShellExecute内置函数调用exe程序,如此就能使用hhc.exe编译chm。
AutoIt这语言,你知道,喜欢被报毒。
[download id="1484"]
本作品使用的autoit版本是v3.3.12.0,欢迎一齐讨论研究,代码着色器不匹配au3,将就吧:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 |
;;;;;;;;;;;;;; 转载或使用代码,请保留本博信息,3q ;;;;;;;;;;;;;;;;;;;;;;;;;;;; #NoTrayIcon ;禁用托盘区图标 ;以下是程序配置 #Region #AutoIt3Wrapper_Icon=haiyan.ico ;图标 #AutoIt3Wrapper_outfile=C:\Users\Administrator\Desktop\X-CHM.exe ;编译后exe文件路径 #AutoIt3Wrapper_Compression=4 ;编译压缩级别 ;#AutoIt3Wrapper_UseUpx=y ;使用Upx方式编译 #AutoIt3Wrapper_UseX64=n ;支持64位系统 #AutoIt3Wrapper_Res_Comment=XCHM-made by vigiles ;说明(此项无效) #AutoIt3Wrapper_Res_Description=XCHM made by 威格灵博客-cuiweiyou.com ;描述/文件说明 #AutoIt3Wrapper_Res_Fileversion=8.8.8.8 ;文件版本 #AutoIt3Wrapper_Res_ProductVersion=9.9.9.9 ;程序版本 #AutoIt3Wrapper_Res_LegalCopyright=威格灵博客 cuiweiyou.com ;版权 #AutoIt3Wrapper_Res_Language=2052 ;中文 ;#AutoIt3Wrapper_Run_AU3Check=n ;语法检查 ;#Tidy_Parameters=/sfc/rel ;代码整理 ;#AutoIt3Wrapper_Tidy_Stop_OnError=n ;代码整理时发生错误将停止? ;#AutoIt3Wrapper_Run_Obfuscator=y ;编译时代码迷惑 ;#Obfuscator_Parameters=/striponly/cs/cn/cf/cv ;代码迷惑方式 #EndRegion #include <Array.au3> #include <EditConstants.au3> #include <File.au3> #include <FileConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> AutoItSetOption("GUIOnEventMode", 1) ; 集成用到的东西,运行后解压到我的文档 If Not FileExists(@MyDocumentsDir & "\haiyan.ico") Then FileInstall("haiyan.ico", @MyDocumentsDir & "\haiyan.ico") EndIf If Not FileExists(@MyDocumentsDir & "\hhc.exe") Then FileInstall("hhc.exe", @MyDocumentsDir & "\hhc.exe") EndIf If Not FileExists(@MyDocumentsDir & "\hha.dll") Then FileInstall("hha.dll", @MyDocumentsDir & "\hha.dll") EndIf Dim $lblAddHtml = "" ; 选择 html 文档的提示标签 Dim $hhpfilesarr[0] ; 选择的全部html文件名称,用于hhp文件 Dim $tmparr[0] ; 用于复位 $hhpfilesarr 的一维数组 Dim $countdir = 0 ; 统计全部的目录数量,用于提示 Dim $countfile = 0 ; 统计全部的文件数量,用于提示 Dim $root_dir = "" ; 选择html文档对话框得到的根路径 Dim $hhcfileopen = "" ; hhc文件的打开句柄,用于写文件 Dim $hhkfileopen = "" ; hhk文件的打开句柄 Dim $hhcfile = "" ; hhc文件目录 Dim $hhkfile = "" ; hhk文件目录 Dim $hhpfile = "" ; hhp文件目录 Dim $pid = -1000 ; 执行编译时 hhc.exe 程序的PID $guiMain = GUICreate("XCHM-vigiles制作的chm文档生成器", 400, 310, -1, -1, -1, $WS_EX_ACCEPTFILES) GUISetIcon(@MyDocumentsDir & "\haiyan.ico", Default, $guiMain) ; 软件图标 GUISetOnEvent($GUI_EVENT_CLOSE, "funcGUISetOnEvent") GUICtrlCreateGroup("资源", 5, 5, 390, 80) GUICtrlCreateButton("文档...", 20, 25, 55, 25) ; 选择按钮 GUICtrlSetOnEvent(-1, "funcSelectHtml") $inputpath = GUICtrlCreateInput ( "", 80, 26, 300, 23) ; html 文档路径 GUICtrlSetState(-1, $GUI_DROPACCEPTED) $lblAddHtml = GUICtrlCreateLabel("", 20, 60, 300, 23) ; 选择的 html 文件路径提示标签 GUICtrlCreateGroup("", -99, -99, -1, -1) GUICtrlCreateGroup("配置", 5, 95, 390, 145) GUICtrlCreateLabel("标 题:", 20, 120, 60, 23) $title = GUICtrlCreateInput ( "XCHM", 70, 115, 310, 23) ; chm标题 GUICtrlCreateButton("首页:", 20, 145, 45, 23) ; 选择chm首页 GUICtrlSetOnEvent(-1, "funcSelectIndex") $index = GUICtrlCreateInput ( "", 70, 145, 310, 23) GUICtrlCreateLabel("文件名:", 20, 180, 60, 23) $chm = GUICtrlCreateInput ( "xchm.chm", 70, 175, 310, 23) ; chm文件名 GUICtrlCreateButton("保存路径...", 20, 205, 80, 25) ; 选择保存目录 GUICtrlSetOnEvent(-1, "funcSavePath") $savepath = GUICtrlCreateInput ( "", 110, 205, 270, 23) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateGroup("", -99, -99, -1, -1) GUICtrlCreateLabel("威格灵博客", 7, 250, 80, 22) GUICtrlSetOnEvent(-1, "openLink") GUICtrlCreateLabel("版本:v1.0", 7, 270, 80, 22) $lblstatus = GUICtrlCreateLabel("", 7, 290, 230, 22) ; 显示编译提示 GUICtrlCreateButton("开始", 250, 250, 145, 55) ; 执行编译按钮 GUICtrlSetOnEvent(-1, "funcMakeChm") GUISetState(@SW_SHOW, $guiMain) While 1 Sleep(200) ; ; 执行编译开始,会调用hhc.exe程序,$pid保存其进程ID ; 如果有其进程,则在标签中打印提示 ; If ProcessExists ( $pid ) > 0 Then If StringLen(GUICtrlRead($lblstatus)) > 40 Then GUICtrlSetData($lblstatus, "." ) ; 如果太长了就从新开始 GUICtrlSetData($lblstatus, GUICtrlRead($lblstatus) & "." ) ; 不断增加 点 的数量 Else ; ; 编译结束,hhc.exe进程终止,此时不再打印提示 ; GUICtrlSetData($lblstatus, "" ) EndIf WEnd Func funcGUISetOnEvent () If FileExists($hhcfile) Then FileDelete($hhcfile) If FileExists($hhkfile) Then FileDelete($hhkfile) If FileExists($hhpfile) Then FileDelete($hhpfile) Exit EndFunc ; ; 选择 html 文档所在目录 ; Func funcSelectHtml () ; 打开选择文件夹对话框 $root_dir = FileSelectFolder ( "请选择html文档根目录", "" ) If $root_dir = "" Then Return GUICtrlSetData($lblAddHtml, "") GUICtrlSetData($inputpath, $root_dir) $hhcfile = @ScriptDir & "\xchm.hhc" $hhkfile = @ScriptDir & "\xchm.hhk" $hhpfile = @ScriptDir & "\xchm.hhp" If FileExists ( $hhcfile ) Then FileDelete($hhcfile) EndIf If FileExists ( $hhkfile ) Then FileDelete($hhkfile) EndIf If FileExists ( $hhpfile ) Then FileDelete($hhpfile) EndIf FileWrite ( $hhcfile, "" ) $hhcfileopen = FileOpen($hhcfile, $FO_APPEND) FileWrite ( $hhkfile, "" ) $hhkfileopen = FileOpen($hhkfile, $FO_APPEND) FileWriteLine($hhcfileopen, "<HTML>" & @CRLF) FileWriteLine($hhcfileopen, "<BODY>" & @CRLF) FileWriteLine($hhcfileopen, "<UL>" & @CRLF) FileWriteLine($hhkfileopen, "<HTML>" & @CRLF) FileWriteLine($hhkfileopen, "<BODY>" & @CRLF) FileWriteLine($hhkfileopen, "<UL>" & @CRLF) $root_dir = $root_dir & "\" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 以上 创建hhc hhk hhp文件 funcListFiless($root_dir);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 遍历所选html文件路径 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 以下 遍历结束后 完成 hhc hhk hhp 文件的写入 FileWriteLine($hhcfileopen, "</UL>" & @CRLF) FileWriteLine($hhcfileopen, "</BODY>" & @CRLF) FileWriteLine($hhcfileopen, "</HTML>" & @CRLF) FileWriteLine($hhkfileopen, "</UL>" & @CRLF) FileWriteLine($hhkfileopen, "</BODY>" & @CRLF) FileWriteLine($hhkfileopen, "</HTML>" & @CRLF) FileClose($hhcfileopen) FileClose($hhkfileopen) ;IniDelete ( $hhpfile, "OPTIONS", "opt") ;IniWrite($hhpfile, "OPTIONS", "Binary Index", "Yes" ) ;IniWrite($hhpfile, "OPTIONS", "Binary TOC", "Yes" ) IniWrite($hhpfile, "OPTIONS", "CITATION", "cuiweiyou.com" ) IniWrite($hhpfile, "OPTIONS", "Compatibility", "1.1 or later" ) IniWrite($hhpfile, "OPTIONS", "COPYRIGHT", "www.cuiweiyou.com" ) ;IniWrite($hhpfile, "OPTIONS", "Create CHI file", "Yes" ) IniWrite($hhpfile, "OPTIONS", "Default Window", "xchm" ) IniWrite($hhpfile, "OPTIONS", "Display compile notes", "Yes" ) IniWrite($hhpfile, "OPTIONS", "Display compile progress", "Yes" ) IniWrite($hhpfile, "OPTIONS", "Enhanced decompilation", "Yes" ) ;IniWrite($hhpfile, "OPTIONS", "Error log file", "_ecErrorLog.Log" ) IniWrite($hhpfile, "OPTIONS", "Flat", "Yes" ) IniWrite($hhpfile, "OPTIONS", "Full-text search", "Yes" ) IniWrite($hhpfile, "OPTIONS", "Index file", "xchm.hhk" ) IniWrite($hhpfile, "OPTIONS", "Compiled file", "" ) ;保存路径 IniWrite($hhpfile, "OPTIONS", "Default topic", "" ) ;首页 IniWrite($hhpfile, "OPTIONS", "Title", "" ) ;标题 ;IniDelete ( $hhpfile, "WINDOWS", "win") IniWrite($hhpfile, 'WINDOWS', 'xchm', ',"xchm.hhc","xchm.hhk",,,,,,,0x73520,271,0x4306E,[80,80,825,589],,,,1,,,0') IniWrite ( $hhpfile, "FILES", "", "" ) _FileWriteToLine ( $hhpfile, _FileCountLines ( $hhpfile ), "", 1) ;删除最后只有等号的一行 $thhpfile = FileOpen ($hhpfile, $FO_APPEND ) _FileWriteFromArray ( $thhpfile, $hhpfilesarr) ; 追加写入 FileClose($thhpfile) $hhpfilesarr = $tmparr $countdir = 0 $countfile = 0 EndFunc ; ; 遍历 html 文件目录 ; Func funcListFiless($path) ; 文件夹内的建搜索句柄 $hSearch = FileFindFirstFile($path & "*.*") ;html,htm,mht If $hSearch = -1 Then ;搜索结束 FileWriteLine($hhcfileopen, '</UL>' & @CRLF) Return False EndIf ; 开始遍历当前文件夹 While 1 $file = FileFindNextFile($hSearch) ; 找到一个文件/文件夹 If @error Then ; 遍历结束 FileWriteLine($hhcfileopen, '</UL>' & @CRLF) ExitLoop EndIf ; 判断是文件还是文件夹 $fileattrib = FileGetAttrib($path & $file) ; ;如果是目录 ; if $fileattrib = "D" Then $countdir = $countdir + 1 GUICtrlSetData($lblAddHtml, "目录+" & $countdir & @TAB & "文件+" & $countfile) FileWriteLine($hhcfileopen, ' <LI> <OBJECT type="text/sitemap">' & @CRLF) FileWriteLine($hhcfileopen, ' <param name="Name" value="' & $file & '">' & @CRLF) FileWriteLine($hhcfileopen, ' <param name="Local" value="">' & @CRLF) FileWriteLine($hhcfileopen, ' <param name="ImageNumber" value="1">' & @CRLF) FileWriteLine($hhcfileopen, ' </OBJECT>' & @CRLF) FileWriteLine($hhcfileopen, ' <UL>' & @CRLF) funcListFiless($path & $file & "\") Else ; ; 如果是文件 ; ; 判断是否是有效的文件 If StringInStr(StringRight($file, 5), "html") = 0 Then If StringInStr(StringRight($file, 5), "mht") = 0 Then If StringInStr(StringRight($file, 5), "htm") = 0 Then Return EndIf EndIf EndIf $countfile = $countfile + 1 GUICtrlSetData($lblAddHtml, "目录+" & $countdir & @TAB & "文件+" & $countfile) $hfo = FileOpen($path & $file, $FO_READ) $sfr = FileRead($hfo, 500) FileClose($hfo) $idtitle1 = StringInStr ( $sfr, "<title>") If $idtitle1 = 0 Then Return $idtitle2 = StringInStr ( $sfr, "</title>") If $idtitle2 = 0 Then Return $aMatch = StringMid ( $sfr, $idtitle1+7, $idtitle2-$idtitle1-7 ) $fffname = StringReplace($path & $file, $root_dir, "") FileWriteLine($hhcfileopen, ' <LI> <OBJECT type="text/sitemap">' & @CRLF) FileWriteLine($hhcfileopen, ' <param name="Name" value="' & $aMatch & '">' & @CRLF) FileWriteLine($hhcfileopen, ' <param name="Local" value="' & $fffname & '">' & @CRLF) FileWriteLine($hhcfileopen, ' </OBJECT>' & @CRLF) FileWriteLine($hhkfileopen, ' <LI> <OBJECT type="text/sitemap">' & @CRLF) FileWriteLine($hhkfileopen, ' <param name="Name" value="' & $aMatch & '">' & @CRLF) FileWriteLine($hhkfileopen, ' <param name="Local" value="' & $fffname & '">' & @CRLF) FileWriteLine($hhkfileopen, ' </OBJECT>' & @CRLF) _ArrayAdd($hhpfilesarr, $path & $file) $aMatch="" EndIf Sleep(100) WEnd FileClose($hSearch) EndFunc ; 选择chm保存位置 Func funcSavePath() $save_dir = FileSelectFolder ( "请选择chm文件的保存目录", "" ) If $save_dir <> "" Then GUICtrlSetData($savepath, $save_dir) EndFunc ; 选择首页文件 Func funcSelectIndex() $indexfile = FileOpenDialog( "请选择首页文件", $root_dir, "网页文件(*.*)" ) If @error <> 0 Then Return GUICtrlSetData($index, $indexfile) EndFunc ; ; 开始编译 ; Func funcMakeChm() ; ; 判断是否配置完成 ; If StringLen(GUICtrlRead($inputpath)) < 1 Then ; html路径 MsgBox(0, "提示", "请选择创建chm所需的资源文件路径") return EndIf If StringLen(GUICtrlRead($title)) < 1 Then ; 标题 MsgBox(0, "提示", "请设置chm标题") return EndIf If StringLen(GUICtrlRead($index)) < 1 Then ;首页 MsgBox(0, "提示", "请设置chm文件首页") return EndIf If StringLen(GUICtrlRead($chm)) < 1 Then ; chm文件名 MsgBox(0, "提示", "请设置目标chm文件名") return EndIf If StringLen(GUICtrlRead($savepath)) < 1 Then ; 生成路径 MsgBox(0, "提示", "请设置chm文件保存路径") return EndIf ;判断3个文件是否准备好 If Not FileExists($hhcfile) Then MsgBox(0, "提示", "hhc文件丢失,请重新选择html文档目录") Return EndIf If Not FileExists($hhkfile) Then MsgBox(0, "提示", "hhk文件丢失,请重新选择html文档目录") Return EndIf If Not FileExists($hhpfile) Then MsgBox(0, "提示", "hhp文件丢失,请重新选择html文档目录") Return EndIf ; ;完成配置 ; IniWrite($hhpfile, "OPTIONS", "Compiled file", GUICtrlRead($savepath)&"\"&GUICtrlRead($chm) ) ;保存路径 IniWrite($hhpfile, "OPTIONS", "Default topic", StringReplace(GUICtrlRead($index), $root_dir, "")) ;首页 IniWrite($hhpfile, "OPTIONS", "Title", GUICtrlRead($title) ) ;标题 IniWrite($hhpfile, 'WINDOWS', 'xchm', ',"xchm.hhc","xchm.hhk",'&StringReplace(GUICtrlRead($index), $root_dir, "")&','&StringReplace(GUICtrlRead($index), $root_dir, "")&',"http://www.gaohaiyan.com","威格灵",,,0x73520,271,0x4306E,[80,80,825,589],,,,1,,,0') ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 调用 hhc.exe 程序,编译chm文件,隐藏,后台运行 ; hhc.exe 开始运行,即产生一个进程ID $pid = ShellExecute ( @MyDocumentsDir & "\hhc.exe", @ScriptDir & "\xchm.hhp", "", Default, @SW_HIDE) EndFunc Func openLink() ShellExecute("http://www.gaohaiyan.com") EndFunc |
本文由崔维友 威格灵 cuiweiyou vigiles cuiweiyou 原创,转载请注明出处:http://www.gaohaiyan.com/1481.html
承接App定制、企业web站点、办公系统软件 设计开发,外包项目,毕设