C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WGSCRBUF.C
                                             Up Contents Index Back
─────Run-Time Library───────────────────────────────────────────────────────
 
/* WGSCRBUF.C - Demonstrate examining the
 * current size of a QuickWin window's
 * screen buffer
 */
 
#include <io.h>
#include <stdio.h>
 
#define NUMWINS     4     /* Number of windows */
#define OPENFLAGS   "w"   /* Access permission */
 
void main()
{
   int nSize;             /* Size of screen buffer */
   int nRes;              /* Write result */
   FILE *wp;              /* File pointer */
 
   /* Open a window */
   /* NULL arguments accept default characteristics */
   wp = _fwopen( NULL, NULL, OPENFLAGS );
   if( wp == NULL )
   {
      printf( "***ERROR:_fwopen\n" );
      exit( -1 );
   }
 
   /* Get the size of its screen buffer */
   nSize = _wgetscreenbuf( _fileno( wp ) );
   nRes = fprintf( wp, "Screen buffer holds %i chars\n", nSize );
 
   nRes = _wclose( _fileno( wp ), _WINPERSIST );
 
   exit( 0 );
}
 
 
 
 
                                    -♦-