home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / truegrid / disk1 / genledgr / genledgr.$ / WINHELP.BAS < prev   
Encoding:
BASIC Source File  |  1995-02-17  |  1.7 KB  |  75 lines

  1. ' The TrueGrid Sample Application
  2.  
  3. ' WINHELP.BAS - This module contains Windows API declarations and
  4. ' utility routines that provide access to the WinHelp application.
  5.  
  6. Const HELP_CONTEXT = &H1
  7. Const HELP_HELPONHELP = &H4
  8. Const HELP_QUIT = &H2
  9.  
  10.  
  11. ' Help context IDs for sample applications
  12. Global Const HELP_TRUEBROWSER = 1000
  13. Global Const HELP_DBTABLE = 1001
  14. Global Const HELP_LINKGRID = 1002
  15. Global Const HELP_MARKGRID = 1003
  16. Global Const HELP_APPTBOOK = 1004
  17. Global Const HELP_GENERALEDGER = 1005
  18. Global Const HELP_DRAGDROP = 1006
  19.  
  20. Declare Function WinHelp Lib "User" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, ByVal dwData As Any) As Integer
  21.  
  22. Function GetHelpFile () As String
  23.  
  24.     GetHelpFile = ""
  25.  
  26.     Wh$ = TrueGridWhere$()
  27.  
  28.     On Error GoTo tryagain
  29.     
  30.     H$ = Wh$ + "truegrid.hlp"
  31.     I$ = Dir$(H$)
  32.     GetHelpFile = H$
  33.  
  34.     Exit Function
  35.  
  36. tryagain:
  37.     H$ = App.Path + "\truegrid.hlp"
  38.     
  39.     If Dir$(H$) = "" Then
  40.         GetHelpFile = ""
  41.     Else
  42.         GetHelpFile = H$
  43.     End If
  44.     Exit Function
  45.  
  46. End Function
  47.  
  48. Sub HelpContext (This As Form, Context As Integer)
  49.  
  50. ' Display a particular frame of the TrueGrid help file, if found in
  51. ' the product installation directory or the application directory
  52.  
  53.     H$ = GetHelpFile()
  54.  
  55.     If H$ <> "" Then
  56.         Z% = WinHelp(This.hWnd, H$, HELP_CONTEXT, CLng(Context))
  57.     Else
  58.         MsgBox "Can't find TrueGrid help file", MB_ICONEXCLAMATION
  59.     End If
  60.  
  61. End Sub
  62.  
  63. Sub HelpOnHelp (This As Form)
  64.  
  65. ' Display instructions for using WinHelp
  66.  
  67.     Z% = WinHelp(This.hWnd, dummy$, HELP_HELPONHELP, CLng(0))
  68.  
  69. End Sub
  70.  
  71. Sub HelpQuit (This As Form)
  72.   R = WinHelp(This.hWnd, dummy$, HELP_QUIT, CLng(0))
  73. End Sub
  74.  
  75.