home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / top2src.zip / TOPLINK.ZIP / MULAWARE.INT < prev    next >
Text File  |  1992-11-22  |  5KB  |  173 lines

  1. Unit MulAware;
  2. {
  3.   Multitasking Routines for TP 6.0, TP 7.0, & BP 7.0
  4.  
  5.   Copyright (c) 1992 ABSoft - ALL RIGHTS RESERVED
  6.  
  7.   1.00+  Internal Use Only
  8.   2.00   First Distributed Release
  9.   2.10   Fixed Windows Checking
  10.   2.11   Took out VMiX Code
  11.   2.20   Fixed DDOS Code - Locking up Novell
  12.   2.21   Fixed Code - Tried to be too smart for my own good
  13.   2.22   Fixed Code Again - Was Checking for DV 2.40+ instead of 2.26+
  14.   3.00   Complete ReWrite
  15.   3.01   Minor Update
  16.   3.10   Minor Update
  17.   3.11   Documentation Changes
  18.   3.12   Minor Optimizations
  19.   3.13   Took out Win 386 Support
  20.   3.20   Added MultiDos Plus Support
  21.   3.30   Added VMiX Support
  22.   3.40   Added Windows NT Support
  23.   3.41   Minor Optimizations
  24.   4.00   Updated for TP 7.0 & BP 7.0
  25. }
  26.  
  27. {$A-,B-,D-,E-,F-,G-,I-,L-,N-,O-,R-,S-,V-,X-}
  28.  
  29. {$IFDEF VER70}
  30.   {$P-,Q-,T-,Y-}
  31. {$ENDIF}
  32.  
  33. {$IFDEF PMODE}
  34.   {$G+}
  35. {$ENDIF}
  36.  
  37. Interface
  38.  
  39. Type
  40.   MultiType = (None,          {No Supported MultiTasker Found}
  41.                DESQview,      {DESQview 2.26+}
  42.                TopView,       {TopView, TaskView, DESQview 2.00-2.25,
  43.                                OmniView, or Compatible}
  44.                OS2,           {OS/2 2.0}
  45.                WinEnh,        {MS Windows 3.x in Enhanced Mode}
  46.                DoubleDOS,     {DoubleDOS}
  47.                WinStandard,   {MS Windows in Standard Mode}
  48.                TaskSwitcher,  {MS DOS 5.0 Task Switcher or Compatible}
  49.                MultiDos,      {MultiDos Plus 4.01}
  50.                VMiX,          {VMiX 2.75+}
  51.                WinNT);        {Windows NT}
  52.  
  53.  
  54. Var
  55.   MultiTasker : MultiType;
  56.  
  57. Procedure TimeSlice;
  58. {
  59.  Causes the current task to give up the rest of its time slice.
  60.  Useful in loops while waiting for keyboard input.  This procedure
  61.  calls the DOS idle interrupt if MultiTasker = None.
  62.  
  63.  example:
  64.    While not Keypressed do TimeSlice;
  65.  
  66.  Supported by:
  67.    None
  68.    DESQview
  69.    WinEnh
  70.    WinStandard
  71.    OS2
  72.    DoubleDOS
  73.    TopView
  74.    TaskSwitcher
  75.    MultiDos
  76.    VMiX
  77. }
  78.  
  79. Procedure PreventSwitching;
  80. {
  81.  Suspends multitasking and only services the current task.  Useful during
  82.  critical program functions.  Don't leave on for too long!  Call
  83.  ResumeSwitching to resume multitasking.
  84.  
  85.  Supported by:
  86.    DESQview
  87.    WinEnh
  88.    DoubleDOS
  89.    TopView
  90.    MultiDos
  91. }
  92.  
  93. Procedure ResumeSwitching;
  94. {
  95.  Called to resume multitasking after it has been suspended by
  96.  PreventSwitching.
  97.  
  98.  Supported by:
  99.    DESQview
  100.    WinEnh
  101.    DoubleDOS
  102.    TopView
  103.    MultiDos
  104. }
  105.  
  106. Function  MulVersion : Word;
  107. {
  108.  Returns the Version Number.  The high byte contains the major number, and
  109.  the low byte contains the minor number.  The number may be accessed like
  110.  this - WriteLn('Version ', Hi(MulVersion), '.', Lo(MulVersion)).
  111.  
  112.  Example:
  113.    DESQview 2.42 returns $022A (554).
  114.  
  115.  Supported by:
  116.    DESQview
  117.    WinEnh
  118.    OS2
  119.    VMiX
  120.    TopView (returns 0 for TaskView & DESQview 2.00-2.25}
  121. }
  122.  
  123. Function  VirtualBuffer : Word;
  124. {
  125.  Returns the address of the virtual video buffer.  Useful for doing
  126.  direct screen writes without 'bleed through'.  Under DoubleDOS, this
  127.  procedure must be called everytime you wish to do a direct write,
  128.  because the buffer changes.  The standard video address is returned
  129.  under a non-supported multitasker.  This is only valid for standard
  130.  text modes!
  131.  
  132.  Supported by:
  133.    DESQview
  134.    DoubleDOS
  135.    TopView
  136.    MultiDos
  137. }
  138.  
  139. Procedure TV_UpdateBuffer(Num : Word; Buffer, CharOffset : Word);
  140. {
  141.  Must be called when running under TaskView or clones to update the
  142.  screen from the virtual buffer.  This may be called under DESQview,
  143.  but doing so will cause DESQview to stop updating the screen
  144.  automatically.  Num contains the number of sequential characters
  145.  that were changed.  Buffer:CharOffset points to the first character
  146.  changed.  Buffer is the VirtualBuffer.  CharOffset is the Offset of
  147.  the first character changed.
  148.  
  149.  Do NOT call with Num = 0!
  150.  
  151.  Supported by:
  152.    DESQview
  153.    TopView
  154. }
  155.  
  156. Function  DDOS_Visible : Boolean;
  157. {
  158.  Returns true if the current task is the visible task under DoubleDOS.
  159.  Returns false if DoubleDOS NOT running OR if the current task is the
  160.  invisible task.  You must check MultiTasker if a false is returned.
  161.  
  162.  Supported by:
  163.    DoubleDOS
  164. }
  165.  
  166. Function  MDOS_Visible : Boolean;
  167. {
  168.  Returns true if the current task is the foreground task under MultiDos.
  169.  Returns false if the current task is running in the background OR
  170.  MultiDos is NOT running.  You must check MultiTasker if a false is
  171.  returned.
  172. }
  173.