Print Page | Close Window

HelpContext

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=16075
Printed Date: 27 November 2024 at 12:16am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: HelpContext
Posted By: joeliner
Subject: HelpContext
Date Posted: 26 January 2010 at 4:11am
Hi guys

Am trying to access chm help file by specifying the helpcommand and helpcontext but no success

Anyone who has done it?

regards,




-------------
Product: Xtreme SuitePro (ActiveX) version 13.1
Platform: Windows XP SP 3
Language: Visual Basic 6 SP6



Replies:
Posted By: Mr.Den
Date Posted: 26 January 2010 at 12:31pm
Try:
 
Shell "rundll32.exe url.dll,FileProtocolHandler C:\WINDOWS\Help\access.chm", vbNormalFocus
 
change C:\WINDOWS\Help\access.chm to the path/filename you need.
 
A start to get the file up, I have code somewhere to specify but cannot look now, will check after lunch.


-------------
Product: Xtreme SuitePro (ActiveX) version 16.3.1

Platform: Windows 7 Professional (64bit) - SP 1

Language: Visual Basic 6.0 SP 6


Posted By: Mr.Den
Date Posted: 26 January 2010 at 12:45pm

Found code faster than I thought I would

This code works with .hlp files, try it with the .chm files and see if it works. Not sure, but worth a shot.
 
'WINHELP DECLARATION
Public Declare Function WinHelp Lib "user32" Alias "WinHelpA" _
      (ByVal HWND As Long, ByVal lpHelpFile As String, _
      ByVal wCommand As Long, ByVal dwData As Long) As Long
 
Public Const HELP_CONTENTS = 3
Public Const HELP_FINDER = 11
 
'IN A MODULE
Public Sub ShowHelpContextID(ByVal intHelpFile As Integer, lngContextID As Long)
   
    ' Open the help file using the
    ' HELP_CONTEXT constant (1)
   
    WinHelp App.hInstance, SetHelpStrings(intHelpFile), 1, lngContextID
   
End Sub
 
Public Function SetHelpStrings(ByVal intSelHelpFile As Integer) As String
   
    ' Set the string variable to
    ' include the application path
   
    Select Case intSelHelpFile
       
        Case 1
            SetHelpStrings = App.Path & "\Res\Backup.hlp"
       
        Case 2
            ' Place other Help file paths in successive Case statements
            SetHelpStrings = App.Path & "\Res\Restore.hlp"
            
    End Select
 
End Function
 


-------------
Product: Xtreme SuitePro (ActiveX) version 16.3.1

Platform: Windows 7 Professional (64bit) - SP 1

Language: Visual Basic 6.0 SP 6


Posted By: joeliner
Date Posted: 27 January 2010 at 10:07am
Hi Mr. Den,

Thanks for your input

@ first i had tried out the CJ way using this code. The help shows but i cannot show a specific page using the helpcontext command

      With CommonDialog
        .HelpFile = App.Path & "\somehelp.chm"
        .DialogStyle = 1
        .helpcommand = 1
        .HelpContext = 1001
        .Flags = 0
        .showhelp
      End With

For API I was using

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

which works for for both chm and winhelp.

My main interest was on how i can navigate to a specific page on the help.

regards,


-------------
Product: Xtreme SuitePro (ActiveX) version 13.1
Platform: Windows XP SP 3
Language: Visual Basic 6 SP6


Posted By: Mr.Den
Date Posted: 28 January 2010 at 12:12pm
Originally posted by joeliner joeliner wrote:

Hi Mr. Den,

Thanks for your input

@ first i had tried out the CJ way using this code. The help shows but i cannot show a specific page using the helpcontext command

      With CommonDialog
        .HelpFile = App.Path & "\somehelp.chm"
        .DialogStyle = 1
        .helpcommand = 1
        .HelpContext = 1001
        .Flags = 0
        .showhelp
      End With

For API I was using

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

which works for for both chm and winhelp.

My main interest was on how i can navigate to a specific page on the help.

regards,
 
Using the code I gave you above:
 
Adding to the declarations:
   
    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
 
I change this line:
WinHelp App.hInstance, SetHelpStrings(intHelpFile), 1, lngContextID
 
to:
HtmlHelp App.hInstance, SetHelpStrings(intHelpFile), 1, lngContextID
 
And the code works properly for .hlp files, have you tried that on a .chm file?


-------------
Product: Xtreme SuitePro (ActiveX) version 16.3.1

Platform: Windows 7 Professional (64bit) - SP 1

Language: Visual Basic 6.0 SP 6



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net