In addition to the main default window, you can create other windows in your QuickWin program. These windows are called child windows. Child windows are useful for displaying different types of information. For example, you might have one window displaying a binary representation of a number while another window displays the same number in hexadecimal format. QuickWin child windows are like normal windows, except they can't be closed by the user.
Before you can create a child window, you need to supply information about the window. This is done with a window information structure as shown below.
struct _wopeninfo {
unsigned int _version;
const char __far * _title;
long _wbufsize;
};
Create a variable of type _wopeninfo and fill in the data fields.
_version
Windows version number. Use the constant _WINVER
_title
A pointer to a null-terminated string containing the window title.
_wbufsize
The size of the window screen buffer (in bytes). Defaults to 2048.
Use the _wopen function to open the window. This function is similar in operation to the fopen routine, but instead of returning a file handle, it returns a handle to the window. Use this handle in standard I/O routines to specify which window the input and output is directed to. (For more information, see Chapter 11, “Input and Output.”)
Pass the _wopen routine a pointer to the window information structure and an integer that sets the window as read, read/write, or write. The standard C input/output constants are used.
For example, the following line opens a child window.
inputWind = _wopen(&inputStruct, _O_RDWR);
If successful, the window is opened and the returned handle can be passed to standard C low level I/O routines (read, write, etc.) for screen input and output.