打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
打开帮助文档CHM文件并且显示关键词(软件F1键功能)

打开帮助文档CHM文件并且显示关键词

常见代码编辑的F1键功能

  1. Function OpenHtmlHelp(hWndForm As HWnd,nFile As String,nKey As String  ) As HWnd '
  2.   
  3.   Dim hh As Function (ByVal hwndCaller As HWnd , ByVal pszFile As LPCSTR , ByVal uCommand As UINT , ByVal dwData As DWORD_PTR) As HWnd
  4.   Dim As Any Ptr library = Dylibload( "hhctrl.ocx" )
  5.   hh = Dylibsymbol( library, "HtmlHelpA" )
  6.   Dim  szPath      As  String 
  7.   Dim  szText      As  String  
  8.   Dim  hlk(7) As ULong
  9.   szPath=nFile & Chr(0) 'Help 文件名,带文件夹
  10.   szText=nKey & Chr(0) '要查寻的关键词
  11.   '  hlk.cbStruct = Sizeof(hlk)
  12.   '  hlk.pszKeywords = @szText
  13.   '  hlk.fIndexOnFail = True
  14.   hlk(0)=Sizeof(hlk)
  15.   hlk(2)=Strptr(szText)
  16.   hlk(7)=1
  17.   hh( hWndForm, Strptr(szPath), 0, Null)'HH_DISPLAY_TOPIC
  18.   Function=hh( hWndForm, Strptr(szPath), &H000D, @hlk(0))'HH_KEYWORD_LOOKUP
  19.   Dylibfree( library )
  20.   ' // Size = 32 bytes
  21.   'Type HH_AKLINK
  22.   '   cbStruct     As Long        ' int       cbStruct;     // sizeof this structure
  23.   '   fReserved    As Long        ' BOOL      fReserved;    // must be FALSE (really!)
  24.   '   pszKeywords  As ZString Ptr  ' LPCTSTR   pszKeywords;  // semi-colon separated keywords
  25.   '   pszUrl       As ZString Ptr  ' LPCTSTR   pszUrl;       // URL to jump to if no keywords found (may be NULL)
  26.   '   pszMsgText   As ZString Ptr  ' LPCTSTR   pszMsgText;   // Message text to display in MessageBox if pszUrl is NULL and no keyword match
  27.   '   pszMsgTitle  As ZString Ptr  ' LPCTSTR   pszMsgTitle;  // Message text to display in MessageBox if pszUrl is NULL and no keyword match
  28.   '   pszWindow    As ZString Ptr  ' LPCTSTR   pszWindow;    // Window to display URL in
  29.   '   fIndexOnFail As Long        ' BOOL      fIndexOnFail; // Displays index if keyword lookup fails.
  30.   'End Type
  31. End Function

用法举例:OpenHtmlHelp "X:\Help\Win32SDK.CHM","abc"

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
DllCall 学习笔记
VB.NET自动操作其他程序(3)
超简单方法反编译CHM文件
請問WIN7 64位下CHM格式書打不開怎麼解決?
怎么在电脑中打开CHM文件
chm文件无法打开的解决方法
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服