Sets the size and screen position of a QuickWin window.
#include <io.h>
int _wsetsize( int wfh, struct _wsizeinfo *wsize );
wfh | File handle to a QuickWin window | |
wsize | Pointer to a _wsizeinfo structure |
The _wsetsize function sets the size and position of a QuickWin window. 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).
The wsize argument points to a _wsizeinfo structure (declared in IO.H) containing the new size and position information. The structure contains a _type field that can have one of the following values:
Value | Meaning |
_WINSIZEMIN | Minimize the window |
_WINSIZEMAX | Maximize the window |
_WINSIZRESTORE | Restore a previously minimized window |
_WINSIZECHAR | Use character coordinates for the window size |
If the type is _WINSIZECHAR, you must supply the _x, _y, _h, and _w values in the remainder of the structure. They specify the upper-left corner and the height and width of the window (in characters).
If successful, _wsetsize returns 0. A return value of –1 indicates an error.
Standards:None
16-Bit:QWIN
32-Bit:None
_fwopen, _wabout, _wclose, _wgetexit, _wgetfocus, _wgetscreenbuf, _wgetsize, _wmenuclick, _wopen, _wsetexit, _wsetfocus, _wsetscreenbuf, _wyield
/* WSETSIZE.C - Demonstrate setting the
* size of a QuickWin window on the screen
*/
#include <io.h>
#include <stdio.h>
#define OPENFLAGS "w" /* Access permission */
#define PERSISTFLAG _WINPERSIST /* Keep on screen */
void main( void )
{
int nRes; /* Result */
FILE *wp; /* File pointer */
struct _wsizeinfo ws; /* Size information */
/* Open a window */
/* NULL arguments accept default characteristics */
wp = _fwopen( NULL, NULL, OPENFLAGS );
if( wp == NULL )
{
printf( "***ERROR:_fwopen\n" );
exit( -1 );
}
/* Minimize the window to an icon */
ws._version = _WINVER;
ws._type = _WINSIZEMIN;
nRes = _wsetsize( _fileno( wp ), &ws );
if( nRes == -1 )
{
printf( "***ERROR: _wsetsize\n" );
exit( -1 );
}
nRes = _wclose( _fileno( wp ), PERSISTFLAG );
exit( 0 );
}