home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / truegrid / disk1 / apptbook / apptbook.$ / WINHELP.BAS < prev   
Encoding:
BASIC Source File  |  1995-02-17  |  1.8 KB  |  77 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_GENLEDGR = 1005
  18. Global Const HELP_DRAGDROP = 1006
  19. Global Const HELP_EDITING = 1007
  20. Global Const HELP_DROPDOWN = 1008
  21.  
  22. Declare Function WinHelp Lib "User" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, ByVal dwData As Any) As Integer
  23.  
  24. Function GetHelpFile () As String
  25.  
  26.     GetHelpFile = ""
  27.  
  28.     Wh$ = TrueGridWhere$()
  29.  
  30.     On Error GoTo tryagain
  31.     
  32.     H$ = Wh$ + "truegrid.hlp"
  33.     I$ = Dir$(H$)
  34.     GetHelpFile = H$
  35.  
  36.     Exit Function
  37.  
  38. tryagain:
  39.     H$ = App.Path + "\truegrid.hlp"
  40.     
  41.     If Dir$(H$) = "" Then
  42.         GetHelpFile = ""
  43.     Else
  44.         GetHelpFile = H$
  45.     End If
  46.     Exit Function
  47.  
  48. End Function
  49.  
  50. Sub HelpContext (This As Form, Context As Integer)
  51.  
  52. ' Display a particular frame of the TrueGrid help file, if found in
  53. ' the product installation directory or the application directory
  54.  
  55.     H$ = GetHelpFile()
  56.  
  57.     If H$ <> "" Then
  58.         Z% = WinHelp(This.hWnd, H$, HELP_CONTEXT, CLng(Context))
  59.     Else
  60.         MsgBox "Can't find TrueGrid help file", MB_ICONEXCLAMATION
  61.     End If
  62.  
  63. End Sub
  64.  
  65. Sub HelpOnHelp (This As Form)
  66.  
  67. ' Display instructions for using WinHelp
  68.  
  69.     Z% = WinHelp(This.hWnd, dummy$, HELP_HELPONHELP, CLng(0))
  70.  
  71. End Sub
  72.  
  73. Sub HelpQuit (This As Form)
  74.   R = WinHelp(This.hWnd, dummy$, HELP_QUIT, CLng(0))
  75. End Sub
  76.  
  77.