home *** CD-ROM | disk | FTP | other *** search
/ BUG 4 / BUGCD1997_05.BIN / aplic / clip4win / clip4win.exe / C4W30E.HUF / SOURCE / HELP.PRG < prev    next >
Text File  |  1995-07-12  |  2KB  |  64 lines

  1. ////////////////////////////
  2. //
  3. //    Clip-4-Win WinHelp demo
  4. //
  5. //    Copyright (C) 1992 Skelton Software, Kendal Cottage, Hillam, Leeds, UK.
  6. //    All Rights Reserved.
  7. //
  8. //    To build:    c4wbuild winhelp
  9. //
  10. ////////////////////////////
  11.  
  12. #define    WIN_WANT_HELP
  13. #define    WIN_WANT_ALL
  14. #include "windows.ch"
  15. #define    NO_C4WCLASS
  16. #include "commands.ch"
  17.  
  18. static    hWnd
  19.  
  20. function main()
  21. local    oApp, oWnd
  22.  
  23. CREATE APPLICATION oApp  WINDOW oWND  TITLE "Clip-4-Win WinHelp demo"    ;
  24.     ON INIT MenuSetup(oWnd)
  25.  
  26. return nil
  27.  
  28.  
  29. static function DoHelp(nCmd)
  30. static    lNeedQuit := .f.
  31. local    n
  32.  
  33. if empty(nCmd) .and. lNeedQuit
  34.     WinHelp(hWnd, "PROGMAN.HLP", HELP_QUIT, 0)    // exiting
  35.     lNeedQuit = .f.
  36. else
  37.     n = WinHelp(hWnd, "PROGMAN.HLP", nCmd, iif(nCmd == HELP_PARTIALKEY, "", 0))
  38.     lNeedQuit = .t.
  39. endif
  40. return nil
  41.  
  42.  
  43. static function MenuSetup(oWnd)
  44. hWnd = oWnd
  45.  
  46. MENU IN oWnd
  47.     POPUP "&File"
  48.         MENUITEM "E&xit"                 ACTION (DoHelp(), PostQuitMessage())
  49.     ENDPOPUP
  50.     POPUP "&Help"
  51.         MENUITEM "&Contents"             ACTION DoHelp(HELP_CONTENTS)
  52.         MENUITEM "&Index"                ACTION DoHelp(HELP_INDEX)
  53.         MENUITEM "&Search for Help on..."  ACTION DoHelp(HELP_PARTIALKEY)
  54.         MENUITEM SEPARATOR
  55.         MENUITEM "&How to Use Help"      ACTION DoHelp(HELP_HELPONHELP)
  56.         MENUITEM "&Windows Tutorial"     ACTION WinExec("WINTUTOR.EXE")
  57.         MENUITEM SEPARATOR
  58.         MENUITEM "&About this program"   ACTION MessageBox( , "WinHelp Demo", "About")
  59.     ENDPOPUP
  60. ENDMENU
  61.  
  62. return nil
  63.  
  64.