◄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 ); } -♦-