M mt Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-09 #1 我在不少帮助文件制作软件中均带有[hha.dll , itcc.dll , hhc.exe]<br>想向大家求教如何利用以上文件制作帮助软件,最好有详细的api函数调用<br>方法或列表?
Y yangxiao_jiang Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-09 #4 我有html help workshop的软件和使用手册,可以编译成htm的格式<br>其他的我也有使用手册<br>给我个地址,我传上去<br>yangxiao_jiang@download-city.com
我有html help workshop的软件和使用手册,可以编译成htm的格式<br>其他的我也有使用手册<br>给我个地址,我传上去<br>yangxiao_jiang@download-city.com
Z zjfeng Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-11 #7 帮助制作只用hha.dll和hhc.exe就可以,用命令行hhc hhp文件 就可以了
W watter Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-13 #9 我原来做过一个将从网上收集的html文件合成为一个chm文件的程序,自己用了一下,感觉还可以<br>你可以试一下。部分代码如下:<br>procedure TMainForm.CreateListFile; //建立目录文件<br>var<br> I:integer;<br>Begin<br>ListFile:=CurrentDir + 'ListFile.html';<br>AssignFile(FList, ListFile);<br>Rewrite(FList);<br>Writeln(FList, '<html>');<br>Writeln(FList, '<head>');<br>Writeln(FList, '<title>目录</title>');<br>Writeln(FList, '<meta http-equiv="Content-Type" content="text/html; charset=gb2312">');<br>Writeln(FList, '</head>');<br>Writeln(FList, '');<br>Writeln(FList, '<body bgcolor="#FFFFFF">');<br>Writeln(FList, '<h1 align="center"><font face="Verdana, Arial, Helvetica, sans-serif"><b>目录</b></font></h1>');<br>Writeln(FList, '<hr width="100%" color="red" noshade>');<br>Writeln(FList, '');<br>for I:=0 to FileList.Items.Count-1 do<br>Writeln(FList, '<p><a href="file:///' + FileList.Items.Strings+'">'+ FindTitle(FileList.Items.Strings)+'</a> </p>');<br>Writeln(FList, '');<br>Writeln(FList, '<hr width="100%" color="blue" noshade>');<br>Writeln(FList, '</body>');<br>Writeln(FList, '</html>');<br>CloseFile(FList);<br>end;<br><br>procedure TMainForm.CreateVersionFile; //建立版权文件<br>begin<br>VersionFile:=CurrentDir + 'VerSionFile.html';<br>AssignFile(FVerSion, VersionFile);<br>Rewrite(FVerSion);<br>Writeln(FVerSion, '<html>');<br>Writeln(FVerSion, '<head>');<br>Writeln(FVerSion, '<title>版权页面</title>');<br>Writeln(FVerSion, '<meta http-equiv="Content-Type" content="text/html; charset=gb2312">');<br>Writeln(FVerSion, '</head>');<br>Writeln(FVerSion, '');<br>Writeln(FVerSion, '<body bgcolor="#000000" text="#FFFF99">');<br>Writeln(FVerSion, '<h1 align="center">CHM文件制作系统 </h1>');<br>Writeln(FVerSion, '<hr>');<br>Writeln(FVerSion, '<p>作者:汪涛</p>');<br>Writeln(FVerSion, '<p>E-mail: <a href="mailto:waterman@sina.com">waterman@sina.com</a></p>');<br>Writeln(FVerSion, '</body>');<br>Writeln(FVerSion, '</html>');<br>CloseFile(FVerSion);<br>end;<br><br>procedure TMainForm.Createhhp; //产生项目文件<br>var<br> I:integer;<br>begin<br>AssignFile(Fproject, hhpFile);<br>Rewrite(Fproject);<br>writeln(Fproject, '[OPTIONS]');<br>writeln(Fproject, 'Compatibility=1.1');<br>writeln(Fproject, 'Compiled file=' + ChmFile);<br>writeln(Fproject, 'Contents file=' + hhcFile);<br>writeln(Fproject, 'Default Window=' + WindowName);<br>writeln(Fproject, 'Default topic='+ ListFile);<br>writeln(Fproject, 'Display compile progress=no');<br>writeln(Fproject, 'Full-text search=Yes');<br>writeln(Fproject, 'Language=0x804 中文(中国)');<br>writeln(Fproject, '');<br>writeln(Fproject, '');<br>writeln(Fproject, '[WINDOWS]');<br>writeln(Fproject, WindowName + '="'+ WindowTitle +'","' + hhcFile + '",,,,,,,,0x2520,,0x307e,,,,,,,,');<br>writeln(Fproject, '');<br>writeln(Fproject, '');<br>writeln(Fproject, '[FILES]');<br> For I:=0 to FileList.Items.Count-1 do<br>writeln(Fproject, FileList.Items.Strings);<br>writeln(Fproject, ListFile);<br>writeln(Fproject, VersionFile);<br>closefile(Fproject);<br>end;<br><br><br>procedure TMainForm.Createhhc; //产生目录文件<br>var I:integer;<br>begin<br>AssignFile(Fcontent, hhcFile);<br>Rewrite(Fcontent);<br>writeln(Fcontent, '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">');<br>writeln(Fcontent, '<HTML>');<br>writeln(Fcontent, '<HEAD>');<br>writeln(Fcontent, '<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">');<br>writeln(Fcontent, '<!-- Sitemap 1.0 -->');<br>writeln(Fcontent, '</HEAD><BODY>');<br>writeln(Fcontent, '<OBJECT type="text/site properties">');<br>writeln(Fcontent, ' <param name="Window Styles" value="0x1222">');<br>writeln(Fcontent, ' <param name="ImageType" value="Folder">');<br>writeln(Fcontent, '</OBJECT>');<br>writeln(Fcontent, '<UL>');<br>writeln(Fcontent, ' <LI> <OBJECT type="text/sitemap">');<br>writeln(Fcontent, ' <param name="Name" value="目录">');<br>writeln(Fcontent, ' <param name="Local" value="'+listFile+'">');<br>writeln(Fcontent, ' <param name="ImageNumber" value="1">');<br>writeln(Fcontent, ' </OBJECT>');<br>writeln(Fcontent, ' <UL>');<br><br>for I:=0 to FileList.Items.count-1 do<br>begin<br>writeln(Fcontent, ' <LI> <OBJECT type="text/sitemap">');<br>writeln(Fcontent, ' <param name="Name" value="'+ FindTitle(FileList.Items.Strings) + '">');<br>writeln(Fcontent, ' <param name="Local" value="'+ ExtractFileName(FileList.Items.Strings) + '">');<br>writeln(Fcontent, ' </OBJECT>');<br>end;<br><br>writeln(Fcontent, ' <LI> <OBJECT type="text/sitemap">');<br>writeln(Fcontent, ' <param name="Name" value="Author">');<br>writeln(Fcontent, ' <param name="Local" value="'+ VersionFile + '">');<br>writeln(Fcontent, ' </OBJECT>');<br>writeln(Fcontent, ' </UL>');<br>writeln(Fcontent, '</UL>');<br>writeln(Fcontent, '</BODY></HTML>');<br>closeFile(Fcontent);<br>end;<br><br><br>procedure TMainForm.BtnCompileClick(Sender: TObject); //编译文件<br>var<br> StartupInfo:TStartupInfo;<br> ProcessInfo:TProcessInformation;<br>begin<br><br>if FileList.Items.count=0 then begin<br> Showmessage('请添加要编译的文件');<br> exit;<br> end;<br><br>if TextFileName.text<>'' then chmFile:=TextFileName.Text<br> else begin<br> Showmessage('请输入您希望编译后生成的文件名');<br> exit;<br> end;<br><br>if TextWindowTitle.Text<>'' then begin<br> WindowTitle:=TextWindowTitle.Text;<br> WindowName:=TextWindowTitle.Text;<br> end<br> else begin<br> Showmessage('请输入窗口标题');<br> exit;<br> end;<br><br>hhpFile:=ChangeFileExt(chmFile, '.hhp');<br>hhcFile:=ChangeFileExt(chmFile, '.hhc');<br><br>TempHhpFile:=TempDir + ExtractFileName(hhpFile);<br>TempChmFile:=TempDir + ExtractFileName(chmFile);<br><br>BtnCompile.Enabled:=false;<br>BtnClose.Enabled:=false;<br><br>ImageActive.Visible:=True;<br>Label4.Visible:=True;<br>Label4.Caption:='正在编译…';<br><br>CreateListFile; //建立目录页面<br>CreateVersionFile; //建立版权页面<br>Createhhp; //建立项目文件<br>Createhhc; //建立目录文件<br><br>MkDir(TempDir); //在C根目录下建立新的临时子目录<br>RenameFile(hhpfile, TempHhpFile); //建立临时项目文件<br><br>ShellExec('open','hhc.exe',Pchar(temphhpfile),Pchar(currentdir),0,true);<br><br>if FileExists(hhpFile) then DeleteFile(hhpFile);<br>RenameFile(TempHhpFile, hhpFile); //恢复项目文件<br>RmDir(TempDir); //删除临时目录<br><br>if KeepTempFile.Checked=False<br>then begin if FileExists(hhpFile) then DeleteFile(hhpFile);<br> if FileExists(hhcFile) then DeleteFile(hhcFile);<br> if FileExists(ListFile) then DeleteFile(ListFile);<br> if FileExists(VersionFile) then DeleteFile(VersionFile);<br> end;<br> //删除临时文件:项目文件、目录文件、目录文件、版权文件<br><br>ImageActive.Visible:=False;<br>Label4.Caption:='编译完成';<br><br>if Display.Checked=True then<br> ShellExecute(handle, nil, Pchar(chmFile), nil, nil, 1);<br> //显示最终文件<br>BtnCompile.Enabled:=true;<br>BtnClose.Enabled:=True;<br>end;<br><br><br>function tMainForm.WinExecAndWait32(FileName:String; Visibility :integer)word;<br> {执行一个外部程序并等待其结束}<br>var<br>zAppName:array[0..512] of char;<br>zCurDir:array[0..255] of char;<br>WorkDir:String;<br>StartupInfo:TStartupInfo;<br>ProcessInfo:TProcessInformation;<br><br>begin<br>StrPCopy(zAppName,FileName);<br>GetDir(0,WorkDir);<br>StrPCopy(zCurDir,WorkDir);<br>FillChar(StartupInfo,Sizeof(StartupInfo),#0);<br>StartupInfo.cb := Sizeof(StartupInfo);<br>StartupInfo.dwFlags := STARTF_USESHOWWINDOW;<br>StartupInfo.wShowWindow := Visibility;<br>if not CreateProcess(nil,<br> zAppName, { pointer to command line string }<br> nil, { pointer to process security attributes }<br> nil, { pointer to thread security attributes }<br> false, { handle inheritance flag }<br> CREATE_NEW_CONSOLE or { creation flags } NORMAL_PRIORITY_CLASS,<br> nil, { pointer to new environment block }<br> nil, { pointer to current directory name }<br> StartupInfo, { pointer to STARTUPINFO }<br> ProcessInfo)<br>then Result := 1 { pointer to PROCESS_INF }<br>else begin<br> while WaitforSingleObject(ProcessInfo.hProcess,10)=WAIT_TIMEOUT<br> do Application.ProcessMessages;<br> GetExitCodeProcess(ProcessInfo.hProcess,Result);<br> end;<br>end;
我原来做过一个将从网上收集的html文件合成为一个chm文件的程序,自己用了一下,感觉还可以<br>你可以试一下。部分代码如下:<br>procedure TMainForm.CreateListFile; //建立目录文件<br>var<br> I:integer;<br>Begin<br>ListFile:=CurrentDir + 'ListFile.html';<br>AssignFile(FList, ListFile);<br>Rewrite(FList);<br>Writeln(FList, '<html>');<br>Writeln(FList, '<head>');<br>Writeln(FList, '<title>目录</title>');<br>Writeln(FList, '<meta http-equiv="Content-Type" content="text/html; charset=gb2312">');<br>Writeln(FList, '</head>');<br>Writeln(FList, '');<br>Writeln(FList, '<body bgcolor="#FFFFFF">');<br>Writeln(FList, '<h1 align="center"><font face="Verdana, Arial, Helvetica, sans-serif"><b>目录</b></font></h1>');<br>Writeln(FList, '<hr width="100%" color="red" noshade>');<br>Writeln(FList, '');<br>for I:=0 to FileList.Items.Count-1 do<br>Writeln(FList, '<p><a href="file:///' + FileList.Items.Strings+'">'+ FindTitle(FileList.Items.Strings)+'</a> </p>');<br>Writeln(FList, '');<br>Writeln(FList, '<hr width="100%" color="blue" noshade>');<br>Writeln(FList, '</body>');<br>Writeln(FList, '</html>');<br>CloseFile(FList);<br>end;<br><br>procedure TMainForm.CreateVersionFile; //建立版权文件<br>begin<br>VersionFile:=CurrentDir + 'VerSionFile.html';<br>AssignFile(FVerSion, VersionFile);<br>Rewrite(FVerSion);<br>Writeln(FVerSion, '<html>');<br>Writeln(FVerSion, '<head>');<br>Writeln(FVerSion, '<title>版权页面</title>');<br>Writeln(FVerSion, '<meta http-equiv="Content-Type" content="text/html; charset=gb2312">');<br>Writeln(FVerSion, '</head>');<br>Writeln(FVerSion, '');<br>Writeln(FVerSion, '<body bgcolor="#000000" text="#FFFF99">');<br>Writeln(FVerSion, '<h1 align="center">CHM文件制作系统 </h1>');<br>Writeln(FVerSion, '<hr>');<br>Writeln(FVerSion, '<p>作者:汪涛</p>');<br>Writeln(FVerSion, '<p>E-mail: <a href="mailto:waterman@sina.com">waterman@sina.com</a></p>');<br>Writeln(FVerSion, '</body>');<br>Writeln(FVerSion, '</html>');<br>CloseFile(FVerSion);<br>end;<br><br>procedure TMainForm.Createhhp; //产生项目文件<br>var<br> I:integer;<br>begin<br>AssignFile(Fproject, hhpFile);<br>Rewrite(Fproject);<br>writeln(Fproject, '[OPTIONS]');<br>writeln(Fproject, 'Compatibility=1.1');<br>writeln(Fproject, 'Compiled file=' + ChmFile);<br>writeln(Fproject, 'Contents file=' + hhcFile);<br>writeln(Fproject, 'Default Window=' + WindowName);<br>writeln(Fproject, 'Default topic='+ ListFile);<br>writeln(Fproject, 'Display compile progress=no');<br>writeln(Fproject, 'Full-text search=Yes');<br>writeln(Fproject, 'Language=0x804 中文(中国)');<br>writeln(Fproject, '');<br>writeln(Fproject, '');<br>writeln(Fproject, '[WINDOWS]');<br>writeln(Fproject, WindowName + '="'+ WindowTitle +'","' + hhcFile + '",,,,,,,,0x2520,,0x307e,,,,,,,,');<br>writeln(Fproject, '');<br>writeln(Fproject, '');<br>writeln(Fproject, '[FILES]');<br> For I:=0 to FileList.Items.Count-1 do<br>writeln(Fproject, FileList.Items.Strings);<br>writeln(Fproject, ListFile);<br>writeln(Fproject, VersionFile);<br>closefile(Fproject);<br>end;<br><br><br>procedure TMainForm.Createhhc; //产生目录文件<br>var I:integer;<br>begin<br>AssignFile(Fcontent, hhcFile);<br>Rewrite(Fcontent);<br>writeln(Fcontent, '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">');<br>writeln(Fcontent, '<HTML>');<br>writeln(Fcontent, '<HEAD>');<br>writeln(Fcontent, '<meta name="GENERATOR" content="Microsoft&reg; HTML Help Workshop 4.1">');<br>writeln(Fcontent, '<!-- Sitemap 1.0 -->');<br>writeln(Fcontent, '</HEAD><BODY>');<br>writeln(Fcontent, '<OBJECT type="text/site properties">');<br>writeln(Fcontent, ' <param name="Window Styles" value="0x1222">');<br>writeln(Fcontent, ' <param name="ImageType" value="Folder">');<br>writeln(Fcontent, '</OBJECT>');<br>writeln(Fcontent, '<UL>');<br>writeln(Fcontent, ' <LI> <OBJECT type="text/sitemap">');<br>writeln(Fcontent, ' <param name="Name" value="目录">');<br>writeln(Fcontent, ' <param name="Local" value="'+listFile+'">');<br>writeln(Fcontent, ' <param name="ImageNumber" value="1">');<br>writeln(Fcontent, ' </OBJECT>');<br>writeln(Fcontent, ' <UL>');<br><br>for I:=0 to FileList.Items.count-1 do<br>begin<br>writeln(Fcontent, ' <LI> <OBJECT type="text/sitemap">');<br>writeln(Fcontent, ' <param name="Name" value="'+ FindTitle(FileList.Items.Strings) + '">');<br>writeln(Fcontent, ' <param name="Local" value="'+ ExtractFileName(FileList.Items.Strings) + '">');<br>writeln(Fcontent, ' </OBJECT>');<br>end;<br><br>writeln(Fcontent, ' <LI> <OBJECT type="text/sitemap">');<br>writeln(Fcontent, ' <param name="Name" value="Author">');<br>writeln(Fcontent, ' <param name="Local" value="'+ VersionFile + '">');<br>writeln(Fcontent, ' </OBJECT>');<br>writeln(Fcontent, ' </UL>');<br>writeln(Fcontent, '</UL>');<br>writeln(Fcontent, '</BODY></HTML>');<br>closeFile(Fcontent);<br>end;<br><br><br>procedure TMainForm.BtnCompileClick(Sender: TObject); //编译文件<br>var<br> StartupInfo:TStartupInfo;<br> ProcessInfo:TProcessInformation;<br>begin<br><br>if FileList.Items.count=0 then begin<br> Showmessage('请添加要编译的文件');<br> exit;<br> end;<br><br>if TextFileName.text<>'' then chmFile:=TextFileName.Text<br> else begin<br> Showmessage('请输入您希望编译后生成的文件名');<br> exit;<br> end;<br><br>if TextWindowTitle.Text<>'' then begin<br> WindowTitle:=TextWindowTitle.Text;<br> WindowName:=TextWindowTitle.Text;<br> end<br> else begin<br> Showmessage('请输入窗口标题');<br> exit;<br> end;<br><br>hhpFile:=ChangeFileExt(chmFile, '.hhp');<br>hhcFile:=ChangeFileExt(chmFile, '.hhc');<br><br>TempHhpFile:=TempDir + ExtractFileName(hhpFile);<br>TempChmFile:=TempDir + ExtractFileName(chmFile);<br><br>BtnCompile.Enabled:=false;<br>BtnClose.Enabled:=false;<br><br>ImageActive.Visible:=True;<br>Label4.Visible:=True;<br>Label4.Caption:='正在编译…';<br><br>CreateListFile; //建立目录页面<br>CreateVersionFile; //建立版权页面<br>Createhhp; //建立项目文件<br>Createhhc; //建立目录文件<br><br>MkDir(TempDir); //在C根目录下建立新的临时子目录<br>RenameFile(hhpfile, TempHhpFile); //建立临时项目文件<br><br>ShellExec('open','hhc.exe',Pchar(temphhpfile),Pchar(currentdir),0,true);<br><br>if FileExists(hhpFile) then DeleteFile(hhpFile);<br>RenameFile(TempHhpFile, hhpFile); //恢复项目文件<br>RmDir(TempDir); //删除临时目录<br><br>if KeepTempFile.Checked=False<br>then begin if FileExists(hhpFile) then DeleteFile(hhpFile);<br> if FileExists(hhcFile) then DeleteFile(hhcFile);<br> if FileExists(ListFile) then DeleteFile(ListFile);<br> if FileExists(VersionFile) then DeleteFile(VersionFile);<br> end;<br> //删除临时文件:项目文件、目录文件、目录文件、版权文件<br><br>ImageActive.Visible:=False;<br>Label4.Caption:='编译完成';<br><br>if Display.Checked=True then<br> ShellExecute(handle, nil, Pchar(chmFile), nil, nil, 1);<br> //显示最终文件<br>BtnCompile.Enabled:=true;<br>BtnClose.Enabled:=True;<br>end;<br><br><br>function tMainForm.WinExecAndWait32(FileName:String; Visibility :integer)word;<br> {执行一个外部程序并等待其结束}<br>var<br>zAppName:array[0..512] of char;<br>zCurDir:array[0..255] of char;<br>WorkDir:String;<br>StartupInfo:TStartupInfo;<br>ProcessInfo:TProcessInformation;<br><br>begin<br>StrPCopy(zAppName,FileName);<br>GetDir(0,WorkDir);<br>StrPCopy(zCurDir,WorkDir);<br>FillChar(StartupInfo,Sizeof(StartupInfo),#0);<br>StartupInfo.cb := Sizeof(StartupInfo);<br>StartupInfo.dwFlags := STARTF_USESHOWWINDOW;<br>StartupInfo.wShowWindow := Visibility;<br>if not CreateProcess(nil,<br> zAppName, { pointer to command line string }<br> nil, { pointer to process security attributes }<br> nil, { pointer to thread security attributes }<br> false, { handle inheritance flag }<br> CREATE_NEW_CONSOLE or { creation flags } NORMAL_PRIORITY_CLASS,<br> nil, { pointer to new environment block }<br> nil, { pointer to current directory name }<br> StartupInfo, { pointer to STARTUPINFO }<br> ProcessInfo)<br>then Result := 1 { pointer to PROCESS_INF }<br>else begin<br> while WaitforSingleObject(ProcessInfo.hProcess,10)=WAIT_TIMEOUT<br> do Application.ProcessMessages;<br> GetExitCodeProcess(ProcessInfo.hProcess,Result);<br> end;<br>end;
腾 腾龙 Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-15 #10 watter:<br>你的不完全呀,还有:ShellExec是哪儿来的?我找了API中没有呀,如果是ShellExecute那参数又不对呀?
腾 腾龙 Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-17 #13 我试了,不过SHELLAPI里只有ShellExecute。没有ShellExec
腾 腾龙 Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-17 #15 可是参数不对呀。您能告诉我用SHELLEXEC应该怎么写?
腾 腾龙 Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-17 #17 老大呀,我看了ShellExecute的说明,我也知道他怎么用,可是ShellExec的参数和ShellExecute的参数完全不一样呀。
M mt Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-17 #18 同志们跑题啦,给分的是我,我想知道hha.dll,hhc.exe的<br>调用函数如编译、解译、以及捉标题等等!