请教各位高手,怎么实现调用CHM帮助的时候,能定位到与当前运行程序功能模块对应的帮助页面,解决立即给分

解决方案 »

  1.   

    这有: http://dev.csdn.net/Develop/article/18/18116.shtm
    上下文关联的chm帮助   在Delphi中实现上下文关联的chm帮助,可以调用Windows系统目录System32下的HHCTRL.OCX控件中的HtmlHelpA函数实现。 需要以下几个步骤:  1 设置相关控件的HelpContext属性。  例,主窗体frmMain::10100 ,其中的文本框 edtInput:10101 对话框dlgReport:10200 ,其中的组合列表框 cbReportEdit:10201 2 声明HtmlHelpA函数 function HtmlHelpA (hwndcaller:Longint; lpHelpFile:string; wCommand:Longint;dwData:string): HWND;stdcall; external 'hhctrl.ocx' 3  F1按键响应 //公用函数ShowChmHelp显示不同帮助画面。procedure ShowChmHelp(sTopic:string); var i:integer;begin  i:=HtmlHelpA(Application.Handle,Pchar(ExePath+'\help.chm’),HH_DISPLAY_TOPIC,sTopic);  if i=0 then  begin      Showmessage(' help.chm 帮助文件损坏!');      exit;  end;end;….function TfrmMain.FormHelp(Command: Word; Data: Integer; var CallHelp: Boolean): Boolean;begin   case Data of     10100: ShowChmHelp(frmMain.htm);     10101: ShowChmHelp('edtInput.htm');…     else  ShowChmHelp(default.htm');   end;end;function TdlgReport.FormHelp(Command: Word; Data: Integer; var CallHelp: Boolean): Boolean;begin   case Data of     10200: ShowChmHelp('dlgReport.htm');10201: ShowChmHelp(cbReportEdit.htm');…     else  ShowChmHelp(default.htm');   end;end;这样,通过不同窗体的FormHelp事件,就可以实现帮助的关联。
      

  2.   

    定位到某个页面的方法我不是说了吗?
    mk:@MSITStore:D:\Program%20Files\dfw\dfwbbs.chm::/125/1255808.htm
                  --这是文件名                       --这是要定位到的页面你可以设置Form.HelpKeyWord为要定位到的页面
    在OnKeyDown事件中:
    WinExec(PChar('hh.exe mk:@MSITStore:help.chm::/'+ Application.MainForm.HelpKeyWord), SW_SHOWMAXIMIZED);
      

  3.   

    WinExec('hh.exe mk:@MSITStore:D:\Program%20Files\dfw\dfwbbs.chm::/125/1255808.htm', SW_SHOW);
    在CHM的页面内容上按右键-属性可以看到字符串“mk:@MSITStore:D:\Program%20Files\dfw\dfwbbs.chm::/125/1255808.htm”
      

  4.   

    HtmlHelpA(GetDesktopWindow(), 'E:\help.chm::/aa.htm>main', 1, '');
      

  5.   

    Jedi上面的HTMLHELP都放了几年了
      

  6.   

    ”Jedi上面的HTMLHELP都放了几年了“
    Jedi指的是什么啊,请指教,谢谢
      

  7.   

    为什么会有这样的连接啊?125/1255808.htm
    是做CHM的时候将网页以数字命名吗