ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

转¥Ñ¡GVB.NET调¥ÎCHM帮§U¤èªk

转¥Ñ¡GVB.NET调¥ÎCHM帮§U¤èªk

VB.NET调¥ÎCHM帮§U¤èªk¤@¡@¨Ï¥ÎF1键¡G

¡@¡@这Ïú¤èªk³Ì简单¡A¥u»Ý¦p¤U¥N码§Y¥i¡G
Private Sub Form_Load()  
App.HelpFile = app.path & "\help.chm"  
'调¥ÎÉO¥Dµ{§Ç¦P¥Ø录¤Uªºhelp.chm帮§U¤å¥ó¡A«öF1键调¥Î  
End Sub
¡@¡@VB.NET调¥ÎCHM帮§U¤èªk¤G ¨Ï¥ÎSendKeys¤èªk¡G

Private Sub Form_Load()
App.HelpFile = app.path & "\help.chm"  
End Sub  
private Sub CmdHelp_Click() SendKeys "{F1}" '发°e击键¨ì¬¡动µ¡¤f
End Sub
¡@¡@VB.NET调¥ÎCHM帮§U¤èªk¤T ¨Ï¥ÎShell¨ç数¡G
private Sub CmdHelp_Click()  
Shell "hh.exe help.chm", vbNormalFocus  
'help.chm为«ü©wªº帮§U¤å¥ó¡A¥i¥]§t¸ô径¡C
End Sub
¡@¡@VB.NET调¥ÎCHM帮§U¤èªk¥| ¨Ï¥ÎHtmlHelp¨ç数¡G

¡@¡@¥ý声©ú¦p¤UAPI¡G
Option Explicit  
Private Declare Function HtmlHelpA Lib "hhctrl.ocx"  
(ByVal hwndCaller As Long, ByVal pszFile As String,  
ByVal uCommand As Long, ByVal dwData As Long) As Long '
hwndCaller«ü©w调¥ÎªÌªºµ¡¤f¡ApszFile«ü©w­n调¥Îªº¤å¥ó¡A
uCommand¬O发°e给 HtmlHelpªº©R¥O¡AdwData¬OuCommandªº参数¡C
µM¦Z¦b过µ{¤¤调¥Î¡G
private Sub CmdHelp_Click()  
dim i as string
i = app.path & "\help.chm"
'¥Î变¶qi记录ÉO¥Dµ{§Ç¦P¥Ø录¤Uªºhelp.chm帮§U¤å¥ó  
HtmlHelpA Form1.hWnd, i, 0, 0
End Sub
¡@¡@VB.NET调¥ÎCHM帮§U¤èªk¤­ ¨Ï¥ÎShellExecute¨ç数¡G

¡@¡@¥ý声©ú¦p¤UAPI¡G
Option Explicit     
'声©úAPI¨ç数¥Î¤_ÉݨB¥´开¤@个¤å档     
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     
Private Const SW_SHOWNORMAL = 1   

¡@¡@µM¦Z¦b过µ{¤¤调¥Î¡G
private Sub CmdHelp_Click()     
dim a as long     
Dim b As String     
b = App.Path & "\help.chm"     
'¥Î变¶qb记录ÉO¥Dµ{§Ç¦P¥Ø录¤Uªºhelp.chm帮§U¤å¥ó     
a = ShellExecute (0, "open", b, "", "", SW_SHOWNORMAL)     
End Sub   


¡@¡@¥H¤W¤­ÏúVB.NET调¥ÎCHM帮§Uªº¤èªk¦U¦³É¬¯Ê点¡A从¥N码ªº简单¤W讲¡A«Ø议¨Ï¥Î²Ä¤GÏú¤èªk¡C从¥\¯à¤W讲¡A«Ø议¨Ï¥Î²Ä¤­Ïú¤èªk¡A¦]¨ä¤£¥u¥Î¤_¥´开CHM帮§U¤å¥ó¡A还¥i¥Î¦P样ªº®æ¦¡¥´开¡B¥´¦L©Î¬d§ä¤@个¤å¥ó©Î¤å档
学习

        ÀR«ä¦Û¦b : ¬°¦Û¤v§äÂǤfªº¤H¥Ã»·¤£·|¶i¨B¡C
ªð¦^¦Cªí ¤W¤@¥DÃD