home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TPMUL330.ZIP / MULAWARE.INT < prev    next >
Encoding:
Text File  |  1992-10-02  |  4.2 KB  |  162 lines

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