home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / ctrlhe / DOHELP.OPL < prev   
Text File  |  1992-07-07  |  1KB  |  70 lines

  1. PROC dohelp:
  2.     local capt% :rem whether key is captured
  3.     local owner% :rem pid of owner
  4.     local pid% :rem own pid
  5.     local allpids%(22)
  6.  
  7.     owner%=peekw($28) :rem as ProcCopyTo'ed by CtrlHelp
  8.     capt%=0 :rem Help key not captured yet
  9.     nonactv:
  10.     pid%=call($0088,0,0,0,0,0) :rem ProcId
  11.     escape off
  12.     lockback:
  13.     while 1
  14.         if call($8c8d,owner%,0,0,0,0)<0 :rem wClientInfo
  15.             stop :rem Owner has terminated
  16.         endif
  17.         call($d98d,0,0,0,addr(allpids%(1)),0) :rem wGetProcessList
  18.         if allpids%(1)=owner%
  19.             if capt%=0
  20.                 if call($c58d,$123,$800,0,0,0)=0
  21.                     capt%=1
  22.                 endif
  23.             endif
  24.         else
  25.             if allpids%(1)=pid% :rem was tasked to foreground by Shell
  26.                 lockback:
  27.             endif
  28.             if capt%=1
  29.                 if call($c68d,$123,$800,0,0,0)=0
  30.                     capt%=0
  31.                 endif
  32.             endif
  33.         endif
  34.         pause -20
  35.         if key=$123
  36.             if capt%=1
  37.                 if call($c68d,$123,$800,0,0,0)=0
  38.                     capt%=0
  39.                 endif
  40.             endif
  41.             showhelp:
  42.         endif
  43.     endwh
  44. ENDP
  45.  
  46. proc nonactv:
  47. rem Don't keep the machine on just because of this app
  48.     call ($138b,0,0,0,0,0) :rem GenMarkNonActive
  49. endp
  50.  
  51. PROC lockback:
  52. rem lock into background
  53.     call($c78d,100,0,0,0,0) :rem wSystemModal
  54. ENDP
  55.  
  56. PROC tofore:
  57. rem Cancel system modality and come to foreground
  58.     call($c88d,0,0,0,0,0) :rem wCancelSystemModal
  59. ENDP
  60.  
  61. PROC showhelp:
  62.     tofore:
  63.     dInit
  64.     dText "","Help text",2
  65.     dText "","Some more",2
  66.     dialog
  67.     lockback:
  68. ENDP
  69.     
  70.