2.12 QuickWin

The QuickWin functions make it possible to compile non-Windows DOS programs as simple text-only Windows applications. DOS programs compiled with the /Mq compiler option have a limited Windows user interface, including a standard menu bar, standard online help (for the QuickWin features), and a client (or application) window with a child (document) window for the input/output streams stdin, stdout, and stderr. You can also add other child windows of your own. QuickWin applications support the Windows Clipboard, and you can use standard C and C++ functions to write to and read from a QuickWin application's windows, which behave as streams.

Unless you use the functions covered in this section, you do not need to alter your program's source code. However, by using these functions in your source, you can take advantage of enhanced capabilities in your QuickWin programs.

Note that there are some restrictions on the kinds of DOS programs that can be compiled with QuickWin. Programs that use graphics or that spawn processes cannot take advantage of QuickWin. For full details about QuickWin, see Chapter 8 of Programming Techniques (in the Microsoft C/C++ version 7.0 documentation set).

QuickWin programs cannot be run in real mode.

QuickWin uses Windows libraries and the QWIN.LIB library. QuickWin constants, structures, and functions are declared in the Windows version of IO.H and STDIO.H. The /Mq compiler option defines the _WINDOWS constant, declared in the Windows version of STDIO.H.

Routine Use

_fwopen Opens a new window stream
_wabout Sets the string that appears in the About dialog box
_wclose Closes a window's file handle
_wgetexit Gets a QuickWin program's current exit behavior setting
_wgetfocus Returns a file handle to the window with the input focus
_wgetscreenbuf Gets a window's current screen-buffer size
_wgetsize Gets a window's current size and position on the screen
_wmenuclick Chooses a menu command
_wopen Opens a window, returning a file handle to it
_wsetexit Sets the way a QuickWin program behaves when exit is called
_wsetfocus Makes a window the active window (sets its focus)
_wsetscreenbuf Sets a window's screen-buffer size
_wsetsize Sets a window's size and position on the screen
_wyield Yields processor time to Windows for queue servicing