home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OS2XLSP1.ZIP / HELP.LSP < prev    next >
Text File  |  1988-07-19  |  1KB  |  43 lines

  1. ; help.lsp
  2. ; run-time dynamic linking to Microsoft QHELP
  3.  
  4. ; topic
  5. (if (not (boundp 'topic))
  6.     (define topic "List categories"))
  7.  
  8. (if (not (define help (loadmodule "mshelp")))
  9.     (error "This program requires MSHELP.DLL"))
  10.         
  11. (define help.open (getprocaddr help "HELPOPEN"))
  12. (define help.nc (getprocaddr help "HELPNC"))
  13. (define help.look (getprocaddr help "HELPLOOK"))
  14. (define help.decomp (getprocaddr help "HELPDECOMP"))
  15. (define help.getline (getprocaddr help "HELPGETLINE"))
  16. (define help.getcells (getprocaddr help "HELPGETCELLS"))
  17.  
  18. (define strseg (dos-alloc-seg 0))       ; 64K
  19. (define str (mk-fp strseg 0))
  20.  
  21. ; should scan environment for QH variable
  22.  
  23. (define context (call help.open "d:\\os2\\qh\\qh.hlp" 'long))
  24. (define request (call help.nc topic context 'long))
  25. (define len (call help.look request str))
  26. (call help.decomp str (+ 32000 str) request)
  27.  
  28. (define buf (make-string 32 len))
  29. (define categories nil)
  30. (define i 0)
  31. (while (> (call help.getline (word (+ i 2)) (word len) buf (+ 32000 str)) 1)
  32.     (format stdout "~A\n" buf)
  33.     (incr i))
  34.  
  35. ; categories now contains list of categories
  36.  
  37. (dos-free-seg strseg)
  38. (freemodule help)
  39.  
  40. ; to get actual help text:  HelpGetCells(short usLines, 76, buf, decompbuf,
  41. ; attr-array[5]=0x07,0x70,0x02,0x0F,0x30)   ????
  42. ; increment usLines
  43.