_wgetscreenbuf

Description

Gets a QuickWin window's current screen-buffer size.

#include <io.h>

long _wgetscreenbuf( int wfh );

wfh File handle to a QuickWin window  

Remarks

The _wgetscreenbuf function returns the size of a QuickWin window screen buffer. This routine is used only in QuickWin programs; it is not part of the Windows API. For full details about QuickWin, see Chapter 8 of Programming Techniques (in the Microsoft C/C++ version 7.0 documentation set).

Each QuickWin child window has a buffer in which the screen-display text for the window is stored. The buffer size determines how much text is retained and thus how much output can be viewed by scrolling back through the window.

By default, the screen-buffer size is 2,048 bytes, but this value can be changed. See _wsetscreenbuf.

Return Value

If successful, the _wgetscreenbuf function returns the current screen-buffer size (in bytes) or the value _WINBUFINF. (A value of _WINBUFINF signifies that the size of the screen buffer is unlimited.) A return value of –1 indicates an error.

Compatibility

Standards:None

16-Bit:QWIN

32-Bit:None

See Also

_fwopen, _wabout, _wclose, _wgetexit, _wgetfocus, _wgetsize, _wmenuclick, _wopen, _wsetexit, _wsetfocus, _wsetscreenbuf, _wsetsize, _wyield

Example

/* 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( void )

{

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 );

}