!     
!     This routine has been modified to work correctly with LF95.
!     Numerous changes were required from the way LF90 worked.
!

      SUBROUTINE MyMsg_API(Handle, TString)

      INTEGER             ::  Handle
      CHARACTER (LEN=*)   ::  TString

      CALL ForceTrimMsg(Handle, TRIM(TString))

      END SUBROUTINE MyMsg_API

!------------------------------------------------------------
      SUBROUTINE ForceTrimMsg(Handle, TString)

      USE WIN32MOD

      INTEGER             ::  Handle, I
      CHARACTER (LEN=*)   ::  TString

      I = SetWindowTextA(CARG(Handle),CARG(TString))

      END SUBROUTINE ForceTrimMsg


!------------------------------------------------------------
!  Lahey-specific TIMER routine is used to insert a PAUSE
!  for the specified number of seconds.
!
!  Note that this will fail if the start is less than "Seconds"
!  seconds before midnight due to the timer cycling back to zero.
!
      SUBROUTINE Slowdown(Seconds)
      IMPLICIT   NONE
      INTEGER    Seconds, St, En, Elapsed

      CALL TIMER(St)       ! hundredths of seconds since midnight
      CALL TIMER(En)       ! hundredths of seconds since midnight
      Elapsed = (En-St) / 100    ! seconds elapsed since TIMER(St)
      DO WHILE (Elapsed .LT. Seconds)
        CALL TIMER(En)       ! hundredths of seconds since midnight
        Elapsed = (En-St) / 100    ! seconds elapsed since TIMER(St)
      END DO

      END SUBROUTINE Slowdown

