Closing a Child Window

Once you finish using a document window, you usually close it. For windows opened with the _wopen function, you can call QuickWin's _wclose function. For windows opened with _fwopen, you can call the standard C fclose or _fcloseall functions. The _wclose function takes a second argument to specify whether the window should “persist” (remain on the screen) after closing. The persist parameter can have one of the following values: _WINNOPERSIST, which erases the window, or _WINPERSIST, which leaves the window on the screen. A “persistent” window of this kind no longer responds to input/output calls, but you can select and copy text from it, scroll through its text, and continue to use the menus. To illustrate, you might write a file to a window, then allow the user to examine the file's contents after the window is closed to further writing. For more information about how your windows behave at exit time, see the following section, “Keeping Windows on the Screen.”

If you leave the window on the screen, you can later send another _wclose to the same file handle to remove the window.

The following code demonstrates closing a window without leaving it on the screen:

result = _wclose( wfh, _WINNOPERSIST );