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

// Devuelve el ancho en unidades lągicas ( Gr ficas ) de una cadena.
// returns the width of a string in pixels

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

CLIPPER GetTextWid() // ( hDC, szText )
{
   HDC   hDC        = _parni( 1 );
   DWORD dwSize;
   BOOL  bDestroyDC = FALSE;

   if( ! hDC )
   {
      bDestroyDC = TRUE;
      hDC = GetDC( GetActiveWindow() );
   }

   dwSize = GetTextExtent( hDC, _parc( 2 ), _parclen( 2 ) );

   if( bDestroyDC )
       ReleaseDC( 0, hDC );

   _retni( LOWORD( dwSize ) );

}

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

CLIPPER GETTEXTHEI()  // GHT()
{
   TEXTMETRIC tm;
   HWND hWnd = _parni( 1 );
   HDC hDC   = GetDC( hWnd );

   GetTextMetrics( hDC, &tm );

   ReleaseDC( hWnd, hDC );

   _retni( tm.tmHeight );
}

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