说三道四技术文摘-感悟人生的经典句子
说三道四 > 文档快照

如何在vb中调用chm帮助文件?

编辑:说三道四文库 发布时间:2017-01-20 05:31
HTML文档下载 WORD文档下载 PDF文档下载
在工程属性中设置帮助文件名,这样在任何地方F1都会唤出CHM
'API声明
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal LpszDir As String, ByVal FsShowCmd As Long) As Long
Public Const SW_SHOW = 5

'使用方法,如点击帮助菜单
ShellExecute 0, "Open", App.Path & "\Help.chm", "", "", SW_SHOW 
谢谢,但我如你所说使用第二种方法时,出现编译错误,告诉我声明错误!
两个都是好办法。另加一个:
1。建立帮助类。
2。通过类来调用帮助。
此好处是支持别的驱动事件。如:左右键等。
直接用SHELL函数不行吗
或者用OLE控件也可以啊
设好工程的帮助文件名,需要的地方如下
i = HtmlHelp(Me.hWnd, App.HelpFile & "::/index.htm", HH_DISPLAY_TOPIC, 0)
'有关声明

Public Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, ByVal dwData As Long) As Long
      
Public Const HH_DISPLAY_TOPIC = &H0
Public Const HH_SET_WIN_TYPE = &H4
Public Const HH_GET_WIN_TYPE = &H5
Public Const HH_GET_WIN_HANDLE = &H6
Public Const HH_DISPLAY_TEXT_POPUP = &HE   ' Display string resource ID or
                                           ' text in a pop-up window.
Public Const HH_HELP_CONTEXT = &HF         ' Display mapped numeric value in
                                           ' dwData.
Public Const HH_TP_HELP_CONTEXTMENU = &H10 ' Text pop-up help, similar to
                                           ' WinHelp's HELP_CONTEXTMENU.
Public Const HH_TP_HELP_WM_HELP = &H11     ' text pop-up help, similar to
                                           ' WinHelp's HELP_WM_HELP.
Public Const HH_DISPLAY_SEARCH = &H2
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

要想用public声明,你就把他放到一个模块文件里
On Error Resume Next
    
    Dim AppDir As String
    Dim HelpFile As String
    AppDir = App.Path
    If Right(App.Path, 1) <> "\" Then
        AppDir = AppDir & "\"
    End If
    HelpFile = AppDir & "HelpFile.chm"
    
    Call Shell("hh.exe " & HelpFile, vbMaximizedFocus)

    'HH.exe 是Windows 自己带的一个可执行文件,在windows文件夹下就有,
不用什么API文件,那个多麻烦呀。OK
Dim yourHELP As Long
Dim HelpChmFile As String
HelpChmFile = App.Path & "\" & "flydragon.chm"
yourHELP = ShellExecute(0&, vbNullString, HelpChmFile, vbNullString, vbNullString, vbNormalFocus)
短短几句话就OK了,不用API的!
楼上的,难道ShellExecute不是API函数吗?!
哈哈~~,自打嘴巴!
昨晚加班加得太晚了,失礼!!

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Dim yourHELP As Long
Dim HelpChmFile As String
HelpChmFile = App.Path & "\" & "flydragon.chm"
yourHELP = ShellExecute(0&, vbNullString, HelpChmFile, vbNullString, vbNullString, vbNormalFocus) 
我的妈呀,这些人怎么搞得这么复杂?算你们会一点API?不需要API,很简单的,commondialog中不就有调用help的方法吗?
gz
AMD成首家X86+ARM双架构计算 欲寻新蓝海 锤子手机发布:Smartisan T1与其背后的开发团队 第六届中国云计算大会在北京隆重举行 替代笔记本的Surface Pro 3:800g、9.1mm,极致轻薄 PWorld2014:畅谈企业软件向“大平台”+“微应用”变革 微软公司全球资深副总裁张亚勤:云计算引领互联网物理化 亚马逊网络服务全球市场副总裁Ariel Kelman:亚马逊AWS云服务推动创新 终超苹果,谷歌成全球最有价值品牌 高通业务拓展总监沈周全:以软件为基础建立差异化优势 设计你所需要的,而不是你想要的 疯狂谷歌建广告天网:电冰箱、汽车仪表盘、恒温器、眼镜和手表 开发者眼中的编程语言…… 寻下一突破口?黑莓推Project Ion项目,正式进军物联网 无人驾驶汽车真的要来了:飞思卡尔研制视觉芯片 支持物联网开发! Qt发布5.3版与嵌入式企业版 5月23日:Java已经19岁啦! Google发布Dart1.4版本,新增Observatory工具 《近匠》Mixtile:跑在盒子中的嵌入式平台 从研发、平台化到营销:移动时代,汽车厂商如何升级? CTO俱乐部“云计算创新与实践”沙龙:云计算的发展趋势与那些“坑” 一周消息树:大型网站系统与Java中间件 良心推荐:6款基于云的移动应用开发工具 Google Project Tango第二弹:可生成3D图像的平板电脑 API企业化战略部署三部曲(一) 高通产品市场经理刘晓光:详解骁龙Android SDK 苹果史上最大交易:斥资30亿美元收购Beats 微软是否应该提高Windows版本的推送频率? 咸鱼大翻身?索尼将发展可穿戴游戏设备 popping:基于Facebook Pop引擎的iOS动画库 《近匠》专访极路由CTO康神 真正智能中心应当这样做 为什么说Android才是游戏开发者的乐土? 三戒,有请~~~ 谁知道websphere的试用版怎么做掉? 打印DataReport时怎样用API改变系统的纸型,急急急急急急急急急!!!! 新来的~~来报到了~~只能送20分~~希望大家不嫌弃~~ 请成功使用JBuilder5的朋友指教!! 激情放送 五位QQ号,100块,你会要吗? 555~~~~挂了PASCAL挂了,5555~~~~我学不好DELPHI 了5555谁帮我呀!!! 有编过游戏修改器的高手吗? jinesc领分~~~ 如何使UpDown每次增加或减少0.5? 有个问题很困惑,请教 上傳后,服務器端如何接收? 各位高手好!现在有谁是正在使用 LINUX 上网的.报一下好吗!!!!!! 我快神经了,求救 各位高手好!现在有谁是正在使用 LINUX 上网的.报一下好吗!!!!!!!! 别笑我傻,又有简单问题 各位高手好!现在有谁是正在使用 LINUX 上网的.报一下好吗!!!!!!! 各位高手好!现在有谁是正在使用 LINUX 上网的.报一下好吗!!!!!!!!!!!! 各位高手好!现在有谁是正在使用 LINUX 上网的.报一下好吗!!!!!!!!! 大家都谈谈建立什么样的目录结构能更好的管理硬盘里的东东 lilo 如何设置??请赐教!! 各位高手好!现在有谁是正在使用 LINUX 上网的.报一下好吗!!!!!!!!!!!1 mts是什么? mts是什么?? 学习汇编要什么基础,要看什么样的书,有没有好的汇编的电子参考书下载呢? 腾讯的qq怎么不好用了? 有CCNA,Scjp2,高程的计算机本科生能卖多少?(答者有分,只能给33分,没办法) word的表格问题 如果开另外一个线程来进行注册码检验,是否比较难CRACK? 请问高程考试考试的难度 怎么让程序启动的时候接受参数? mts是什么??? 我也调查:这里有多少冠名以“独孤”的,为何独孤???? 菜鸟SOS 个人论:编写程序方法论(原作者,huangbeyond) 向流版主学习,戒网!戒网!成天在网上瞎转,不如下去加强学习,碰到问题再上网寻求答案,天天在网上泡得久了,看到各大PB网站的编程技巧都有些视而不见了.....到PB论坛很多人都象到自己喜爱的聊天室了,到论坛好象就是来聊天一样.....戒网!戒网! 如何编写一个集成Ms Word的控件,能够处理WEB上的文件排版 怎么不能下载呢? 我是女孩,有人信吗??嘻嘻~~ 谁知道关于用vc编游戏的书,请各位大虫们介绍介绍好吗?谢谢了!!!!!!!!!! 有关sql server不能显示中文啊?? 关于B/S动态刷新问题 想不到,摩机三年今天居然栽了 beginpaint函数有什么用? 在PowerBuilder中怎么才能得到当前程序运行的路径? Sybase PowerDesigner v7.5 的中文学习材料谁有? 哪位大虾能够作一个查看游戏图片的辅助工具 请问casl汇编和asm有什么不同??谢谢!!!!!!!!!!111 Activex Document下载问题 kingxing(在江湖上混口饭吃) 能不能让程序一直运行哪一段呢?? 英语翻译 虞世南的咏风译文? 英语翻译National laws shall always take precedence over International guidelines.Cases made to International courts are likely to give precedence to a combination of the OECD Recommendation and either the European Data Privacy Directive or APEC P 王勃故事 文言文 急 英语翻译A star has 5ends;A squar has 4 ends; a triangle has 3ends; A linehas 2 ends; Aends;lifehasoneend.Butl hope our friendahip 英语翻译请帮忙翻译这段话:The $47.3 fee is a DHL charge for Quarantine processing carried out by Department of Agriculture,Fisheries and Forestry(DAFF).When shipments are inspected ,DAFF charges DHL for the quarantine inspection services 文言文 王勃故事 哪位好心人帮我把以下英文翻译成汉字Cat and rat live in a forest. Every summer, there is an animalrace in the forest. Cat ang rat join the race. Rat says toCat“I know a path. You can follow me.”So Cat runssays, “Let’s have a r 英语翻译If boy wizard(巫师) Harry Potter uses his magic to capture(迷住) the hearts of millions of teenagers,high school students Gabriella and Troy have charmed American boys and girls with their stories of campus life.They are the leading c 文言文 王勃故事 的题 几句英语翻译 急!好心人帮忙!吃太多的甜食容易使人发胖.(likely)饭后散一会儿步有益健康.(do good to ) 大量砍伐树木已经对生态平衡带来了严重影响.(upset) 照看婴儿是一项很累的活.(task) 听 英语翻译The discovery,development,and clinical use of antibiotics during the 20th century have decreased substantially the morbidity and mortality from bacterial infections.The antibiotic era started with the therapeutic application of sulfonamid 《王勃作》译文我不要滕王阁序的译文,我要的是《王勃作》这篇的译文,是写王勃在写《滕王阁序》的过程等等的那篇古文啊~OK? 英语翻译Hello seller,My Name is Mrs Jessica Morris,I want to make an urgent purchase of your item pasted on Yahoo Auctions for my Uncle in Nigeria,i will offer you the sum of $1,500.00 USD including the shipping cost via EMS SPEED POST.kindly get 英语翻译The DCS 968 series Auto start Controller is designed for use in applications involving control and safety monitoring of stationary engines.The use of the controller increases reliability and simplifies wring of the control panel. 《唐才子传》王勃的译文?开头是:勃子子安,太原人,王通之孙也.百度上的那个不一样的~不要复制过来,请看清楚了再回答! 英语翻译It is the rarest thing in the world to hear a rational discussion of vivisection.Those who disapprove of it are commonly accused of “sentimentality,” and very often their arguments justify the accusation.They paint pictures of pretty 英语翻译The following is an e-mail sent to you by an administrator of "Channel [v]Thailand".If this message is spam,contains abusive or other comments youfind offensive please contact the webmaster of the board at the followingaddress:webmaster@c 王勃故事(简短) 英语翻译Such development are possible .mobilizing the power of information technology ,some firms(eg,Moskowitz Jacob ,inc)have developed design labs that obtain consumers’ reactions to concepts and products and provide immediate,direct and 英语翻译I helped out a women several years ago that made mens underwear.She would send me samples to try on an I would send pic or video back to her so she could see the fitting.Would not have a problem offering you that help if you are intereste 王勃故事 现代科学研究发现:人除了头部大脑外,还有一个大脑藏在肚子里,称为“腹脑”.换句话说,你再也不能像过去那样将肚子简单地视为“酒囊饭袋”了.它是你的“第二大脑”.那么,造 英语翻译 英语翻译The old lady pulled her spectacles down and looked over them about the room .Then she put them up and looked out under them.She seldom or never looked through them for so samll a thing as a boy.They were her fancy pair,the pride of her he 英语翻译王勃著《腾王阁序》,时年十四.都督阎公之不信,勃虽在座,而阎公意属子婿孟学士者为之,已宿构矣. 英语翻译So i want to tell me if you have the previous selection in your stock on the right SIZES that i ask you atd those three new selection.and i want to tell me do you have all the others in follow sizes? 英语翻译Make a periscopeHave you ever been in a crowd at a football match and wished you were much taller?Don't worry about it now.A Home-made periscope could be the answer to your wish.This is what you do...1.Look at the diagram and draw the sha 英语翻译王勃著《滕王阁序》,时年十四.都督阎公不之信.勃虽在座,而阎公意属子婿孟学士者为之,已宿构矣.及从纸笔巡让宾客,勃不辞让.公大怒,拂衣而去,专会人伺其下笔.第一报云:‘南昌 英语翻译请你原谅我的失误,你所购买的产品已经缺货,现在我提供一些相似产品的照片供你选择.我希望能够在星期一把你的货发出去. 英语翻译Since detention of a ship is a serious matter involving many issues,it may be in the best interest of the PSCO to act with other interested parties. 求王勃《滕王阁序》的原文以及翻译 英语翻译1.Like many people,I have no clear idea about heroes.At some point,we all wonder if we need a hero and what a hero really is.2.A hero does something worth talking about.A hero has a special story to tell and people think highly of it.But 英语翻译lazy.I wasn't surprised to find that my worst report was from my science teacher.it's just that i find science really difficult.that‘s about all the news i have for now.send their love. 英语翻译看见机 英语翻译中文,要人工翻译You can see that we are ordering nearly every two weeks so I want you to give me good prices. I want you to send me links for women and babies with long sleeves. My wife and my daughter are waiting for your response 英语翻译AVL techniques have widely been perceived as useful technologies in many APTS areas,such as automatic vehicle location,vehicle component monitoring,automatic passenger counters,electronic fare boxes,timed transfers,traffic signal preempti 英语翻译求翻译:滕王高阁临江渚,佩玉鸣鸢罢歌舞.画栋朝飞南浦云,珠帘暮卷西山雨.闲云潭影日悠悠,物换星移几度秋.阁中帝子今何在?栏外长江空自流. 英语翻译Sales volumeMarket shareProfitDealer ordersComplaintsCompetitors 英语翻译用机器翻译的话麻烦也稍微修改一下,意思大概正确,语句通顺即可The two factors (dependent variables) considered for this research study were the systems integration complexity (systems integration process complexity 王勃展才 翻译 英语翻译Open the Front cover,then replace the Toner carthidge Witna New one 英语翻译用机器翻译的话麻烦也稍微修改一下,意思大概正确,语句通顺即可 Fig.7 illustrates improvements at five different levels in the systems integration process complexity on the vertical axis as a result of the requireme 诗歌鉴赏王勃《咏风》的答案 英语翻译Please note that the transcript of records should include information on the grading scale used at the institution.The document explaining the grading scale should preferably be issued by the awarding institution and be officially certifi 英语翻译Out of the night that covers me,Black as the pit from pole to pole,I thank whatever gods may beFor my unconquerable soul.In the fell clutch of circumstanceI have not winced nor cried aloud.Under the bludgeonings of chanceMy head is bloody 《咏风》王勃.这首诗整体上运用了什么表现手法,表达了诗人怎样的情感如题 英语翻译由于上海正在举办世博会,出于安全措施,对液体【香水属于液体】稽查的的特别严格,我为了能够让您早点收到货物,已经重新发货给您,并且绕道另一个城市【广州】出关.由于发送液 英语翻译Dear Mark,New York is finally getting a real sales manager.Congratulations on your new promotion.Your marketing ability has put you well above everyone else in the company,and probably everyone else in the industry.The company will benefi 《咏风》 王勃 鉴赏 要短一点的,100来字左右,要短一点的,查到的都太长!100字就够了!答得好有的加分! 英语翻译The sun goes downThe stars come outAnd all that countsIs here and nowMy universe will never be the sameI'm glad you came... 英语翻译HappinessHappiness means different things to different people.For example,some students believe that if they have much money or a large number of possessions,they will be happy.They believe that they will be able to do anything they want 咏风 王勃此诗的余味 英语翻译如果你想得到商品,请您支付我50USD的运费,或者购买不低于100USD的商品. 英语翻译B:hey ,what if you did not have adventures ,I think my life is estimated to be the case.After graduating from college ,took barely a month to feed their own money,what are generally married woman,birth wanderers .Nothing exciting live to 《咏风》王勃这首诗的“诗眼”是哪两个字?请简要分析. 英语翻译提示信息尊敬的EMS客户:首先非常感谢您选择和信任EMS.最近因欧美部分地区受降雪、冰冻等灾害天气影响,导致航班延误或者取消,甚至地面交通瘫痪.受影响较严重的国家和地区有: 谷歌英语在线翻译发音准不准? 英语翻译Ofcourse,in a company that’s grown from three employees to 10,000 and from zerovalue to hundreds of billions of dollars in about five years,it may bequibbling to talk about “problems”,but there’s no doubt that such rapid growthdoe 《咏风》王勃 (1)这首诗写“风”,主要用了什么修辞手法?请简要分析其表达作用. 英语翻译货物已经发出,航空小包是无跟踪查询信息的.前一段时间由于欧美出现雪灾.导致一些邮件延误.现在情况已经好转,相信你很快就会收到货,请您耐心等待.我已经到邮局做书面查询,结
备案号:鲁ICP备13029499号-2 说三道四 www.s3d4.cn