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.
AWCLOSE.C
                                             Up Contents Index Back
─────Run-Time Library───────────────────────────────────────────────────────
 
/* WCLOSE.C - Demonstrate closing QuickWin
 * windows with _wclose
 */
 
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
 
#define PERSISTFLAG   _WINNOPERSIST
#define OPENFLAGS     _O_RDWR
 
void main()
{
   int wfh;        /* File handle for window */
   int nRes;       /* Window write results */
   int wc;         /* Window closure results */
   struct _wopeninfo wininfo; /* Open information */
 
   /* Set up window open information */
   wininfo._version = _QWINVER;
   wininfo._title = "Window Closing";
   wininfo._wbufsize = _WINBUFDEF;
 
   /* Open a window with _wopen */
   wfh = _wopen( &wininfo, NULL, OPENFLAGS );
   if( wfh == -1 )
   {
       printf( "***ERROR: On _wopen\n" );
       exit( -1 );
   }
 
   /* Write in the window */
   nRes = _write ( wfh, "Windows Everywhere!\n", 20 );
 
   /* Close the window with _wclose */
   wc = _wclose( wfh, PERSISTFLAG );
 
   exit( 0 );
}
                                    -♦-