#include <WinTen.h>
#include <Windows.h>
#include <ClipApi.h>

//----------------------------------------------------------------------------//

CLIPPER WScroll()
{
   HWND hWnd   = _parni( 1 );
   WORD wRows  = _parni( 2 );
   HFONT hFont = _parni( 3 );
   HFONT hOldFont;
   HDC hDC     = GetDC( hWnd );
   TEXTMETRIC tm;

   if( hFont )
      hOldFont = SelectObject( hDC, hFont );

   GetTextMetrics( hDC, &tm );
   ScrollWindow( hWnd, 0, -( tm.tmHeight * wRows ), 0, 0 );

   if( hFont )
      SelectObject( hDC, hOldFont );

   ReleaseDC( hWnd, hDC );
}

//----------------------------------------------------------------------------//

CLIPPER WBrwScroll()
{
   HWND hWnd   = _parni( 1 );
   WORD wRows  = _parni( 2 );
   HFONT hFont = _parni( 3 );
   HFONT hOldFont;
   HDC hDC     = GetDC( hWnd );
   RECT rct;
   TEXTMETRIC tm;

   if( hFont )
      hOldFont = SelectObject( hDC, hFont );

   GetClientRect( hWnd, &rct );
   GetTextMetrics( hDC, &tm );

   rct.top += tm.tmHeight;
   ScrollWindow( hWnd, 0, -( tm.tmHeight * wRows ), 0, &rct );

   if( hFont )
      SelectObject( hDC, hOldFont );

   ReleaseDC( hWnd, hDC );
}

//----------------------------------------------------------------------------//
