Using the Microsoft Developer Network Technical Library


Summer, 1993


FILE FORMAT: All of the technical articles are in the 
Windows Help file format.  Using the Windows Help file format 
allows us to easily deliver both graphics and text formatting in a 
file format that everyone can view.  All of the technical article 
files are compressed using PKZIP.  And as before, each sample 
code example is provided with all related files zipped together 
into a single packet.


FILE NAMING CONVENTION: Each file name uses its 
library section number to help identify it.  For example, a file 
named, "2-4.ZIP" means that it is: File 4 from Library 2.

Each library section has its own respective index file containing 
the complete abstracts for all the files in the particular library 
section along with their file names to help you locate files to 
download.  The index files use library section numbers to 
identify them.  For example, "2-IDX.ZIP" is the file containing 
the index for library section 2.  There is a master index in library 1
which is a concatination of all the other library index files.


HOW TO USE THE LIBRARY: 
1) View the names of each library section to determine your 
area(s) of interest.
2) Select the sections you are interested in and download the 
appropriate index file from those sections or browse the file
descriptions.
3) Read the abstracts in the index files to determine which 
articles or sample code examples you would like to download.  
Each index will contain the library section number and file name 
of all the files to help you locate items of interest.

LIBRARY STRUCTURE: Below is a brief description of each 
library section.  Please note that technical articles and sample 
code examples are in separate library sections.

Number	  Directory  Description
		  Name
========= =========  ====================================================
3.		  techsamp	 Technote Samples - Sample applications that
					 correspond to technical articles.

4.		  moresamp	 More Samples

5.		  sdksamp	 3.1 SDK Samples - Sample applications included in the
					 Windows 3.1 SDK.

6.		  unsup 	 Unsupported Tools

7.		  vxdsamp	 VxD-Lite Mini-DDK - Samples to help create
					 application VxDs

8.		  vbtech	 Technical articles on Visual Basic

9.		  dbtech	 Technical articles on Database topics

10. 	  wintech	 Windows Technotes - Technical articles dealing with
					 Windows applications, pen applications, and multimedia
					 applications.	Also "Dr. GUI," a Windows Q&A column.

11. 	  ctech 	 C/C++ Technotes - Technical articles dealing with C/C++,
					 VC++, PWB, and Quick/C for Windows.

12. 	  nettech	 Network Technotes - Technical articles dealing with
					 LANMan, Windows for workgroups, and SQL.

13. 	  wbtech	 WordBasic Technotes - Technical articles dealing with
					 WordBasic.

14. 	  32tech	 Win NT/Win32 Technotes - Technical articles dealing with
					 Windows NT and the Win32 API.

Microsoft Developer Network technical articles and samples can be found
on internet:

On ftp.uu.net[123.456.234.345] in the vendor\microsoft\developer-network directory.


New for Summer 93:
==================
What's new in MSDNLIB for the Summer '93 upload


Modified Samples

	techsamp\ - techsamp\ - Technote Samples:
	3-46.zip - CODEPEND Sample
	3-52.zip - ISCDROM Sample

New Sample Applications

	techsamp\ - Technote Samples:
    EZPRINT     3-59.zip
    FLICKER     3-60.zip
    SPRITES     3-61.zip
    RIPWATCH    3-62.zip
    MSGBLAST    3-63.zip
    SMALLCAP    3-64.zip
    VBCOBSQL    3-65.zip
    VBFILEIO    3-66.zip
    NETBONES    3-67.zip
    NETGO       3-68.zip
    SOUNDCLI    3-69.zip
    ITSYBITS    3-70.zip

	moresamp\ - More Samples
    GOODIES     4-63.zip
    DISPDIB     4-64.zip
    PMU         4-65.zip
    EDTINFO     4-66.zip        
    EIGEN       4-67.zip        
    FLIP        4-68.zip
    FRMSCROL    4-69.zip        
    JIGSAW      4-70.zip        
    KWIKZONE    4-71.zip        
    MKEGROUP    4-72.zip        
    NAMESORT    4-73.zip        
    SHUFFLE     4-74.zip        
    BNDBUF      4-75.zip        
    GUIGREP     4-76.zip        
    MASKBLT     4-77.zip        
    PATHS       4-78.zip        
    READWRIT    4-79.zip        
    UNINPUT     4-80.zip        
    WINNET      4-81.zip        
    WORLD       4-82.zip        
    CROSSTAB    4-83.zip        
    DDL         4-84.zip
    DDL2        4-85.zip 
    OUTPUTAS    4-86.zip        
    RMTDDL      4-87.zip        
    SQLPASS     4-88.zip        
    SQLPASS2    4-89.zip        
    XVTWIZ      4-90.zip        
 
    New Technical Articles

	vbtech\ - Visual Basic technotes
    CROSSREF    8-1.zip
    MIXED       8-2.zip
    MSGBLAST    8-3.zip
    VBCONVNS    8-4.zip
    VBDLL       8-5.zip

	dbtech\ - Database technotes
    GRIVER2     9-1.zip
    OLEDDE      9-2.zip
    STEVMUR1    9-3.zip

	wintech\ - Windows technotes
    HARDWAY     10-88.zip
    ITSYBITS    10-89.zip
    DLLSTRT1    10-90.zip
    DLLSTRT2    10-91.zip
    INSTDRVR    10-92.zip
    VDRIVERS    10-93.zip
    EZPRINT     10-94.zip
    FLICKER     10-95.zip
    SPRITES     10-96.zip
    PENDRVR     10-97.zip
    SINGACD     10-98.zip

	32tech\ - Windows NT and Win32 technotes
    HEAPMM      14-7.zip

	ctech\  - C/C++ Technotes
    CSETUP      11-64.zip

	nettech\ - Network Technotes
	TCPTECHB	 12-9.zip
	TCPTECHC	 12-10.zip
	NTDBLIB 	 12-12.zip
	NTODS		 12-13.zip
	OPENDATA	 12-14.zip
	SHOWPLAN	 12-15.zip
	WINDBASE	 12-16.zip
	BROWSE		 12-17.zip
	NETDDE		 12-18.zip
	NETSOUND	 12-19.zip
	VBSHARE 	 12-21.zip



=============================================================================

****
**** The BACK sample can be downloaded from the
**** file 3-1.zip in the techsamp directory
****

BACK: Demonstrates Building a Large-Model Application with
a DLL

Revised: March 1, 1993

BACK is a companion application for "The C/C++ Compiler
Learns New Tricks" technical article on the Microsoft(R)
Developer Network CD. BACK lists command-line options and
environment variables. The program can be built for MS-
DOS(R) or for Windows(TM). The MKDOS.BAT batch file builds
the MS-DOS version, and MKWIN.BAT builds the Windows
version. The Windows version of BACK sends output to the
debug monitor.

BACK calls the TRACE.DLL. The program demonstrates the
following new programming practices for building protected-
mode Windows version 3.1 applications with Microsoft C/C++
version 7.0:

>  Using main instead of WinMain.

>  Using large model.

>  Using malloc (_fmalloc).

>  Using the run-time version of LibMain.

>  Using the run-time version of WEP.

>  Using a simpler make file.

>  Compiling and linking from the command line.

BACK was built and tested under Microsoft Windows 3.1.

KEYWORDS: PR-CD2; CD3 (revised)

=============================================================================

****
**** The CALLB sample can be downloaded from the
**** file 3-2.zip in the techsamp directory
****

CALLB: Demonstrates Member Functions As Callbacks

CALLB demonstrates how to handle callbacks with C++ member
functions. It is a companion application for the technical
article, "Calling All Members: Member Functions as
Callbacks."

Microsoft(R) Windows(TM) version 3.1 has over 30 callback
functions that applications can use to enumerate objects,
hook into the hardware, and perform a variety of other
activities. The article explains why normal member
functions cannot be used as callback functions and gives
several techniques for handling callbacks. The article and
source code are targeted toward Microsoft C/C++ version
7.0, but the ideas presented apply to all C++ compilers,
including those by Borland and Zortech.

CALLB contains eight make files that create six
executables: MAKE1 creates CPROG1; MAKE2 generates a
compile-time error and does not create an executable;
MAKE3, MAKE4, MAKE5, and MAKE6 create CPROG3, CPROG4,
CPROG5, and CPROG6, respectively; and TMAKE creates
CTIMER. Please refer to "Calling All Members: Member
Functions as Callbacks" for more information.

NOTE:  Running CPROG1 generates a GP fault by design.

CALLB was built and tested under Microsoft Windows version
3.1.

KEYWORDS: PR-CD1; EnumObjects; EnumObjectsProc



=============================================================================

****
**** The CLSEXP sample can be downloaded from the
**** file 3-3.zip in the techsamp directory
****

CLSEXP: Demonstrates C++ Class Export Syntax

CLSEXP is a companion application for the "Exporting with
Class" technical article on the Microsoft(R) Developer
Network CD. CLSEXP shows a working example of the class
export syntax in C++, but performs no other useful
function.

CLSEXP implements a simple set of classes spread across an
.EXE and two .DLL files. The program uses the Microsoft
Foundation Class TRACE macro to display messages on the
debug monitor. To see the messages, follow these steps:

1.  Run Windows(TM) in debug mode.

2.  Compile and run the Microsoft Foundation Class TRACER
sample application (included on the Microsoft Developer
Network CD). This application turns on the flags that
allow MFC TRACE messages to appear on the debug screen.

3.  Use the DBWIN application (included on the Microsoft
Developer Network CD) to send the TRACE messages to the
appropriate device (for example, to a monochrome monitor,
COM2, or window).

CLSEXP was built and tested under Microsoft Windows 3.1
and Microsoft C/C++ version 7.0.

KEYWORDS: PR-CD2; AfxWinTerm; __export; __far

=============================================================================

****
**** The DYNATEST sample can be downloaded from the
**** file 3-40.zip in the techsamp directory
****

DynaTest: Shows How to Implement Dynamic Menus with
Microsoft Foundation Class Library 1.0

DynaTest is a companion application for the "Creating
Dynamic Menus with the Microsoft(R) Foundation Classes"
technical article on the Microsoft Developer Network CD.

DynaTest demonstrates how developers can use the Microsoft
Foundation Class version 1.0 library to implement
"dynamic" menus (menus that can be changed at run time).
The most common use of a dynamic menu is to customize an
application, for example, to provide menu items for
running specific macros or calling dynamic-link libraries
(DLLs).

DynaTest contains two new classes: CDynaMenuWnd and
CDynaMenu. A CDynaMenu object called aDynaMenu is embedded
in the CDynaMenuWnd class. Your application inherits from
CDynaMenuWnd instead of CFrameWnd. CDynaMenu is in charge
of maintaining the dynamic menus, adding menu items, and
associating functions with menu IDs.

DynaTest was built with Microsoft C/C++ version 7.0 and
MFC version 1.0. It was tested under Microsoft Windows(TM)
version 3.1.

KEYWORDS: CD3

=============================================================================

****
**** The NEWOPR sample can be downloaded from the
**** file 3-4.zip in the techsamp directory
****

NEWOPR: Demonstrates the C++ new Operator in Large Model

NEWOPR is a simple application that demonstrates some of
the issues presented in the "Allocating Memory the
Newfangled Way: The new Operator" technical article on the
Microsoft(R) Developer Network CD.

NEWOPR tries to allocate 128 blocks of memory, 1024 bytes
per block. When NEWOPR is compiled as a medium-model
program, it cannot allocate 128 blocks because it runs out
of memory in the default data segment. In fact, the
Microsoft Foundation Class library raises an exception
when the new operator fails, and NEWOPR handles this
exception gracefully.

When NEWOPR is compiled as a large-model program, it can
allocate all 128 blocks because the memory is allocated
from the global heap instead of the local heap.

The best way to use NEWOPR is to compile it medium model,
run it, and examine the heap with Heap Walker. Run NMAKE
with the CLEAN option, and then compile large model. Run
the large-model version, and re-examine the heap with Heap
Walker.

The following parameters control how NEWOPR gets built:

>  DEBUG=[0|1]: Setting of 1 enables debugging
information.

>  LARGE=[0|1]: Setting of 1 compiles NEWOPR as a large-
model program.

>  MINST=[0|1]: Setting of 1 compiles with /Gt and /Gx
options to allow multiple instances. LARGE must be set to
1.

>  CLEAN: Deletes .EXE, .RES, and .OBJ files.

Sample NMAKE command lines are shown below:

>  nmake:  Makes medium-model version.

>  nmake DEBUG=1:  Makes medium-model debug version.

>  nmake LARGE=1:  Makes large-model version.

>  nmake MINST=1:  Makes medium-model version. MINST is
ignored.

>  nmake LARGE=1 MINST=1:  Makes multi-instance, large-
model version. MFC large-model library must be compiled
with /Gx and /Gt for this to work.

>  nmake DEBUG=1 LARGE=1 MINST=1:  Same as above, but
enables debugging.

NewOpr was built and tested under Microsoft(R) Windows(TM)
version 3.1.

KEYWORDS: PR-CD2; LoadAccelTable; new operator

=============================================================================

****
**** The NUMEDIT sample can be downloaded from the
**** file 3-41.zip in the techsamp directory
****

NUMEDIT: Subclasses a Control Created by CWnd::Create or
CWnd::CreateEx

NUMEDIT is one of three sample applications (NUMEDIT,
NUMTEST2, and NUMTEST3) that show how to use the
Microsoft(R) Foundation classes to subclass an edit
control in a dialog box.

Subclassing allows you to customize a window (or control)
without re-implementing it. The subclassing method you use
depends on how the window (or control) was created:

>  by CWnd::Create or CWnd::CreateEx
>  by ::CreateWindow or ::CreateWindowEx
>  by WNDCLASS name with ::CreateWindow or
::CreateWindowEx

NUMEDIT demonstrates subclassing for the first method,
when the window or control is created using CWnd::Create
or CWnd::CreateEx. In this case, subclassing is automatic.

NUMEDIT is a companion sample for the "Subclassing Windows
Using the Microsoft Foundation Class Library" technical
article on the Microsoft Developer Network CD.

NUMEDIT was built with Microsoft C/C++ version 7.0 and the
Microsoft Foundation Class Library version 1.0. The sample
application was tested under Microsoft Windows version
3.1.

KEYWORDS: CD3

=============================================================================

****
**** The NUMTEST2 sample can be downloaded from the
**** file 3-42.zip in the techsamp directory
****

NUMTEST2: Subclasses a Control Created by ::CreateWindow
or ::CreateWindowEx

NUMTEST2 is one of three sample applications (NUMEDIT,
NUMTEST2, and NUMTEST3) that show how to use the
Microsoft(R) Foundation classes to subclass an edit
control in a dialog box.

Subclassing allows you to customize a window (or control)
without re-implementing it. The subclassing method you use
depends on how the window (or control) was created:

>  by CWnd::Create or CWnd::CreateEx
>  by ::CreateWindow or ::CreateWindowEx
>  by WNDCLASS name with ::CreateWindow or
::CreateWindowEx

NUMTEST2 demonstrates subclassing for the second method,
when the window or control is created using ::CreateWindow
or ::CreateWindowEx. In this case, the window or control
can be subclassed using the CWnd::SubclassWindow and
CWnd::SubclassDlgItem functions.

NUMTEST2 is a companion sample for the "Subclassing
Windows Using the Microsoft Foundation Class Library"
technical article on the Microsoft Developer Network CD.

NUMTEST2 was built with Microsoft C/C++ version 7.0 and
the Microsoft Foundation Class Library version 1.0. The
sample application was tested under Microsoft Windows
version 3.1.

KEYWORDS: CD3

=============================================================================

****
**** The NUMTEST3 sample can be downloaded from the
**** file 3-43.zip in the techsamp directory
****

NUMTEST3: Subclasses a Control Created by WNDCLASS Name

NUMTEST3 is one of three sample applications (NUMEDIT,
NUMTEST2, and NUMTEST3) that show how to use the
Microsoft(R) Foundation classes to subclass an edit
control in a dialog box.

Subclassing allows you to customize a window (or control)
without re-implementing it. The subclassing method you use
depends on how the window (or control) was created:

>  by CWnd::Create or CWnd::CreateEx
>  by ::CreateWindow or ::CreateWindowEx
>  by WNDCLASS name with ::CreateWindow or
::CreateWindowEx

NUMTEST3 demonstrates subclassing for the third method,
when the window or control is created by WNDCLASS name
with ::CreateWindow or ::CreateWindowEx.

NUMTEST3 is a companion sample for the "Subclassing
Windows Using the Microsoft Foundation Class Library"
technical article on the Microsoft Developer Network CD.

NUMTEST3 was built with Microsoft C/C++ version 7.0 and
the Microsoft Foundation Class Library version 1.0. The
sample application was tested under Microsoft Windows
version 3.1.

KEYWORDS: CD3

=============================================================================

****
**** The OWNER sample can be downloaded from the
**** file 3-5.zip in the techsamp directory
****

OWNER: Demonstrates the C++ new Operator in a DLL

The OWNER application and its dynamic-link library
(OWNERDLL.DLL) explore memory ownership issues and
demonstrate the use of the new operator.

OWNER is a companion application for the "Allocating
Memory the Newfangled Way: The new Operator" technical
article on the Microsoft Developer Network CD.

OWNER was built and tested under Microsoft(R) Windows(TM)
version 3.1.

KEYWORDS: PR-CD2; new operator; delete operator

=============================================================================

****
**** The SMART sample can be downloaded from the
**** file 3-6.zip in the techsamp directory
****

SMART ALLOC: Demonstrates _fmalloc and Microsoft(R)
Windows(TM)

Smart Alloc allows programmers to experiment using the
_fmalloc function in the Microsoft(R) Windows(TM)
operating system. It is a companion program for the
technical article "Allocating Memory the Old Fashioned
Way: _fmalloc and Applications for Windows."

With Smart Alloc and Heap Walker, programmers can
interactively explore the behavior of  _fmalloc, _ffree,
GlobalAlloc, GlobalFree, and _heapmin. They can allocate
memory either using GlobalAlloc or _fmalloc, or from a
DLL. They can determine when and how memory is allocated
easily, without recompiling.

The source code for Smart Alloc also demonstrates some
interesting features. Smart Alloc is a multiple-instance,
large-model application when compiled with Microsoft C/C++
version 7.0.  Another interesting feature of Smart Alloc
is that it includes a dynamic link library (DLL) that
intercepts all calls SMART.EXE makes to GlobalAlloc,
GlobalReAlloc, and GlobalFree.

Smart Alloc was built with Microsoft C/C++ version 7.0 and
tested under Microsoft Windows version 3.1.

KEYWORDS: PR-CD1; GlobalAlloc; GlobalFree; GlobalReAlloc;
GlobalAllocPtr; GlobalFreePtr; malloc; free; _fmalloc;
_heapmin; _ffree; large model; DLL;

=============================================================================

****
**** The STREAMER sample can be downloaded from the
**** file 3-44.zip in the techsamp directory
****

Streamer: Demonstrates How to Use C++ and Microsoft
Foundation Class Library 1.0 in a DLL

Streamer is a companion application for the "Windows
Streams" technical article on the Microsoft(R) Developer
Network CD.

Streamer demonstrates how to use C++ and Microsoft
Foundation Classes in a dynamic-link library (DLL), how to
export C interfaces to a DLL, and how to wrap C interfaces
with C++ in an application. The sample application
includes the wstreambuf class, which inherits from the
streambuf class and provides the minimum code necessary
for iostream reading and writing to a window.

Streamer consists of an application and a DLL. The
application has two main components:

>  The CMainWindow class that does the work for the
application.

>  The wstreambuf class that implements the streambuf
interface. wstreambuf is a C++ wrapper to the C interface
exported from the DLL.

The DLL has three main components:

>  The COutputWindow class that reads data from, and
writes data to, a window.

>  The exported C interface through which the wstreambuf
class communicates with the DLL.

>  The COwinDLL class that derives from CWinApp and
manages the DLL.

Streamer was built with Microsoft C/C++ version 7.0 and
MFC version 1.0. It was tested under Microsoft Windows(TM)
version 3.1.

KEYWORDS: CD3

=============================================================================

****
**** The ZUSAMMEN sample can be downloaded from the
**** file 3-7.zip in the techsamp directory
****

ZUSAMMEN: Illustrates the Use of the Microsoft(R) C
Compiler Options with Microsoft Windows(TM)

Zusammen, which means "together" in German, scrolls two
different windows simultaneously. To scroll, the user
selects the windows with the mouse and clicks Zusammen's
scroll bars. This makes it easy to compare data in two
different windows or applications.

Zusammen consists of a program generated by MAKEAPP (see
the MAKEAPP abstract) and a dynamic link library (DLL)
called Picker that selects the windows to be scrolled.

For more information on ZUSAMMEN, see the "Microsoft(R)
Windows(TM) and the C Compiler Options" technical article.

ZUSAMMEN was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: PR-CD1; LocalAlloc; LocalFree; SetScrollRange;
SetScrollPos

=============================================================================

****
**** The APPEXEC sample can be downloaded from the
**** file 3-8.zip in the techsamp directory
****

AppExec: Launches Windows(TM)-based Applications

AppExec demonstrates a technique for launching other
Microsoft(R) Windows-based applications. It implements a
method for browsing and tracking applications that are not
on the current Windows search path. AppExec does not
terminate until all launched applications have terminated.

AppExec is a companion sample for the "Launching Other
Windows-based Applications" technical article on the
Microsoft Developer Network CD.

AppExec was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: PR-CD2; SetWindowLong; GetWindowLong;
CallWindowProc; GetProfileString; WriteProfileString;
GetOpenFileName; _splitpath; _makepath

=============================================================================

****
**** The DDEEXEC sample can be downloaded from the
**** file 3-45.zip in the techsamp directory
****

DDEExec: DDE Execute Command Server

DDEExec is a dynamic data exchange (DDE) server that
supports an Execute command set. The commands allow DDE
client applications to draw pictures in the main window of
the server. The following sample client applications use
the DDEExec server and are included with this application:

>  EXEC is a Visual Basic(TM) version 2.0 application that
allows any Execute command to be sent to a given topic of
a DDE server. This sample client application tests the
basic command set of a DDE server and ensures that the
server reports command errors correctly.

>  BUNNY is a Visual Basic 2.0 application that uses the
server to draw a picture of a bunny rabbit.

>  WBUNNY.DOC is a Word for Windows(TM) document based on
the WBUNNY.DOT template that uses Word's embedded Basic
language to draw yet another bunny picture.

>  XLART.XLM is a sample Microsoft Excel macro sheet that
shows how you can use Microsoft Excel as a DDE client to
draw fascinatingly complex pictures.

DDEExec was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: PR-CD2; DdeInitialize; DdeUninitialize;
DdeCreateStringHandle; DdeFreeStringHandle;
DdeNameService; DdeCmpStringHandles; DdeAddData;
DdeCreateDataHandle; ExtTextOut

=============================================================================

****
**** The DDERECON sample can be downloaded from the
**** file 3-10.zip in the techsamp directory
****

DDERecon: DDE Client Demonstrating Hot Links

DDERecon demonstrates a technique for browsing dynamic
data exchange (DDE) servers. This technique may be used in
a dialog box to establish a hot link. A hot link is a
direct data feed from one application (a DDE server) to
another (a DDE client). The program also shows how to re-
establish a hot link when an application is restarted.

DDERecon uses System topic information to populate lists
in a dialog box. These lists are used to browse available
DDE servers and establish DDE links with them. DDERecon is
a companion application for the "DDE Hot Links" technical
article on the Microsoft(R) Developer Network CD. The
program is used with the StockSrv server to demonstrate
hot links.

DDERecon was built and tested under Microsoft Windows(TM)
version 3.1.

KEYWORDS: PR-CD2; DataConnect; DdeClientTransaction;
SetWindowPos; WinExec; HWND_TOPMOST

=============================================================================

****
**** The DDESERV sample can be downloaded from the
**** file 3-11.zip in the techsamp directory
****

DDEServ: Quick and Easy DDE Server

DDEServ shows how you can easily create a dynamic data
exchange (DDE) server that supports the System topic and
an Execute command set. You can build the server by using
the STDDDE.C module included in the sample.

DDEServ was built and tested under Microsoft(R)
Windows(TM) version 3.1.

KEYWORDS: PR-CD2

=============================================================================

****
**** The PMGRPAPI sample can be downloaded from the
**** file 3-12.zip in the techsamp directory
****

PMGRPAPI: DDE Command String Interface to Program Manager

The PMGRPAPI demonstrates dynamic data exchange (DDE) in a
dynamic-link library (DLL). It functions as a DDE client
application to interface with the Microsoft(R) Windows(TM)
Program Manager. The Program Manager supports a set of
commands that it receives through the DDE Execute
protocol. For a list of commands, see the Windows version
3.1 Software Development Kit (SDK) "Programmers Reference,
Volume 1: Overview," Part 3, Chapter 17, on the Microsoft
Developer Network CD.

PMGRPAPI was written specifically to interface with the
Windows Program Manager, but also works with the Norton
Desktop, which responds to the same set of DDE Execute
commands.

PMGRPAPI is a companion sample for the "Performing DDE
from a Dynamic-Link Library" technical article on the
Microsoft Developer Network CD.

PMGRPAPI was built and tested under Microsoft Windows 3.1.

KEYWORDS: PR-CD2; DdeConnect; DdeClientTransaction;
DdeCreateDataHandle; DdeCreateStringHandle; DdeDisconnect;
DdeFreeStringHandle; DdeInitialize; DdeUninitialize

=============================================================================

****
**** The STOCKSRV sample can be downloaded from the
**** file 3-13.zip in the techsamp directory
****

StockSrv: Demonstrates Hot Links Using DDE

StockSrv simulates a stock market price monitor. It
simulates data arriving at a communications port and
extracts share price information for a given list of
stocks. The application has a display window that shows
the prices as they change in real time.

StockSrv demonstrates several techniques in its
implementation of the price monitor:

>  Support for the System topic. StockSrv is a dynamic
data exchange (DDE) server application that implements
support for the System topic. It includes a code module
that illustrates the guidelines provided in the
"Supporting the DDE System Topic" technical article on the
Microsoft(R) Developer Network CD. You can get most of the
system support for your own application by simply
including the source code module from StockSrv.

>  Hot links. DDE provides a protocol through which
applications can exchange all kinds of data. DDE allows
applications to form "hot links" with DDE servers and
obtain data in real time. A hot link is a direct data feed
from one application (a DDE server) to another (a DDE
client). As the data changes at the server, the new
information is sent to the client for processing.

>  Sharing data with Microsoft Excel. StockSrv also
demonstrates how a server application can share data with
Microsoft Excel version 4.0. STOCK.XLW is a Microsoft
Excel workbook that establishes a hot link with StockSrv.
See the "Supporting the Clipboard, DDE, and OLE in
Applications" technical article on the Microsoft Developer
Network CD for more information.

StockSrv was built and tested under Microsoft Windows(TM)
version 3.1. STOCK.XLW was built and tested under
Microsoft Excel version 4.0.

KEYWORDS: PR-CD2; DdeAddData; DdeCmpStringHandles;
DdeCreateDataHandle; DdeCreateStringHandle;
DdeFreeStringHandle; DdeInitialize; DdeNameService;
DdeUninitialize; GlobalAlloc; GlobalFree; GlobalLock;
GlobalUnlock

=============================================================================

****
**** The EZPRINT sample can be downloaded from the
**** file 3-59.zip in the techsamp directory
****

EZPRINT: Prints Text, Rectangles, and Lines

EZPRINT, a framework for implementing more sophisticated
printing capabilities, demonstrates starting a print job,
printing various objects on the page, and ending the print
job.

Printing from applications written for the Microsoft(R)
Windows(TM) version 3.1 operating system can be trying at
times. EZPRINT provides three exported functions
(StartDocument, PrintObject, and EndDocument), and sample
dynamic-link library (DLL) code and Visual Basic(TM) code.
You can use the DLL as is or modify it to meet your needs.

EZPRINT is a companion sample application for the
"EZPRINT: No-Frills Printing in Visual Basic and C"
technical article on the Microsoft Developer Network CD.

EZPRINT was built and tested under Microsoft Windows
version 3.1 and Microsoft Visual Basic 1.0 and Visual
Basic 2.0.

KEYWORDS: CD4

=============================================================================

****
**** The FLICKER sample can be downloaded from the
**** file 3-60.zip in the techsamp directory
****

Flicker: Shows How to Update Screen Without Flickers

Flicker is a companion sample application for the "Flicker-
Free Displays Using an Off-Screen DC" technical article on
the Microsoft(R) Developer Network CD.

Many applications written for the Microsoft Windows(TM)
operating system maintain status information such as the
current time in a small control window that flickers very
annoyingly each time it's updated. All standard Windows
controls flicker if updated at frequent intervals. The
solution to this problem is to implement a simple control
and use an off-screen device context (DC) to construct the
image, which is then copied in total to the client area of
the control window. The net result is a control that can
be updated without causing any flicker.

Flicker has window procedures for two controls--one of
these flickers; the other one doesn't. The application
creates an instance of each of these controls and updates
the window text ten times every second to show how one
flickers and the other doesn't. Both controls support the
system text color, window background color, and the
WM_SETTEXT and WM_SETFONT messages.

Flicker was built and tested under Microsoft Windows
version 3.1 and the Microsoft C/C++ version 7.0 compiler.

KEYWORDS: CD4

Click to open or copy the Flicker project files.
89
tech\gdi\flicker

=============================================================================

****
**** The FONTUTIL sample can be downloaded from the
**** file 3-38.zip in the techsamp directory
****

FONTUTIL: Font-Handling Routines

FONTUTIL contains useful font-handling routines that make
it easier for an application to create and manipulate
fonts in Microsoft(R) Windows(TM) by taking care of most
of the tedious work.

The font utilities are primarily for applications that
need the relatively simplistic font model presented in the
ChooseFont common dialog box. ChooseFont deals with fonts
using four primary variables: typeface name, typeface
style, point size, and effects. ChooseFont also allows for
color selection, but the font-handling functions do not
currently support this feature.

The font-handling functions allow an application to create
and interrogate fonts in a manner that is consistent with
the ChooseFont model. For example, you can create a font
by using the ReallyCreateFont function and specifying the
typeface name, typeface style, and point size; you can
retrieve the typeface style of a font by using the
GetTextStyle function; and so on.

The font utility functions support Microsoft Windows
versions 3.0 and 3.1, and Windows NT(TM) version 3.1. You
can include the functions either in an application or in a
dynamic-link library (DLL).

FONTUTIL is a companion sample application for the "Font
Utilities--Some Handy-Dandy Font-Handling Functions"
technical article on the Microsoft Developer Network CD.

KEYWORDS: CD3

=============================================================================

****
**** The GLYPH sample can be downloaded from the
**** file 3-14.zip in the techsamp directory
****

GLYPH: Demonstrates TrueType(R) Font Engine Using
GetGlyphOutline

GLYPH is a companion application for the technical article
"Advanced TrueType: GetGlyphOutline." The program uses the
GetGlyphOutline function to illustrate the basic concepts
and mechanisms of the TrueType(R) font engine.

The Microsoft(R) Windows(TM) Software Development Kit
(SDK) contains information on GetGlyphOutline and the
TrueType engine.

GLYPH was built and tested under Microsoft Windows version
3.1.

KEYWORDS: PR-CD1; GGO_BITMAP; GGO_NATIVE; rotating;
scaling; shearing; transformation matrix

=============================================================================

****
**** The LAVA sample can be downloaded from the
**** file 3-15.zip in the techsamp directory
****

Lava: Demonstrates Palette Animation and Pop-up Menus

Lava simulates a lava flow by using animation.

Click the main program window to open a menu. If you
double-click the title bar, the client area and title bar
will take up the entire screen. This allows you to create
a full-screen image.

You can copy the image to the Clipboard, paste it into
Microsoft(R) Paintbrush(TM), and save it as a device-
independent bitmap (DIB). You can then load the image
(from Control Panel) as a desktop image. The palette
animation of the image continues (even on the desktop)
while the program is running. You can iconize the
application and keep the palette animation going.

MyPal is an interesting program to run during palette
animation; it displays the current physical palette from
Windows(TM).

The 64-bit square-root code is 80386-specific.Lava needs a
display driver that supports palettes in order to run.

KEYWORDS: PR-CD2; CreatePalette; SelectPalette;
RealizePalette; CreateSolidBrush; WinAssert; SetTimer;
BitBlt; CreateCompatibleDC; InvalidateRect; CyclePalette;
SetClipboardData; CloseClipboard; SetPaletteEntries;
PatBlt; SetDIBits; AnimatePalette; CreateBitmap

=============================================================================

****
**** The MERGEDIB sample can be downloaded from the
**** file 3-16.zip in the techsamp directory
****

MergeDIB: Merges a Primary DIB with a Secondary DIB

MergeDIB merges a primary device-independent bitmap (DIB)
(with any palette) and a secondary DIB (with a different
palette) into a single DIB (with a special palette).

The special DIB and palette combine the two images and
palettes so that when the palette is gradually cross-faded
(animated), the first and second DIB are partially
displayed. At complete fadeout, only one bitmap is
visible; at a 50-50 mix, both bitmaps are equally visible
(merged). Pixels are not dithered between the images, but
are mixed in the palettes.

In MergeDIB, the two DIBs must be the same size. You can
eliminate this limitation easily by using the DIB driver:
Create an artificial bitmap in the desired size with a
blank background (where "blank" is a chosen color), and
center or otherwise place the smaller image in the
background.

KEYWORDS: PR-CD2; CreatePalette; SelectPalette;
RealizePalette; GetDeviceCaps; GetSystemPaletteUse;
GetSystemPaletteEntries; GetStockObject;
CreateCompatibleDC; GetDIBits; PaletteSize; CreateBitmap;
CreateDIBitmap; CreateDibPalette; GetNearestPaletteIndex;
GetPaletteEntries; SetPaletteEntries; StretchBlt; BitBlt;
StretchDIBits; PatBlt; SetDIBitsToDevice

=============================================================================

****
**** The MULTIPAL sample can be downloaded from the
**** file 3-17.zip in the techsamp directory
****

MULTIPAL: Uses Multiple Palettes in a Single Application

MULTIPAL is a companion application for the technical
article, "Palette Awareness." The program supports
multiple palettes by selecting a dominant palette and
prioritizing the other palettes in the background. The
program prioritizes palettes when it handles and sends
palette messages.

MULTIPAL is a multiple document interface (MDI) extension
to the DIBIT sample program that accompanies the "Using
DIBs with Palettes" technical article. MULTIPAL allows you
to display multiple DIBs with multiple palettes and
handles palette messaging from both the system perspective
and the application perspective. The MDI skeleton is taken
from the BLANDMDI program that is included in the
Microsoft(R) Windows(TM) version 3.1 Software Development
Kit (SDK). MULTIPAL achieves device independence by using
palettes at all times, regardless of the type of device
being used.

To see the application in action, open several color-
intensive 8-bit device-independent bitmaps (DIBs) at the
same time and change the active DIB window. To see the
application's interaction with the rest of the system, run
another application that uses palettes (another instance
of MULTIPAL will do).

MULTIPAL was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: PR-CD1; SelectPalette; RealizePalette;
StretchDIBits; DIB



=============================================================================

****
**** The PALETTE sample can be downloaded from the
**** file 5-36.zip in the techsamp directory
****

Palette: Displays the State of the Palette

Palette is a simple Microsoft(R) Windows(TM)-based
application that shows the state of the system palette.
The application window can be resized and reshaped for a
more convenient view, and the display is maintained even
when the application is minimized. You can click the mouse
in the application window and drag it over the screen to
show the RGB value of any pixel.

Palette was built and tested under Microsoft Windows
version 3.1 and the Microsoft C/C++ verison 7.0 compiler.

KEYWORDS: CD4

=============================================================================

****
**** The SPRITES sample can be downloaded from the
**** file 3-61.zip in the techsamp directory
****

Sprites: Demonstrates Animation in a Windows-based
Application

Sprites is a companion sample application for the
"Animation in Windows" technical article on the
Microsoft(R) Developer Network CD. It demonstrates sprite
(cast-based) animation in a Microsoft Windows(TM)-based
application using device-independent bitmaps (DIBs) for
the images and the DIB driver (DIB.DRV) for the off-screen
image buffer.

The Sprites application uses a DIB for a background scene,
and allows you to load multiple sprites on top of the
background scene. Each sprite has x, y, and z coordinates,
optional x and y velocity, and a flag that indicates
whether it can be dragged by the mouse.

A background and a set of sprites can be combined into a
scene described in a simple INI file. You can load the
entire scene by choosing the Load Scene command from the
File menu.

The application updates the positions of all sprites that
have a non-zero velocity as fast as it can, using a
PeekMessage loop. Sprites that have the selectable
attribute set can be dragged with the mouse. Double-
clicking a sprite brings up a dialog box for setting
sprite attributes.

Sprites was built and tested under Microsoft Windows 3.1
and the Microsoft C/C++ version 7.0 compiler.

KEYWORDS: CD4

=============================================================================

****
**** The TRANSBLT sample can be downloaded from the
**** file 3-18.zip in the techsamp directory
****

TRANSBLT: Demonstrates Bitmaps with Transparency

TRANSBLT performs transparency and masking effects on
bitmaps. It is a companion application for the technical
article, "Bitmaps with Transparency."

TRANSBLT was built and tested under Microsoft(R)
Windows(TM) version 3.1.

KEYWORDS: PR-CD1; SetTextColor; SetBkColor; GetDeviceCaps;
BitBlt; SRCCOPY; SRCAND; SRCINVERT; SRCPAINT; mask;
opaque; pixels; ROP; raster operation; boolean

=============================================================================

****
**** The TRI sample can be downloaded from the
**** file 3-19.zip in the techsamp directory
****

TRI: Draws Triangles Using DIB or PatBlt

TRI draws triangles directly into device-independent
bitmap (DIB) memory or to the screen. When drawing to DIB
memory, it uses the DIB driver. When drawing to the
screen, it uses the graphics device interface (GDI) or
PatBlt, allowing you to time the difference through a menu
option. You can choose solid colors and/or null pen colors
for the triangles.

TRI includes 80286- or 80386-specific assembly-language
code to optimize drawing. TRI also uses custom resources.

TRI was built and tested under Microsoft(R) Windows(TM)
version 3.1.

KEYWORDS: PR-CD2; CreatePalette; SelectPalette;
RealizePalette; GetSystemPaletteUse; GetDeviceCaps;
GetSystemPaletteEntries; CreateCompatibleDC; GetDIBits;
CreateBitmap; CreateDIBitmap; GetPaletteEntries;
SetPaletteEntries; StretchBlt; BitBlt; StretchDIBits

=============================================================================

****
**** The TRIQ sample can be downloaded from the
**** file 3-20.zip in the techsamp directory
****

TRIQ: Draws Directly to DIB Memory or Screen

TRIQ draws triangles or boxes directly into device-
independent bitmap (DIB) memory or directly to the screen.
It draws through the graphics device interface (GDI) or
through PatBlt, allowing timing of the difference through
a menu option. The DIB driver is used when drawing to DIB
memory. A color menu option for the triangles or boxes
includes solid colors and/or null pen colors.

Assembler source code is included to optimize drawing by
using 80286 or 80386 specific code. TRIQ also uses custom
resources.

TRIQ was built and tested under Microsoft(R) Windows(TM)
version 3.1.

KEYWORDS: PR-CD1; CreateDIBitmap; CreatePalette;
GetDIBits; LocalAlloc; LocalFree; SelectPalette; Device
Independent Bitmap (DIB)

=============================================================================

****
**** The VDRIVERS sample can be downloaded from the
**** file 3-39.zip in the techsamp directory
****

VDRIVERS: Source Modules and Tools for Developing Video
Drivers

The VDRIVERS directory contains the following source
modules and tools for developing video drivers:

>  The DDTEST tool measures the frame rate that can be
achieved on your current driver.

>  The V7VGA driver code includes a module called
BBLT.ASM, which contains the basic BitBlt code. This
module invokes different pieces of code for different Blt
requirements. The code is well commented and worth looking
at.

>  The STRETCH.ASM module from the V7VGA driver sources
shows an example of 80386-specific coding.

>  RLD.ASM contains the routines for drawing RLE directly
to the screen or to a bitmap. This code attempts to
optimize the very common case where no clipping at all is
required by using special output functions for clipped and
non-clipped output. The palette translation table passed
down by the graphics device interface (GDI) is also
checked for the identity map; if found, this is also
optimized.

>  DISCREEN.ASM draws a device-independent bitmap (DIB)
directly to the display. This module contains the routines
for drawing a 1/4/8/24-bit uncompressed DIB directly to
the screen. It also supports OPAQUE or TRANSPARENT mode.

KEYWORDS: CD3

=============================================================================

****
**** The CODEPEND sample can be downloaded from the
**** file 3-46.zip in the techsamp directory
****

CODEPEND: Mechanics of Dynamic Linking

CODEPEND illustrates dependencies between dynamic-link
libraries (DLLs), load and termination sequencing, module
usage counts, and application-vs.-DLL instance handles.

CODEPEND is a companion sample for the "Mechanics of
Dynamic Linking" technical article on the Microsoft(R)
Developer Network CD.

CODEPEND was built and tested under Microsoft Windows(TM)
version 3.1  and Microsoft C/C++ version 7.0.

KEYWORDS: CD3

=============================================================================

****
**** The COUNTDOS sample can be downloaded from the
**** file 3-21.zip in the techsamp directory
****

CountDOS and SetFocus: Windows(TM) 3.1 TSR Samples

CountDOS and SetFocus demonstrate the support for
terminate-and-stay-resident (TSR) programs in Microsoft(R)
Windows version 3.1, as described in the "TSR Support in
Microsoft Windows Version 3.1" technical article on the
Microsoft Developer Network CD.

CountDOS is both a Windows-based application and a TSR.
The MS-DOS(R) entry point contains a Windows-aware TSR
that counts MS-DOS function calls, provides file deletion
confirmation, and launches a Windows-based application
when Windows starts up. The New Executable entry point
contains the Windows-based application that the TSR will
launch. Thus, CountDOS launches itself (in a Windows sort
of way).

Run COUNTDOS.EXE from MS-DOS before starting enhanced-mode
Windows. The program accepts the following command-line
parameters:

>  /r:  Resets internal statistics on how many MS-DOS
calls have been issued.

>  /d:  Enables/disables file deletion confirmation.

>  /u:  Uninstalls the TSR (if possible).

SetFocus is an MS-DOS application that uses the Windows
Interrupt 2Fh interface to set the focus to a specified
virtual machine (VM). To run SetFocus, type "setfocus x"
(where x is a decimal number) from an MS-DOS command
prompt inside Windows 3.1 enhanced mode, This command
switches the focus to virtual machine x.

CountDOS and SetFocus were built and tested under
Microsoft Windows version 3.1 enhanced mode.

KEYWORDS: PR-CD2; INT2FAPI; TSR_Exec_Cmd

=============================================================================

****
**** The PPDEBUG sample can be downloaded from the
**** file 3-47.zip in the techsamp directory
****

PPDEBUG: Sets and Clears the Bits on the Printer Port

PPDEBUG.ASM is an assembly language code module that
provides C-callable services to set and clear the bits on
the printer port.

PPDBG.INC is an assembly language include file that
provides macros to assembly language code modules.

These modules demonstrate the concepts discussed in the
"Use Your Printer Port to Measure System Timings"
technical article on the Microsoft(R) Developer Network
CD.

KEYWORDS: CD3

=============================================================================

****
**** The RIPWATCH sample can be downloaded from the
**** file 3-62.zip in the techsamp directory
****

Ripwatch: Traps System RIPs and Other Notification
Messages

Ripwatch uses the TOOLHELP dynamic-link library (DLL) to
trap system RIPs and other notification messages, and
displays them in a window.

When developing Microsoft(R) Windows(TM)-based
applications, you should always use the debugging version
of Windows. This special build of the system is
distributed with the Windows Software Development Kit
(SDK). It tests for invalid parameters to Windows function
calls and reports other problems such as failing to free
graphics device interface (GDI) objects when an
application exits. If you don't know about the debugging
version, you are not getting the most from your SDK; worse
still, you may be preparing to ship a potentially faulty
product.

The default action for reporting detected errors is to
send a message to a debug terminal connected to COM1. This
requires that you have a terminal attached to the port to
see these messages. This can be a waste of desktop space,
a source of annoying beeps,and may tie up an otherwise
useful communications port. The TOOLHELP.DLL included with
the Windows SDK allows you to hook these messages before
they reach the communications port. The Ripwatch sample
application displays the messages in a window. The display
includes a textual description of the RIP error code.
Ripwatch also allows you to copy the text to the
Clipboard, save it in a file, or print it.

There is a known problem when running Ripwatch with
Microsoft CodeView(R) for Windows. If you try to start
CodeView while Ripwatch is running, CodeView reports an
out-of-memory condition. If you try to start Ripwatch
after CodeView has been started, CodeView will usually GP
fault.

Ripwatch was built and tested under Microsoft Windows
version 3.1 and the Microsoft C/C++ version 7.0 compiler.

KEYWORDS: CD4

=============================================================================

****
**** The WINFLOAT sample can be downloaded from the
**** file 3-22.zip in the techsamp directory
****

WinFloat: Floating-Point Samples for Windows(TM)

WinFloat consists of five programs and libraries that
provide sample code and tools to explore the floating-
point mechanisms of Microsoft(R) Windows:

>  FLOATAPP.EXE:  Windows-based application used as a
shell for testing application and dynamic-link library
(DLL) floating-point issues. This application tests
floating-point speed, generates exceptions, installs
signal handler, masks and unmasks exceptions, and
communicates with WIN87EM.DLL. Some capabilities depend on
the math package chosen and/or the presence of a math
coprocessor.

>  FLOATDLL.DLL: Floating-point Windows DLL. FLOATDLL is a
subset of FLOATAPP, to which it dynamically links.
FLOATDLL can generate and handle floating-point
exceptions, and can be configured to install and maintain
its own signal handler or use the default (or application)
handler.

>  FLOATDOS.EXE:  Floating-point MS-DOS(R) application.
FLOATDOS is a subset of FLOATAPP that runs outside of
Windows (or in a "DOS box"), thus allowing you to compare
an MS-DOS application with a Windows-based application for
exception handling and (most importantly) calculation
speed.

>  HIDE87.COM:  MS-DOS terminate-and-stay-resident (TSR)
program that hides the 80x87 from Windows-based
applications. HIDE87 must be installed before you start
Windows so you can trick Windows into thinking there's no
math coprocessor.

>  SHOW87.EXE:  MS-DOS control program that disables the
HIDE87 TSR. SHOW87 provides a way to turn off HIDE87
without rebooting the machine. As with HIDE87, SHOW87 must
be executed before you start Windows so it can detect the
math coprocessor.

See the sample code and the "Floating Point in Windows"
technical article for descriptions of these programs,
their coding techniques, and the Windows floating point
architecture. For information on building these programs
and discussions of C version 6.0 versus C/C++ version 7.0
and emulator versus alternate math packages, see the make
file. Note that these sample have major limitations if
compiled with C 6.0.

WINFLOAT was built and tested under Microsoft Windows
version 3.1 using Microsoft Macro Assembler version 6.0
and Microsoft C/C++ version 7.0.

KEYWORDS: PR-CD2; floating point; speed; performance;
exception; signal handler; mask; interrupts; dll; tsr;
coprocessor; math; emulator; altmath; alternate math;
WIN87EM.DLL; WIN87EM.LIB; signal; setjmp; longjmp;
_fpreset; _FPInit; _FPTerm; GetWinFlags; WF_80x87; _fpmath

=============================================================================

****
**** The CSETUP sample can be downloaded from the
**** file 3-48.zip in the techsamp directory
****

CSETUP: Creates a Custom Setup Application

The CSETUP application includes everything you need to
create a dynamic-link library (DLL) for your custom dialog
boxes and a setup application. The make file builds the
dialog-box DLL first, then builds the setup application.
The sample runs as-is, creates a directory called BOGUS,
and copies text files to it. It then creates a group in
Program Manager and installs two items within the group.

CSETUP is a companion sample application for the "Writing
a Setup Application for Windows in C" technical article on
the Microsoft(R) Developer Network CD.

KEYWORDS: CD3

=============================================================================

****
**** The DIGITALV sample can be downloaded from the
**** file 3-49.zip in the techsamp directory
****

DIGITALV: Digital Video Command Set for MCI

The DIGITALV directory contains three files:

>  DIGITALV.RC: Table definition for the media control
interface (MCI) digital video command set.

>  DIGITALV.H: Include file for the MCI digital video
command set.

>  DIGITALV.MCI: Media control interface file.

These files accompany the "Digital Video Command Set for
the Media Control Interface" specification included on the
Microsoft(R) Developer Network CD. The specification
discusses the standard for the digital video device class
for MCI (DV MCI), and applies to hardware and software
manufacturers of digital video products as well as to
independent software vendors (ISVs) who create
applications using digital video products. The
specification was developed in collaboration with original
equipment manufacturers (OEMs) to ensure that it reflects
the inherent characteristics of digital video hardware.
The specification is not limited to a single
manufacturer's hardware; it is expected to be applicable
to a wide range of hardware implementations.

KEYWORDS: CD3

=============================================================================

****
**** The DSTOOLKI sample can be downloaded from the
**** file 3-50.zip in the techsamp directory
****

DSTOOLKI: Illustrates DoubleSpace CVF Format and Functions

The DSTOOLKI directory contains source code that
illustrates the DoubleSpace compressed volume file (CVF)
format and DoubleSpace functions.

The sample source files below accompany the "DoubleSpace
Compressed Volume File Overview" and "DoubleSpace System
API Specification" on the Microsoft(R) Developer Network
CD.

>  CVF.H: Define statements for CVF.

>  DRVINFO.C: Functions to identify drives in a
DoubleSpace system.

>  DRVINFO.H: Header for DRVINFO.C.

>  IOCTL.ASM: Functions to flush and flush/invalidate
DoubleSpace cache.

>  MAIN.C: DSDUMP.EXE sources; shows details of CVF
format.

>  MAKEFILE: Make file for DSDUMP.EXE.

>  TEST.C: Test for IsDoubleSpaceDrive function in
DRVINFO.C and DRVINFO.H.

The sample code was built with Microsoft C version 6.00A
and Microsoft Macro Assembler (MASM) version 5.10A.

KEYWORDS: CD3

=============================================================================

****
**** The W16APP sample can be downloaded from the
**** file 3-51.zip in the techsamp directory
****

W16APP: Demonstrates Generic 16-Bit Application for
Windows

W16APP is a sample 16-bit application for Microsoft(R)
Windows(TM) that provides the following basic
capabilities: File New, File Open, File Save, and File
Save As; basic Clipboard support; simple printing and
print setup; About box; and Help file.

KEYWORDS: CD3

=============================================================================

****
**** The DETECT sample can be downloaded from the
**** file 3-23.zip in the techsamp directory
****

Detect: Detects Multimedia Extensions

Detect is a Windows(TM) with Multimedia program that shows
how to write an application that can detect the presence
of multimedia extensions. The code that actually detects
the extensions resides in MMSYS.LIB. Refer to the MMSYS
sample for additional information.

KEYWORDS: PR-CD2; mmsystemGetVersion; MessageBeep;
FindResource; LoadResource; LockResource; UnlockResource;
FreeResource

=============================================================================

****
**** The ISCDROM sample can be downloaded from the
**** file 3-52.zip in the techsamp directory
****

ISCDROM: Demonstrates Testing if Drive is CD-ROM

ISCDROM is an assembly code fragment which demonstrates
how to determine if a drive is a CD-ROM drive.

ISCDROM is a companion source code fragment to the
technical article, "CD-ROM Design and Optimization."
Please reference this article for more information.

KEYWORDS: CD3;

=============================================================================

****
**** The JOYTOY sample can be downloaded from the
**** file 3-24.zip in the techsamp directory
****

JoyToy: Demonstrates Use of Joystick Services

JoyToy is a Windows(TM) with Multimedia application that
illustrates how to use the joystick services. When you run
JoyToy, it displays a cross-hair cursor. When you move the
joystick or the mouse, the cursor follows. When you press
a joystick button, JoyToy produces a sound and draws a
bullet-hole icon on the screen.

KEYWORDS: PR-CD2; GetCursorPos; SetCursorPos; DrawIcon;
MessageBeep; joySetCapture; joyReleaseCapture;
joyGetNumDevs; GetSystemMetrics; sndPlaySound

=============================================================================

****
**** The MMPF sample can be downloaded from the
**** file 3-25.zip in the techsamp directory
****

MMPF: Reads Multimedia Movie Player (MMP) Files

MMPF analyzes the MMP file format to supplement the
existing documentation on MMP.

KEYWORDS: PR-CD2; GlobalAlloc; GlobalFree; GetDlgItem;
SetDlgItemText

=============================================================================

****
**** The MMPLAY sample can be downloaded from the
**** file 3-26.zip in the techsamp directory
****

MMPlay: Demonstrates Multimedia Movie Player (MMP)

Revised: March 11, 1993

MMPlay is an application that uses Windows(TM) with
Multimedia. It illustrates how to use the Multimedia Movie
Player (MMP). MMPlay calls the MMP.DLL from the Multimedia
Development Kit. You can use MMPlay to play any movie
file. MMPlay shows how to:

>  Load and play a movie.

>  Manage the stage window.

>  Use single-step animation.

>  Use a frame-callback function to monitor script-channel
text to recognize break, goto, loop, and close commands.
The frame-callback source code is in the FRAMEHK.C
module.

The movie file included with this project, SAMPLE.MMM,
contains custom script commands that MMPlay recognizes.

MMPlay was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: PR-CD2; CD3 (revised); OemToAnsi; RemoveProp;
GetProp; SetProp; AnsiLower; GetAsyncKeyState;
mmpGoToFrame; mmpAnimate; mmStopAnimating; SetMenuStates;
mmpOpen; showMMPError; mmpSetMute; mmpSetRepeat; mmSetDC;
mmpFrameCallback; mmUpdate; mmpClose; mmpFreeFile;
mmpGetCurFrame; mmpError; mmpGetMovieInfo;
mmpGetPaletteHandle; EmptyClipboard; SetClipboardData;
CloseClipboard; CreatePalette; GetPrivateProfileString

=============================================================================

****
**** The MMSYS sample can be downloaded from the
**** file 3-27.zip in the techsamp directory
****

MMSYS: Demonstrates Multimedia Functions Without Using
Drivers

MMSYS creates a library that lets you use multimedia
functions without requiring drivers. This method of run-
time linking is portable and very useful.

You can build an application that is aware of the
multimedia functions in Microsoft(R) Windows(TM). This
application will run with full functionality in Windows
with Multimedia and can use its own functions instead of
essential multimedia functions in a standard Windows
environment. The MMIO functions in the code files are
"emulated" or "stubbed" to replace the MMIO functions from
MMSYSTEM.DLL. This allows an application to do resource
interchange file format (RIFF) file I/O seamlessly in a
standard Windows or Windows with Multimedia environment.

For more information, please see the README.TXT file.

KEYWORDS: PR-CD2; mmioRead; mmioSeek; mmioWrite

=============================================================================

****
**** The SINGACD sample can be downloaded from the
**** file 3-53.zip in the techsamp directory
****

SINGACD: Uses MCI to Synchronize a Windows-based
Application with CD Audio

The SINGACD sample application shows how to use the media
control interface (MCI) to synchronize an application with
CD audio in Microsoft(R) Windows(TM).

SINGACD displays a moving ball above the lyrics of a song.
The ball moves in time with the music and (ideally) stays
above the current word in the song. Achieving this
synchronization involves a two-part process: The first
part involves displaying the entire line of text at the
right time; the second part involves placing the ball over
the correct word in the line.

SINGACD has the following components:

>  The PLAYACD application is a very simple controller for
the MCI CD audio device.

>  The TIMEACD application is a tool for authoring lyric
files.

>  The SINGAWAV sample is a modified version of SINGACD
that opens and plays a specific wave file and lyric file.

KEYWORDS: CD3

=============================================================================

****
**** The SOUNDSRV sample can be downloaded from the
**** file 3-54.zip in the techsamp directory
****

SOUNDSRV: Demonstrates a Sound Server

The SOUNDSRV sample application is a dynamic data exchange
(DDE) server that can play WAVE files and built-in wave
resources. The sample was implemented with the code
discussed in the "Quick and Easy DDE Server" technical
article on the Microsoft(R) Developer Network CD.

The service name is "SOUNDSRV". Execute commands can be
sent to the "SOUND" topic. Here's the command set:

>  PlaySound <sound-name>

>  PlayResource <resource-name>

where <sound-name> is a placeholder for the name of a WAVE
file or the name of an entry in the [SOUNDS] section of
WIN.INI. You can use the same type of name that you would
pass to the sndPlaySound function.

<resource-name> can be one of the following:

>  GoodMorning

>  GoodAfternoon

>  GoodEvening

>  GoodNight

>  Sandwich

>  Rolls

>  Jolly

>  Cheerio

>  Wrong

>  Deleted

>  Formated

>  TallyHo

>  Whip

>  MoreTea

>  GoodShow

KEYWORDS: CD3

=============================================================================

****
**** The WAVECONV sample can be downloaded from the
**** file 3-28.zip in the techsamp directory
****

WaveConv: Reads and Writes RIFF and WAVE Files

WaveConv demonstrates how to read and write resource
interchange file format (RIFF) and waveform audio data
(WAVE) files. It also demonstrates conversion routines for
Microsoft(R) adaptive differential pulse code modulation
(ADPCM) algorithms in C.

You can use WaveConv to load, edit, and convert waveform
data from an industry standard RIFF WAVE file format. This
standard format developed by IBM and Microsoft is directly
supported by Windows(TM) and OS/2(R).

WaveConv demonstrates conversion to and from the Microsoft
ADPCM format. The DVI ADPCM format is being registered by
the IMA and will be added soon. WaveConv does not yet
support editing of DISP chunk information.

KEYWORDS: PR-CD2; mmioCreateChunk; mmioRead; mmioWrite;
mmioAscend; mmioStringToFOURCC; mmioFOURCC; mmioClose;
mmioOpen; mmioDescend; mmioSeek

=============================================================================

****
**** The PATRON sample can be downloaded from the
**** file 3-29.zip in the techsamp directory
****

PATRON: Loads and Saves Files Composed of Embedded and
Linked Objects

PATRON is a single-document application that simply allows
you to save and load files composed of embedded and linked
objects. Each object is contained within a separate child
window; this is the most convenient method for
demonstrating how to use the object linking and embedding
(OLE) application programming interface (API). Your OLE
application is likely to have other data structures for
items such as pictures and tables as well as methods for
dealing with their display and positioning. Patron does
not get that complicated because techniques for moving
objects in a document have no bearing on implementing an
OLE client.

PATRON is a companion application for the technical
article "OLE Client Implementation Guide." See the article
for additional information on how to use PATRON for
development purposes.

PATRON was built and tested under Microsoft(R) Windows(TM)
version 3.1.

KEYWORDS: PR-CD1; OleCreateFromClip; OleCreateFromFile;
OleDelete; OleQuerySize; OleRegisterClientDoc;
OleRenameClientDoc; OleSaveToStream

=============================================================================

****
**** The SCHMOO sample can be downloaded from the
**** file 3-3.zip in the techsamp directory
****

SCHMOO: Demonstrates OLE Server Protocol

SCHMOO is a sample object linking and embedding (OLE)
server and a single-document application that is capable
of running multiple instances. SCHMOO lets you edit, save,
and load a Schmoo figure consisting of dots connected with
lines. SCHMOO demonstrates the OLE server protocol and
serves as a model for discussions in the "OLE Server
Implementation Guide."

SCHMOO has a number of source files that isolate the OLE-
specific code, leaving only a few parts of mostly non-OLE
files touched by OLE. This isolation demonstrates how OLE
can simply sit on top of an existing application,
requiring few new files and minor additions to the
existing application code. For information on using
Schmoo, see the "OLE Server Implementation Guide."

SCHMOO was built and tested under Microsoft(R) Windows(TM)
version 3.1.

KEYWORDS: PR-CD1; FreeProcInstance; MakeProcInstance;
OleRegisterServerDoc; OleRenameServerDoc;
OleRevokeServerDoc; OleSavedServerDoc

=============================================================================

****
**** The MSGBLAST sample can be downloaded from the
**** file 3-63.zip in the techsamp directory
****

EX1: Uses Message Blaster Control to Process WM_MENUINIT
and WM_MENUSELECT Messages

EX1 is a companion sample application for the "Message
Blaster: Processing Messages in Visual Basic" technical
article on the Microsoft(R) Developer Network CD.

The Microsoft Visual Basic(TM) development environment is
not based on a message-driven programming model. Instead,
Visual Basic supports a predefined set of events for each
object (form or control) that you create. An application
written in Visual Basic cannot respond to messages from
Microsoft Windows(TM) that are not handled directly by a
Visual Basic event. The Message Blaster is a Visual Basic
control that addresses this restriction by allowing you to
catch and process Windows messages from Visual Basic.

You can use the Message Blaster control to process any
message from Windows except for WM_CREATE and WM_NCCREATE
messages. The EX1 sample application shows how you can
process WM_MENUINIT and WM_MENUSELECT messages, to change
status bar text as the user moves through menu items.

EX1 was built and tested under Microsoft Windows version
3.1 and Microsoft Visual Basic version 2.0.

KEYWORDS: CD4

=============================================================================

****
**** The SMALLCAP sample can be downloaded from the
**** file 3-64.zip in the techsamp directory
****

Smallcap: Uses Message Blaster Control to Process
Nonclient Messages

Smallcap is a sample application created by Randall Kern
and Jim Cash that accompanies the "Message Blaster:
Processing Messages in Visual Basic" technical article on
the Microsoft(R) Developer Network CD.

The Microsoft Visual Basic(TM) development environment is
not based on a message-driven programming model. Instead,
Visual Basic supports a predefined set of events for each
object (form or control) that you create. An application
written in Visual Basic cannot respond to messages from
Microsoft Windows(TM) that are not handled directly by a
Visual Basic event. The Message Blaster is a Visual Basic
control that addresses this restriction by allowing you to
catch and process Windows messages from Visual Basic.

You can use the Message Blaster control to process any
message from Windows except for WM_CREATE and WM_NCCREATE
messages. The Smallcap sample application shows how you
can process WM_NC* (nonclient) messages to create
captions.

Smallcap was built and tested under Microsoft Windows
version 3.1 and Microsoft Visual Basic version 2.0.

KEYWORDS: CD4

=============================================================================

****
**** The VBCOBSQL sample can be downloaded from the
**** file 3-65.zip in the techsamp directory
****

VBCOBSQL: Demonstrates a Mixed-Language (Visual Basic-
COBOL-ESQL) Application

You can use Microsoft(R) Visual Basic(TM), Microsoft
COBOL, and Microsoft SQL Server to build full-featured
client-server applications that use the strengths of each
product. Visual Basic creates the graphical user
interface. Subroutine calls are made in the Basic code to
COBOL dynamic-link libraries (DLLs). The COBOL DLL
contains Embedded SQL (ESQL) to request the necessary data
from the SQL Server. The COBOL DLL manipulates the
retrieved data as required, then passes the data back to
Visual Basic. In other words, Visual Basic is the
graphical front-end and COBOL DLL is the back-end of the
client application.

VBCOBSQL uses the PUBS database from the SQL Server
package. The demo makes several queries to the PUBS
database, such as Author Search and List Publications in a
Category. It also allows you to insert and delete authors
and add new publications to the database.

To build VBCOBSQL, you will need Visual Basic version 2.0
Professional Edition, Microsoft COBOL version 5.0 or Micro
Focus(R) COBOL version 3.0, and Embedded SQL Toolkit for
COBOL.

In Visual Basic, load the VBCOBDEM.MAK project and build
an .EXE file for the application. Before building the
COBOL DLL that accesses SQL Server, make sure that your
build environment is set up to build COBOL/SQL Server
applications. Set the LIB environment variable to include
the drive and path of the following files:

>  LCOBOLW.LIB (supplied with the COBOL compiler)

>  COBW.LIB (supplied with the COBOL compiler)

>  SQLAKW.LIB (supplied with Embedded SQL for COBOL)

>  W3DBLIB.DLL (supplied with Embedded SQL for COBOL)

You also need the object file, CBLWINA.OBJ, supplied with
the COBOL compiler. You must specify "Mixed Language
Support" when you install this file from the COBOL disks.

Next, edit the VBCOBSQL.DIR directives file to use your
own server, database, user ID, and password. There are two
ways to build the DLL:

>  Run COBC.BAT and COBL.BAT, in that order. The first
batch file compiles the DLL and the second links it.
VBCOBSQL.DLL will be created.

>  Build the DLL using Programmer's WorkBench (PWB). This
sample includes the VBCOBSQL.MAK make file to allow you to
build with PWB.

Make sure that this DLL is in your current directory or in
your PATH. For more information on building DLLs, see
"COBOL Programming for Windows," Chapter 2 (Building
Dynamic Link Libraries) included with Microsoft COBOL or
the Micro Focus(R) COBOL User's Guide.

Before running the demo, make sure that the following
files are in your current directory or in your PATH:

>  SQLAKW.DLL  (provided with Embedded SQL toolkit for
COBOL)

>  W3DBLIB.DLL (provided with Embedded SQL toolkit for
COBOL)

>  DBNMP3.DLL  (provided with Embedded SQL toolkit for
COBOL)

>  CBLWIN.DLL  (provided with the COBOL compiler)

>  CBLSSEG.DLL (provided with the COBOL compiler)

>  VBRUN200.DLL (provided with Visual Basic version 2.0)

To run the demo, run the executable file you created in
Visual Basic. You can also run the demo interactively in
Visual Basic. In the login screen, fill in the fields
required to log into the PUBS database. If the login is
successful, you will be in the demo. You can then select
SQL options from the menu to perform the search/update
operations. Use the Help menu items to get more
information on using the demo and building mixed-language
client-server applications.

VBCOBSQL is a companion application for the "Building
VB/COBOL/ESQL Mixed-Language Applications" technical
article on the Microsoft Developer Network CD.

KEYWORDS: CD4

=============================================================================

****
**** The VBFILEIO sample can be downloaded from the
**** file 3-66.zip in the techsamp directory
****

VBFILEIO: Demonstrates Visual Basic with Windows DLLs

VBFILEIO gives Microsoft(R) Visual Basic(TM) applications
access to C run-time stream input/output (I/O) functions.
The sample also demonstrates linking to a dynamic-link
library (DLL) function from Visual Basic and using Visual
Basic data types as parameters.

VBFILEIO is a companion sample application for the
"Extending Visual Basic with Microsoft Windows DLLs"
technical article on the Microsoft Developer Network CD.

VBFILEIO was created using Microsoft Visual Basic version
2.0 and Microsoft C/C++ version 7.0.

KEYWORDS: CD4

=============================================================================

****
**** The NETBONES sample can be downloaded from the
**** file 3-67.zip in the techsamp directory
****

VBSource and VBDest: Demonstrate DDE Communication Over a
Network

The VBSource and VBDest sample applications demonstrate
how applications can communicate over the network using
Network Dynamic Data Exchange (Network DDE). These sample
applications accompany the "Reach Out and Exchange: A
Network DDE Overview," "Browsing for Network Servers in C
and Visual Basic," and "Learning to Share: Network DDE
Shares and Visual Basic" technical articles on the
Microsoft(R) Developer Network CD.

VBSource and VBDest were built and tested under Microsoft
Windows(TM) version 3.1 and Microsoft Visual Basic(TM)
version 2.0.

KEYWORDS: CD4

=============================================================================

****
**** The NETGO sample can be downloaded from the
**** file 3-68.zip in the techsamp directory
****

Net Gomuku: Demonstrates Bidirectional DDE in Visual Basic

Net Gomuku is a companion sample application for four
technical articles on the Microsoft(R) Developer Network
CD: "Net Gomuku: Bidirectional DDE in Visual Basic,"
"Reach Out and Exchange: A Network DDE Overview,"
"Browsing for Network Servers in C and Visual Basic," and
"Learning to Share: Network DDE Shares and Visual Basic."

Net Gomuku (NETGO.EXE) simulates bidirectional dynamic
data exchange (DDE) between two Visual Basic(TM)
applications. Net Gomuku is a Visual Basic application
that uses the Microsoft Windows(TM) for Workgroups Network
DDE mechanism to allow two people on different computers
to play Gomuku with each other. Gomuku is like an extended
tic-tac-toe game played on a 15x15 grid; the first player
who gets five pieces in a row wins.

Net Gomuku was built and tested under Microsoft Windows
version 3.1 and Microsoft Visual Basic version 2.0.

KEYWORDS: CD4

=============================================================================

****
**** The SOUNDCLI sample can be downloaded from the
**** file 3-69.zip in the techsamp directory
****

SoundCli: Demonstrates DDE Client Over Network

SoundCli is a companion sample application for the
"Network DDE and Multimedia Combine to Let You Talk to
Your Peers" technical article on the Microsoft(R)
Developer Network CD. Two sample applications accompany
this article: SoundSrv, a Visual Basic(TM) application,
demonstrates the internal sounds of the server, and
SoundCli, a dynamic data exchange (DDE) client
application, enables a WAVE file or live sound to be sent
over a network via DDE to a remote machine running the
sound server.

The client application (SoundCli) allows you to open WAVE
files and play them on the local machine or on a remote
machine. It also allows you to send whatever sound input
is available on the local machine to the remote machine.
For example, if you have a microphone connected to the
machine running the client, you can talk live to the
remote machine running the server.

The SoundCli application was constructed using the W16APP
sample available on the Developer Network CD (Sample Code,
Technical Article Samples, Misc. Samples).

To play with the samples, you will need two machines
equipped with sound cards running Microsoft Windows(TM)
for Workgroups and connected to a network.

SoundCli was built and tested under Microsoft Windows
version 3.1 and Microsoft Visual Basic version 2.0.

KEYWORDS: CD4

=============================================================================

****
**** The DEBUGAPP sample can be downloaded from the
**** file 3-55.zip in the techsamp directory
****

DebugApp: High-Level Win32 Debugger

DebugApp is a high-level debugger that meets a number of
important requirements for the Microsoft(R) Win32(TM)
Application Programming Interface (API). It can debug
multiple applications simultaneously, controlling the
execution of each process being debugged and presenting
feedback on noteworthy events that occur in each process.
You can also use DebugApp to view the 2-GB heap space of
each process and learn how memory allocations are
organized. DebugApp stands on its own as a multiprocess
debugging application, but you can also use its source
code as the framework for a more elaborate custom
debugger.

DebugApp is a companion sample application for the "Win32
Debugging Application Programming Interface" technical
article on the Microsoft Developer Network CD.

DebugApp was built with the Microsoft Win32 Software
Development Kit (SDK) for Windows NT(TM) Beta Release
(March 1993). This sample application may be incompatible
with other releases of the Win32 SDK for Windows NT.

KEYWORDS: CD3

=============================================================================

****
**** The CTL3D sample can be downloaded from the
**** file 3-31.zip in the techsamp directory
****

CTL3D: Demonstrates Three-Dimensional Controls

CLT3D is a companion sample to the "Adding 3-D Effects to
Controls" technical article on the Microsoft(R) Developer
Network CD. CTL3D uses the CTL3D.DLL library to add 3-D
effects to all controls.

The 3-D effect gives the Windows(TM) interface a more
sophisticated appearance. It also gives the user a clearer
indication of which actions are taking place. A 3-D button
that looks pressed provides more information than a two-
dimensional (2-D) button that simply changes color.

Windows version 3.x uses 3-D for pushbuttons only; all
other standard controls are in 2-D. However, many
applications have started adopting 3-D for other controls
as well, so the complete 3-D look is now associated with
leading-edge applications and is quickly becoming a
standard. For example, Microsoft Excel version 4.0 uses 3-
D for all controls. The CTL3D library was created by the
Microsoft Excel development group and contains all of the
functionality required for 3-D controls.

Microsoft Excel CTL3D was built and tested under Microsoft
Windows 3.1, but will also run under Windows 3.0.

KEYWORDS: PR-CD2; SendMessage; ExtTextOut; SetTextColor;
OffsetRect; DrawText; IntersectClipRect;
GetTextExtentPoint; GetTextExtent; GetCurrentTask;
GetParent; GetDeviceCaps; GetSystemMetrics; GetClassInfo;
subclass; hook; GetSysColor

=============================================================================

****
**** The DDLIST sample can be downloaded from the
**** file 3-56.zip in the techsamp directory
****

DDLIST: Implements Controls Using Bitmaps from COMMDLG

DDLIST utilizes the unused bitmaps that are included in
the Microsoft(R) Windows(TM) version 3.1 Software
Development Kit (SDK) SAMPLES\COMMDLG directory for the
File Open and File Save dialog boxes. DDLIST implements
the drives combo box and the directory list box as an
interrelated pair in a dialog box, fully utilizing the
drive type and folder icons available with the Windows
SDK. All the bitmaps are loaded separately and maintained
in two global HBITMAP arrays. The code to draw the combo
box and list box items references these arrays.

DDLIST is a companion sample application for the "Rescue
of the COMMDLG Bitmaps" technical article on the Microsoft
Developer Network CD.

DDLIST was built and tested under Microsoft Windows
version 3.1 and Microsoft C/C++ version 7.0.

KEYWORDS: CD3

=============================================================================

****
**** The DIALOGS sample can be downloaded from the
**** file 3-32.zip in the techsamp directory
****

DIALOGS: Demonstrates the Use of Common Dialog Boxes

DIALOGS demonstrates various methods for creating common
dialog boxes through the ChooseColor, ChooseFont,
GetOpenFileName, GetSaveFileName, PrintDlg, FindText, and
ReplaceText functions. It is a companion application for
the "Using and Customizing Common Dialogs" technical
article on the Microsoft(R) Developer Network CD.

DIALOGS demonstrates:

>  Basic usage guidelines for most dialog boxes.

>  Customizing common dialog boxes with flags.

>  Customizing common dialog boxes with application-
specific templates.

>  Adding hook procedures for special processing.

>  Using a separate hidden pop-up window to make the
ChooseColor and ChooseFont dialogs modeless, a technique
that can be applied to the other dialog boxes as well.

The primary purpose of DIALOGS is to show how to call the
COMMDLG functions. For this reason, the File Open dialog
doesn't open any files, Find and Replace only display a
message box indicating what actions were performed, and
printing only sends a minimal amount of text to a printer.

You can use ChooseColor to change the background of the
window and ChooseFont to change the font for the  "Change
this font..." string in the client area of the main
window. Printing uses this font, but makes no attempt to
match point sizes.

So don't expect a lot of functionality. Sure, it would be
nice to have an example that loaded text files, printed
files, allowed full searching, changed fonts and colors,
and so on, but that detracts from the purpose of this
sample and clutters the source files with code that is
unrelated to the task at hand.

KEYWORDS: PR-CD2; MessageBox; ClientToScreen;
GetWindowRect; SetWindowPos; GetDlgItemInt; DialogBox;
CheckDlgButton; IsDlgButtonChecked; EndDialog;
GetOpenFileName; GetFileTitle; PrintDlg; ChooseFont;
GetSysColor; SetDialogItemText; CreateFontIndirect;
SendDlgItemMessage; Escape; IsDialogMessage; GetDlgItem

=============================================================================

****
**** The EDALIGN sample can be downloaded from the
**** file 3-33.zip in the techsamp directory
****

EDALIGN: Changes Justification Style of an Edit Control

EDALIGN is a companion application for the technical
article "Edit Controls." The program demonstrates a
technique for changing the justification of an edit
control. The client area displays two edit controls. You
can choose options from the Control 1 and Control 2 menus
to left-justify, right-justify, or center the text in the
two controls.

It is not possible to change the justification style of an
edit control dynamically. There are two techniques
commonly used to work around this restriction. The first
technique creates multiple edit controls (one for each
style the application needs) and switches between them as
required. The second technique creates a new edit control
with the desired style as needed and switches to the new
control. EDALIGN demonstrates the second technique. For
more information, see the technical article "Edit
Controls."

EDALIGN was built and tested under Microsoft(R)
Windows(TM) version 3.1.

KEYWORDS: PR-CD1; CreateWindowEx; LocalAlloc; LocalFree;
ScreenToClient

=============================================================================

****
**** The HIERLIST sample can be downloaded from the
**** file 3-57.zip in the techsamp directory
****

HierList: Displays Hierarchical List in Owner-Drawn List
Box

HierList implements a hierarchical list box that includes
icon bitmaps and connecting lines. It demonstrates what an
application must do to display the hierarchy and includes
some helper functions developed to make the process easier
for the application developer.

HierList is a companion sample application for the
"Displaying a Hierarchy in a List Box" technical article
on the Microsoft(R) Developer Network CD.

HierList was built and tested under Microsoft Windows(TM)
version 3.1. The sample also builds and runs under
Microsoft C/C++ version 7.0 and Visual C++ version 1.0.

KEYWORDS: CD3

=============================================================================

****
**** The ITSYBITS sample can be downloaded from the
**** file 3-70.zip in the techsamp directory
****

ItsyTest: Demonstrates Small Title Bars

ItsyTest is a companion sample application for the
"ItsyBitsy: Mini Title Bars for Windows" technical article
on the Microsoft(R) Developer Network CD.

In Microsoft Windows(TM), the standard size of a window's
title bar is based on the size of the current system font
and cannot be changed. Some applications (for example,
Microsoft Visual Basic(TM) and Microsoft Excel) have
toolboxes consisting of windows with smaller title bars.
ItsyTest demonstrates how you can use the itsybitsy
functions to implement small title bars in windows.

ItsyTest was built and tested under Microsoft Windows
version 3.1 and Microsoft Visual Basic version 2.0.

KEYWORDS: CD4

=============================================================================

****
**** The MINMAX sample can be downloaded from the
**** file 3-34.zip in the techsamp directory
****

MINMAX: Controls a Window's Minimum Size, Maximum Size,
and Position

MINMAX demonstrates the WM_GETMINMAXINFO message that
allows applications to control the mazimized size and
position, the maximum tracking size, and the minimum
tracking size of a window. For more information, see the
"WM_GETMINMAXINFO" technical article.

MINMAX was built and tested under Microsoft(R) Windows(TM)
version 3.1.

KEYWORDS: PR-CD1; CreateWindowEx; DefWindowProc;
GetCurrentTask

=============================================================================

****
**** The STATBAR sample can be downloaded from the
**** file 3-35.zip in the techsamp directory
****

STATBAR: Implements a 3-D Status Bar

STATBAR implements a 3-D status bar in the Microsoft(R)
Windows(TM) graphical environment.

A status bar is an area in a window that displays
information about the current state of the window or
application. The status bar can provide a variety of
information, including descriptions of menu items, current
keyboard-initiated modes such as NUM LOCK and CAPS LOCK,
and brief messages. For more information, see the
"Implementing a Status Bar" technical article.

STATBAR was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: PR-CD1; ExtTextOut; GetSystemMetrics;
GetTextMetrics; WM_PAINT

=============================================================================

****
**** The STYLES sample can be downloaded from the
**** file 3-36.zip in the techsamp directory
****

STYLES: Demonstrates How to Create a Window

The STYLES sample application creates a window using user-
selected dialog box options. STYLES illustrates how an
application can use Microsoft(R) Windows(TM) functions to
navigate the window structure and to control the style and
appearance of a window on the desktop. For more
information, see the "Window Hierarchy and Styles"
technical article.

STYLES was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: PR-CD1; CreateWindow; CreateWindowEx; ShowWindow

=============================================================================

****
**** The TOOLBAR sample can be downloaded from the
**** file 3-58.zip in the techsamp directory
****

TOOLBAR: Creates a Windows Toolbar

TOOLBAR builds a toolbar similar to the Microsoft(R)
Windows(TM) for Workgroups toolbar, which was implemented
through the COMMCTRL dynamic-link library (DLL).

A toolbar consists of a row of small, graphical buttons
usually placed across the top of a window. It gives the
user a fast and convenient alternative to using the
window's menu to perform operations. The menu provides a
more easily understood way to activate a function and
includes a keyboard interface to the function. A toolbar,
on the other hand, gives the experienced user a shortcut
to operations, and thus improves the usability of an
application.

TOOLBAR is a companion sample application for the
"Creating a Toolbar" technical article on the Microsoft
Developer Network CD.

TOOLBAR was built and tested under Microsoft Windows
version 3.1. The sample also builds and runs under
Microsoft C/C++ version 7.0 and Visual C++ version 1.0.

KEYWORDS: CD3

=============================================================================

****
**** The VLIST sample can be downloaded from the
**** file 3-37.zip in the techsamp directory
****

VLIST: Demonstrates a Virtual List Box

VLIST implements a single-selection, single-column virtual
list box capable of displaying millions of items. The
standard list box control in Microsoft(R) Windows(TM) can
contain a limited number of items. VLIST shows how to
implement list boxes that exceed this limitation.

VLIST is a companion sample for the "A Virtual List Box
Implementation with VLIST" technical article on the
Microsoft Developer Network CD. For a working example of
VLIST, see the Microsoft Developer Network CD--the topic
listing in the Index window was implemented with VLIST.

VLIST was built and tested under Microsoft Windows version
3.1.

KEYWORDS: PR-CD2; GetDesktopWindow; GetSystemMetrics;
DialogBox; LoadLibrary; GetDlgItem; PortMessage;
GetWindowWord; SendMessage

=============================================================================

****
**** The GOODIES sample can be downloaded from the
**** file 4-63.zip in the moresamp directory
****

GOODIES: Microsoft Access Samples and Tools

These goodies demonstrate what other developers have done
with Microsoft(R) Access databases. These tools have not
been tested, although some of them have been around for a
while. The Microsoft Access tools are not supported by
Microsoft Product Support Services (PSS) or on CompuServe;
please use these tools at your own risk.

The following tools and sample code are currently
available:

XVTWIZ is a CrosstabWizard that leads you through the
steps of creating a crosstab query.

Click to open or copy the CrosstabWizard files.
more\access\goodies\xvtwiz

CROSSTAB is an example crosstab report that uses clever
programming tricks.

Click to open or copy the crosstab report.
more\access\goodies\crosstab

The TOOLS directory contains a collection of development
tools for the Microsoft Access database developer,
including a color picker and a utility that allows users
to open a new macro directly from the properties sheet.

Click to open or copy the development tools.
more\access\goodies\tools

SQLPASS is a DLL that enables programmers in Microsoft
Access Basic to pass SQL commands directly to SQL backend
databases via ODBC.

Click to open or copy the DLL.
more\access\goodies\sqlpass

OUTPUTAS is an extension that allows you to save report
output of reports in text files, in a Microsoft Excel
spreadsheet, or in Microsoft Word document format.

Click to open or copy the extension files.
more\access\goodies\outputas

DEMOSPT is a dynamic-link library (DLL) that enables
programmers who use Microsoft Access Basic to pass
structured query language (SQL) commands directly to SQL
back-end databases via open database connectivity (ODBC).

Click to open or copy the DLL.
more\access\goodies\demospt

RMTDDL is a tool that provides remote data definition on
Microsoft SQL Server using SQLPASS.

Click to open or copy the remote data definition tool.
more\access\goodies\rmtddl

DDL is a DLL that enables programmers to create and modify
Microsoft Access tables, indexes, and relationships.

Click to open or copy the DLL.
more\access\goodies\ddl

The SECURITY directory contains a Microsoft Word for
Windows document that describes Microsoft Access security
in more depth than the manual.

Click to open or copy the document.
more\access\goodies\security



=============================================================================

****
**** The CDDEML sample can be downloaded from the
**** file 4-56.zip in the moresamp directory
****

CDDEML: Demonstrates using MFC with DDEML

CDDEML is a sample application written using the
Microsoft(R) Foundation Classes (MFC).

CDDEML contains two applications that demonstrate a DDEML
server and DDEML client in MFC applications. The sample
defines four new classes to help implement the DDEML
support.  These classes are: CDDEClient, CDDEClientConv,
CDDEServer, and CDDEServerConv.

The CDDEClient and CDDEServer classes encasulate the
functionality of a DDEML client or server. The
CDDEClientConv and CDDEServerConv encapsulate individual
conversations which are managed by the CDDEClient or
CDDEServer classes. The CDDEClient and CDDEServer classes
maintain a map of the current conversations acording to
the conversations handle. Using this map a the server or
client can look up any ongoing conversation based on its
handle.

These classes were designed to implement DDEML in a very
general way. As a result, these classes don't do very much
by themselves. They are designed to be reused in an
application by deriving from each of these classes.
Typically, an application will derive one class from
CDDEClient or CDDEServer. The derived class will contain
details such as what conversations are supported, and how
to handle callbacks that don't relate to a specific
conversation. Usually there is only one instance of this
class in an application.  An application may derive many
classes from CDDEClientConv or CDDEServerConv, depending
on how many different types of conversations the
application supports. These derived classes implement how
each conversion handles callbacks. They also may contain
buffers to store data from the
conversation, or pointers to other objects that they need
to comunicate with. The sample contains a client and
server application built using the classes mentioned
above.

One difficulty in writting DDEML classes, is how to handle
the DDEML callback function. In this sample, the DDEML
callback function is containted in the CDDEClient or
CDDEServer class.  The callback function first checks to
see if the transaction is for the client or server, or for
one of the conversations. If it is for the client or
server, then the callback function calls the member
function that handles that transaction.

If the transaction is for a conversation, the the callback
function looks up the pointer to the conversation object
using the handle of the conversation in the conversation
map. Then it calls the member function of the conversation
that handles that transaction. Therefore, by using these
classes, an application developer does not need to write a
DDEML callback function.

CDDEML requires Microsoft C/C++ version 7.0. It was built
and tested with Microsoft Windows(TM) version 3.1.

KEYWORDS: CD3; afx

=============================================================================

****
**** The MFCDIB sample can be downloaded from the
**** file 4-2.zip in the moresamp directory
****

MFCDIB: Defines a DIB Using MFC

MFCDIB is a Microsoft(R) Foundation Class (MFC) sample
that demonstrates a technique for implementing a CDIB
class. The CDIB class defines an object that represents a
device-independent bitmap (DIB). MFCDIB can load, save,
display, copy, paste, and serialize a CDIB object.

The CDIB class is derived from CObject. The CDIB class is
implemented by calling prewritten C routines from the
DIBUTIL.DLL library, which contains many high-level
functions for DIB manipulation.

MFCDIB requires Microsoft C/C++ version 7.0 and the
Microsoft Windows(TM) version 3.1 Software Development Kit
(SDK) libraries.

KEYWORDS: PR-CD2; afx

=============================================================================

****
**** The MODELESS sample can be downloaded from the
**** file 4-4.zip in the moresamp directory
****

MODELESS: Defines a Modeless Dialog Box Using MFC

MODELESS creates and displays a modeless dialog box by
deriving a class from CDialog. The main window object
contains a pointer to the modeless dialog object. When the
user selects the menu item to display the modeless dialog
box, MODELESS creates and displays the modeless dialog
object, and disables the menu item. When the user closes
the dialog box, MODELESS destroys the dialog box with
DestroyWindow and deletes its memory. A message posted to
the main window enables the menu item for displaying the
modeless dialog box.

MODELESS uses three classes inherited from CDialog,
CWinApp, and CFrameWnd.

KEYWORDS: PR-CD2; afx

=============================================================================

****
**** The SUBCLASS sample can be downloaded from the
**** file 4-4.zip in the moresamp directory
****

SUBCLASS: Subclasses an Edit Control Using MFC

SUBCLASS subclasses an edit control in a dialog box and
makes it accept either numbers or letters. SUBCLASS uses
five classes inherited from CEdit, CSubclassedEdit,
CModalDialog, CWinApp, and CFrameWnd.

SUBCLASS subclasses a window by replacing the window
procedure for that window with AfxWndProc, and attaching
the window to a CWnd object. MFC provides two functions to
subclass a window: SubclassWindow and SubclassDlgitem.
These functions store the old window procedure in the
location returned by GetSuperWndProcAddr.

To change the behavior of the target window, SUBCLASS
overloads the appropriate functions for the CWnd object.

You can change the behavior of a subclassed window by
subclassing it with a different CWnd object. Before
calling the subclassing function on that window, you must
first "unsubclass" the window. MFC does not provide a
function to unsubclass a window. You must call
::SetWindowLong to replace the AfxWndProc with the
original window procedure, then detach the CWnd object
from the target window.

SUBCLASS subclasses an edit control in a dialog box to
accept either numbers or letters. The CSubclassedEdit
class is derived from CEdit, and UnSubclass is declared as
its member function. Two additional classes
(CSubNumberEdit and CSubLetterEdit) are derived from
CSubclassedEdit to provide the two behaviors for the edit
control. The OnChar function is overloaded for both of
these classes.

The dialog-box class is derived from CModalDialog and has
two member data objects: SubNumberEdit and CSubLetterEdit.

KEYWORDS: PR-CD2; afx

=============================================================================

****
**** The BALLCLI sample can be downloaded from the
**** file 4-5.zip in the moresamp directory
****

BALLCLI: DDEML Client Demonstrates DDEML with Bouncing
Ball

Revised: November 25, 1992

BALLCLI is a companion program for the BALLSRV sample
application.

BALLSRV and BALLCLI demonstrate the basic concepts of the
dynamic data exchange management library (DDEML) protocol
and the correct method for implementing DDEML in an
application. Although DDEML is a new concept in
Microsoft(R) Windows(TM) version 3.1, a DDEML application
will run without problems in Windows version 3.0 if the
DDEML.DLL file is added to the Windows version 3.0
installation. An application that uses DDEML for DDE can
establish a conversation with an application using the
Windows version 3.0 DDE convention.

BALLSRV and BALLCLI demonstrate DDE by creating a ball and
bouncing it between the server application window and the
client application window. BALLSRV creates a purple ball
and bounces it into the BALLCLI window. BALLCLI creates a
green ball and bounces it into the BALLSRV window. In this
configuration, each application acts as the server for the
ball it creates and the client for the other ball.

BALLSRV acts as server when the purple ball reaches the
right edge of its window. At this point, BALLSRV advises
BALLCLI that the purple ball will bounce into its window.
(The applications assume that the BALLSRV window is always
on the left and the BALLCLI window is always on the
right.) Similarly, BALLCLI acts as server when the green
ball reaches the left edge of its window. At this point,
BALLCLI advises BALLSRV that the green ball will bounce
into its window. In each case, the application that
receives data acts as the client.

BALLCLI and BALLSRV also let the user change the speed at
which the ball bounces. The Speed option on the BALLSRV
window changes the speed of the purple ball, and the Speed
option on the BALLCLI window changes the speed of the
green ball. Whenever the user changes the speed of a ball,
the window containing the ball is notified through a DDEML
transaction. In the same manner, when the size of one
window changes, the size of the other window changes as
well.

BALLCLI was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: DdeClientTransaction; DdeConnect;
DdeCreateStringHandle; DdeDisconnect; DdeFreeStringHandle;
DdeInitialize; DdeNameService; DdePostAdvise;
DdeUninitialize; XTYP_ADVDATA; XTYP_ADVREQ; XTYP_ADVSTART;
XTYP_ADVSTOP; XTYP_CONNECT; XTYP_CONNECT_CONFIRM;
XTYP_DISCONNECT; AppendMenu; BitBlt; CheckMenuItem;
CreateCompatibleDC; DeleteObject; FindWindow;
GetDlgItemText; GetSystemMenu; GetWindowRect; LoadBitmap;
LoadIcon;LoadString;PatBlt;SelectObject;
SetDlgItemText;SetWindowPos;StretchBlt;
WM_GETMINMAXINFO;WM_MOVE; WM_QUERYDRAGICON; WM_SIZE;
WM_SYSCOMMAND; WM_TIMER;



=============================================================================

****
**** The BALLSRV sample can be downloaded from the
**** file 4-57.zip in the moresamp directory
****

BALLSRV: DDEML Server Demonstrates DDEML with Bouncing
Ball

Revised: November 25, 1992

BALLSRV is a companion program for the BALLCLI sample
application.

BALLSRV and BALLCLI demonstrate the basic concepts of the
dynamic data exchange management library (DDEML) protocol
and the correct method for implementing DDEML in an
application. Although DDEML is a new concept in
Microsoft(R) Windows(TM) version 3.1, a DDEML application
will run without problems in Windows version 3.0 if the
DDEML.DLL file is added to the Windows version 3.0
installation. An application that uses DDEML for DDE can
establish a conversation with an application using the
Windows version 3.0 DDE convention.

BALLSRV and BALLCLI demonstrate DDE by creating a ball and
bouncing it between the server application window and the
client application window. BALLSRV creates a purple ball
and bounces it into the BALLCLI window. BALLCLI creates a
green ball and bounces it into the BALLSRV window. In this
configuration, each application acts as the server for the
ball it creates and the client for the other ball.

BALLSRV acts as server when the purple ball reaches the
right edge of its window. At this point, BALLSRV advises
BALLCLI that the purple ball will bounce into its window.
(The applications assume that the BALLSRV window is always
on the left and the BALLCLI window is always on the
right.) Similarly, BALLCLI acts as server when the green
ball reaches the left edge of its window. At this point,
BALLCLI advises BALLSRV that the green ball will bounce
into its window. In each case, the application that
receives data acts as the client.

BALLCLI and BALLSRV also let the user change the speed at
which the ball bounces. The Speed option on the BALLSRV
window changes the speed of the purple ball, and the Speed
option on the BALLCLI window changes the speed of the
green ball. Whenever the user changes the speed of a ball,
the window containing the ball is notified through a DDEML
transaction. In the same manner, when the size of one
window changes, the size of the other window changes as
well.

BALLSRV was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: DdeClientTransaction; DdeConnect;
DdeCreateStringHandle; DdeDisconnect; DdeFreeStringHandle;
DdeInitialize; DdeNameService; DdePostAdvise;
DdeUninitialize; XTYP_ADVDATA; XTYP_ADVREQ; XTYP_ADVSTART;
XTYP_ADVSTOP; XTYP_CONNECT; XTYP_CONNECT_CONFIRM;
XTYP_DISCONNECT; AppendMenu; BitBlt; CheckMenuItem;
CreateCompatibleDC; DeleteObject; FindWindow;
GetDlgItemText; GetSystemMenu; GetWindowRect; LoadBitmap;
LoadIcon;LoadString;PatBlt;SelectObject;
SetDlgItemText;SetWindowPos;StretchBlt;
WM_GETMINMAXINFO;WM_MOVE; WM_QUERYDRAGICON; WM_SIZE;
WM_SYSCOMMAND; WM_TIMER;



=============================================================================

****
**** The CDDEML sample can be downloaded from the
**** file 4-56.zip in the moresamp directory
****

CDDEML: Shows How to Use Microsoft Foundation Classes with
DDEML

CDDEML is a sample application written using C/C++ version
7.0 and the Microsoft(R) Foundation Class Library version
1.0.

CDDEML contains two applications, CLIENT and SERVER. These
applications demonstrate a dynamic data exchange
management library (DDEML) client and a DDEML server in
Foundation class applications. The sample defines four new
classes to help implement DDEML support: CDDEClient,
CDDEClientConv, CDDEServer, and CDDEServerConv.

The CDDEClient and CDDEServer classes encapsulate the
functionality of a DDEML client and server. The
CDDEClientConv and CDDEServerConv classes encapsulate
individual conversations that CDDEClient and CDDEServer
handle. The CDDEClient and CDDEServer classes maintain a
map of current conversations. A server or client can use
this map to look up any ongoing conversation based on its
handle.

CDDEML builds a client application and a server
application using these four classes. The classes
implement DDEML in a general way, but don't do much else.
Typically, an application will derive one class from
CDDEClient or CDDEServer. The derived class will contain
details such as which conversations are supported and how
to handle callbacks that don't relate to a specific
conversation. Usually, an application will contain only
one instance of CDDEClient or CDDEServer, but may derive
multiple classes from CDDEClientConv or CDDEServerConv,
depending on the types of conversations the application
supports. The derived classes determine how each
conversation handles callbacks, and may also contain
buffers to store data from the conversations or pointers
to other objects that they need to communicate with.

One difficulty in writing DDEML classes is understanding
how to handle the DDEML callback function. In this sample,
the callback function is found in the CDDEClient or
CDDEServer class. The function first checks to see if the
transaction is for the client, for the server, or for a
conversation. If it is for the client or server, the
callback function calls the member function that handles
that transaction. If the transaction is for a
conversation, the callback function looks up the pointer
to the conversation object using the handle of the
conversation in the conversation map, and then calls the
member function of the conversation that handles that
transaction. Consequently, you do not need to write a
DDEML callback function if you use these classes.

CDDEML requires Microsoft C/C++ version 7.0. It was built
and tested with Microsoft Windows(TM) version 3.1.

KEYWORDS: CD4; afx

=============================================================================

****
**** The DMLCLT sample can be downloaded from the
**** file 4-7.zip in the moresamp directory
****

DMLCLT: Demonstrates Basic DDEML Client Communications

DMLCLT is a companion program for the DMLSRV sample
application. These two applications show basic dynamic
data exchange management library (DDEML) communications
between a server and a client. DMLCLT and DMLSRV
demonstrate connect, request, asynchronous, hot advise
loop, and warm advise loop transactions.

>  Connect: The client connects to the server to initiate
a conversation. DMLCLT uses the DdeConnect function to
start a general conversation (which deals with text and
bitmaps) and a SYSTEM conversation (which supports the
system topic).

>  Request: When the client needs information from the
server, it calls the DdeClientTransaction(...XTYP_REQUEST)
function. DMLCLT demonstrates several types of requests.

>  Asynchronous transaction: DMLCLT starts an asynchronous
transaction with the server to request information that
may not be ready at the time of the request. DMLCLT starts
this transaction when the user selects the Asynchronous
Transaction command from the Transactions menu. When the
server receives the request (as an XTYP_REQUEST
transaction), it prompts the user for the number of window
bitmaps the client should display and returns a data
handle containing the number from its callback function.
The DDEML sends the client a XTYP_XACT_COMPLETE to
indicate that the server has finished the transaction. The
client then displays the desired number of bitmaps. The
asynchronous transaction ensures that the transaction will
not time out before the user has a chance to close the
dialog box.

>  Hot Advise Loop: When a hot advise loop is established
between a client and a server, the server notifies the
client (through an XTYP_ADVDATA) each time data changes.
The notification includes a handle to the changed data.
When you choose the Change Bitmap command from the DMLSRV
window, the server notifies the client that the bitmap has
changed (this notification includes a handle to the
changed bitmap). The client then displays the bitmap in
its window.

>  Warm Advise Loop: When a warm advise loop is
established between a client and a server, the server
notifies the client that the specified data has changed,
but it does not send the client the changed data by
default. DMLCLT displays a message box asking the user if
the client window should be updated with the bitmap from
the server. If the user selects Yes, the client requests
the data containing the changed bitmap from the server
through the DdeClientTransaction(...XTYP_REQUEST)
function.

DMLCLT was built and tested under Microsoft(R) Windows(TM)
version 3.1.

=============================================================================

****
**** The DMLSRV sample can be downloaded from the
**** file 4-8.zip in the moresamp directory
****

DMLSRV: Demonstrates Basic DDEML Server Communications

DMLSRV is a companion program for the DMLCLT sample
application. These two applications show basic dynamic
data exchange management library (DDEML) communications
between a server and a client. DMLCLT and DMLSRV
demonstrate connect, request, asynchronous, hot advise
loop, and warm advise loop transactions.

>  Connect: The client connects to the server to initiate
a conversation. DMLCLT uses the DdeConnect function to
start a general conversation (which deals with text and
bitmaps) and a SYSTEM conversation (which supports the
system topic).

>  Request: When the client needs information from the
server, it calls the DdeClientTransaction(...XTYP_REQUEST)
function. DMLCLT demonstrates several types of requests.

>  Asynchronous transaction: DMLCLT starts an asynchronous
transaction with the server to request information that
may not be ready at the time of the request. DMLCLT starts
this transaction when the user selects the Asynchronous
Transaction command from the Transactions menu. When the
server receives the request (as an XTYP_REQUEST
transaction), it prompts the user for the number of window
bitmaps the client should display and returns a data
handle containing the number from its callback function.
The DDEML sends the client a XTYP_XACT_COMPLETE to
indicate that the server has finished the transaction. The
client then displays the desired number of bitmaps. The
asynchronous transaction ensures that the transaction will
not time out before the user has a chance to close the
dialog box.

>  Hot Advise Loop: When a hot advise loop is established
between a client and a server, the server notifies the
client (through an XTYP_ADVDATA) each time data changes.
The notification includes a handle to the changed data.
When you choose the Change Bitmap command from the DMLSRV
window, the server notifies the client that the bitmap has
changed (this notification includes a handle to the
changed bitmap). The client then displays the bitmap in
its window.

>  Warm Advise Loop: When a warm advise loop is
established between a client and a server, the server
notifies the client that the specified data has changed,
but it does not send the client the changed data by
default. DMLCLT displays a message box asking the user if
the client window should be updated with the bitmap from
the server. If the user selects Yes, the client requests
the data containing the changed bitmap from the server
through the DdeClientTransaction(...XTYP_REQUEST)
function.

DMLSRV was built and tested under Microsoft(R) Windows(TM)
version 3.1.

=============================================================================

****
**** The BMUTIL sample can be downloaded from the
**** file 4-9.zip in the moresamp directory
****

BMUTIL: Demonstrates Bitmap Manipulation Techniques

BMUTIL illustrates four bitmap manipulation techniques:

>  Creating a "grayed" or "disabled" bitmap from a color
bitmap

>  Changing a single color in a bitmap without affecting
other colors

>  Swapping two colors in a bitmap without affecting other
colors

>  Dithering a color bitmap to a monochrome bitmap

You can choose an option from the Process menu to change
colors, dither, or restore the bitmap.

BMUTIL uses functions from the DIBAPI library, which was
written by Microsoft(R) Developer Support. DIBAPI contains
routines that handle common device-independent bitmap
(DIB) operations, such as loading a .BMP file and
converting DIBs to device-dependent bitmaps (DDBs).

Since the intent of the sample is to demonstrate the four
bitmap manipulation techniques listed above rather than
the DIB techniques in the DIBAPI library, the library is
provided in binary form only. To view the DIBAPI.DLL
source code, see the WINCAP sample application on the
Microsoft Developer Network CD.

BMUTIL was built and tested under Microsoft Windows(TM)
version 3.1.

KEYWORDS: PR-CD2

=============================================================================

****
**** The DISPDIB sample can be downloaded from the
**** file 4-64.zip in the moresamp directory
****

DISPDIB: Displays a 256-Color DIB on Standard VGA

DISPDIB contains a dynamic-link library (DLL) with the
executable code for the DisplayDib function. The sample
application also includes a header file and an import
library file.

The DisplayDib function in Microsoft(R) Windows(TM)
version 3.1 displays a 256-color bitmap image on a
standard (16-color) VGA monitor. The function reduces the
display resolution to 320x200 or 320x240 and centers the
bitmap on the screen, clipping the image as necessary.

The DisplayDib function was first included in Microsoft
Windows with Multimedia Extensions version 1.0. It has
also been tested with, and is supported by, Windows
version 3.1.

The DISPDIB sample application is included in the
Microsoft Knowledge Base Software/Data Library. On the
Microsoft Developer Network CD, search for the numbers
prefixed with "S" and "Q" in the Keywords section below
for more information on this sample application.

DISPDIB was built and tested under Microsoft Windows
version 3.1 with Multimedia Extensions version 1.0 and
Microsoft C/C++ version 7.0.

KEYWORDS: CD4; S13375; Q82903

=============================================================================

****
**** The DRAGBMP sample can be downloaded from the
**** file 4-10.zip in the moresamp directory
****

DRAGBMP: Demonstrates Smooth Bitmap Dragging

DRAGBMP shows how to drag images smoothly on the screen.
This is achieved through the use of several bitmaps and a
series of BitBlt operations.

Before you can drag a bitmap, you must store the following
information:

1.  A bitmap of the desired image, such as the cards in
Solitaire or the domino used in this sample.

2.  A bitmap of what lies underneath the desired image.
This information is necessary to redraw the underlying
area when the image is dragged elsewhere.

3.  The current position of the image (you can also store
or retrieve the width and height of the image using
GetObject on the image's bitmap).

Once this information is stored, the image is ready to
drag. The user selects the image by clicking the left
mouse button when the mouse pointer is on the image, drags
the image by moving the mouse while the mouse button is
depressed, and ends the dragging by releasing the mouse
button.

In this sample, the image is a yellow domino. Choose Draw
Image! to draw the domino, then drag the domino using the
mouse. Hit-testing in WM_LBUTTONDOWN determines when the
domino is selected. Once selected, the dragging process
begins. On each WM_MOUSEMOVE, a new background bitmap is
created, the old background bitmap is restored, and the
domino is moved to its new location. The WM_LBUTTONUP
message ends the dragging process.

(x',y')
+------------------------- new position
|\                       |
| \(dx,dy)               |
|  \                     |
|   + . . . . . . . . . . . . . . . . . old position
|   .(x,y)               |            .
|   .                    |            .
|   .                    |            .
----.---------------------            .
.                                 .
.                                 .
. . . . . . . . . . . . . . . . . .


The basic steps to perform the bitmap dragging are as
follows:

1.  Calculate the delta x and delta y in the mouse
movement (dx,dy).

2.  BitBlt the screen at the new position onto a new
bitmap. This corresponds to a rectangle with origin at
(x',y') in the figure above, and becomes the new
background bitmap.

3.  Since the new background bitmap still contains part of
the domino's image starting at point (x,y) in the figure
above, BitBlt the old background bitmap to that point on
the new background bitmap, offsetting it by dx and dy. The
resulting bitmap contains the correct background for the
new position.

4.  BitBlt the domino's bitmap to the screen at its new
location: origin at point (x',y') in the figure above.

5.  The domino is now in the correct position on the
screen and we have a bitmap of what is underneath, but a
portion of the domino still appears at the lower right. To
erase this portion, first BitBlt the bitmap of the domino
onto the old background's bitmap, offsetting it by -dx and
-dy, and then BitBlt this modified old background bitmap
to the screen at point (x,y). This erases the old portion
of the domino without flashing.

6.  Dragging is now complete. Store the new background
bitmap and delete the old one.

The DRAG.C file contains the code for dragging and hit-
testing. The MAINWND.C file contains the code for
processing the mouse and paint messages.

DRAGBMP was built and tested under Microsoft(R)
Windows(TM) version 3.1.

KEYWORDS: PR-CD2

=============================================================================

****
**** The FADE sample can be downloaded from the
**** file 4-11.zip in the moresamp directory
****

FADE: Fades Bitmaps Using Palette Animation

FADE loads, generates, saves, and "fades" special device-
independent bitmaps (DIBs) built from two component DIBs.
The fading technique involves animating a palette matrix
built from the two component palettes. For more
information, see the README.TXT file.

The dual DIBs created by FADE are 8 bytes per pixel (bpp)
but the component DIBs must be 4 bpp. FADE automatically
converts monochrome DIBs to 4 bpp before building the
resultant DIB, but prompts you before converting higher-
resolution DIBs down to 4 bpp. (This conversion does not
include color analysis.)

FADE depends on the Microsoft(R) Windows(TM) palette and
will not run if the video display does not support
palettes. For example, FADE does not run on a standard VGA
display, but runs on most 256-color displays.

To see the application in action, open one of the .BM2
files included with FADE and manipulate the scroll bar and
animation settings. (Keep in mind that what you see has
nothing to do with BitBlt's.)

FADE was built and tested under Microsoft Windows version
3.1.

KEYWORDS: PR-CD2; ScreenToClient; MoveWindow;
CreatePalette; SelectPalette; RealizePalette;
CreateCompatibleDC; GetStockObject; AnimatePalette;
InflateRect; CreateSolidBrush; PatBlt; GetNearestColor;
GetSysColor; CreateDIMap; GetDIBits; CreateDIBPalette;
DIBToBitmap; _lread; _hread; _lclose; SetSystemPaletteUse

=============================================================================

****
**** The GDIRSRCS sample can be downloaded from the
**** file 4-58.zip in the moresamp directory
****

GDIRSRCS: Extracts Resources from Resource Files

GDIRSRCS demonstrates how to create icons, cursors, and
bitmaps from their respective resource files. It also
shows how to read a resource file and create other
resources from that information. For example, GDIRSRCS:

>  Reads a bitmap resource file and creates a bitmap,
icon, and cursor.

>  Reads a cursor resource file and creates a cursor,
bitmap, and icon.

>  Reads an icon resource file and creates an icon,
cursor, and bitmap.

Use the Open Resources and Convert Resources menus to read
and create bitmaps, cursors, and icons.

The device-independent bitmaps (DIBs) for icons and
cursors are assumed to be in Microsoft(R) Windows(TM)
version 3.0 format. The DIBs for bitmaps, however, can be
in Windows version 3.0 or in OS/2(R) format. GDIRSRCS
converts OS/2 DIBs into Windows version 3.0 DIBs before
processing the DIB.

GDIRSRCS was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: PR-CD2

=============================================================================

****
**** The GDIWATCH sample can be downloaded from the
**** file 4-13.zip in the moresamp directory
****

GDIWATCH: Uses Tool Helper Library to Walk Heap

GDIWATCH shows how to use the functions in the tool helper
library (TOOLHELP.DLL) to walk the graphics device
interface (GDI) and User local heaps.

The DLL exports a very primitive application programming
interface. It contains the following two functions:


void FAR PASCAL TakeSnapShot(HWND hWndParent, int
iHeapMarker);
void FAR PASCAL Compare(HWND hWndParent, int
iHeapMarker,
int iNewMessage);

Do not mismatch IDM_GDIHEAP and IDM_USERHEAP when using
TakeSnapShot and Compare; it will produce random garbage
data. All identifiers are defined in WATCHLIB.H.

GDIWATCH was built and tested under Microsoft(R)
Windows(TM) version 3.1.

KEYWORDS: PR-CD2; CreateFontIndirect; LocalFirst;
LocalNext; _fmemcpy; LocalLock; LocalUnlock

=============================================================================

****
**** The MAPMODE sample can be downloaded from the
**** file 4-14.zip in the moresamp directory
****

MapMode: Demonstrates Mapping Modes

MapMode lets you experiment with the mapping mode
attributes of a device context (DC). You can use the
controls in the Mapping Mode Settings dialog box to change
the mapping mode, window origin, window extents, viewport
origin, and viewport extents.

KEYWORDS: PR-CD2; modeless; LoadBitmap; SetBkColor;
SetMapMode; SetWindowOrg; SetViewportOrg; GetMMData;
DPtoLP; SetWindowExt; SetViewportExt

=============================================================================

****
**** The PRNCDLG sample can be downloaded from the
**** file 4-59.zip in the moresamp directory
****

PRNCDLG: Demonstrates Printing Functions and Common Dialog
Boxes

PRNCDLG shows how to use the new printing functions
available in Microsoft(R) Windows(TM) version 3.1:
SetAbortProc, StartDoc, EndDoc, StartPage, and EndPage.

The sample also demonstrates the use of the ChooseFont and
Print common dialog boxes provided by the common dialog
box dynamic-link library (COMMDLG.DLL). The user can
select a font and display a line of text on the screen
using that font, or print the line on a printer selected
through the Print common dialog box.

PRNCDLG is included in the Microsoft Knowledge Base
Software/Data Library. Please search on the numbers
prefixed with "S" and "Q" in the Keywords section below
for more information on this sample application.

PRNCDLG was built and tested under Microsoft Windows
version 3.1 and Microsoft C/C++ version 7.0.

KEYWORDS: CD3; S13293; Q81337

=============================================================================

****
**** The RLEAPP sample can be downloaded from the
**** file 4-15.zip in the moresamp directory
****

RLEAPP: Demonstrates Animations Using DIB RLE Format

RLEAPP loads, generates, plays and saves animations using
the device-independent bitmap (DIB) run-length encoding
(RLE) format for delta frames.

The RLE format is described in the following
documentation:

>  The Microsoft(R) Windows(TM) version 3.0 Software
Development Kit (SDK): "Reference--Volume 1," in the
section on the BITMAPINFOHEADER structure.

>  The Microsoft Windows version 3.1 SDK: "Programmer's
Reference, Volume 3: Messages, Structures, and Macros," in
the section on BITMAPINFOHEADER.

>  The Multimedia Development Kit (MDK): "Programmer's
Reference," in the "Windows 3.0 Bitmap Compression
Formats" section.

RLEAPP handles only 8-bits-per-pixel DIBS, although the
same technology applies to 4-bits-per-pixel DIBs (RLE,
delta frame, and so on).

RLEAPP source code includes many optimizations for 80386-
specific machines. This is a very useful way to increase
speed because the MPC specification calls for a machine
that uses a 80386 or higher processor, so in most cases,
the 80286 support can be left out.

RLEAPP is very dependent on the BitBlt function speed of
the video card and driver. In most cases, the video driver
is very slow doing BitBlt. Comments on speed should be
directed to the video card manufacturer, who is
responsible for this code. The speed to BitBlt a 160x120
256-color frame (with the same palette) is approximately
15 frames per second. The BitBlt speed for slow drivers or
cards is about 1 frame per second.

RLEAPP was built and tested under Microsoft Windows
version 3.1.



=============================================================================

****
**** The TTDMP sample can be downloaded from the
**** file 4-60.zip in the moresamp directory
****

TTDMP: Demonstrates TrueType Functions and Structures

TTDMP shows how to use the TrueType(R)
GetOutlineTextMetrics and GetRasterizerCaps functions
provided in Microsoft(R) Windows(TM) version 3.1, and
displays the contents of the OUTLINETEXTMETRIC,
TEXTMETRIC, PANOSE, and LOGFONT structures that describe a
TrueType font.

The sample also demonstrates the use of the ChooseFont and
Print common dialog boxes provided by the common dialog
box dynamic-link library (COMMDLG.DLL). The user can
select a font and display a line of text on the screen
using that font, or print the line on a printer selected
through the Print common dialog box.

TTDMP is included in the Microsoft Knowledge Base
Software/Data Library. Please search on the numbers
prefixed with "S" and "Q" in the Keywords section below
for more information on this sample application.

TTDMP was built and tested under Microsoft Windows version
3.1 and Microsoft C/C++ version 7.0.

KEYWORDS: CD3; S13382; Q82233

=============================================================================

****
**** The WINCAP sample can be downloaded from the
**** file 4-16.zip in the moresamp directory
****

WINCAP: Captures Screens Using DIB API

WINCAP demonstrates how to capture, save, and print the
entire screen, portions of the screen, or specific
windows. The program also defines routines that accomplish
common device-independent bitmap (DIB) functions; these
routines form the DIB application programming interface
(API). WINCAP uses the DIB API functions for most of the
screen capture, printing, and saving work. See the
DIBAPI.TXT file for a description of the DIB API
functions.

WINCAP illustrates the following techniques:

>  Capturing the screen (or a specific window) into a DIB

>  Capturing the screen to a device-dependent bitmap (DDB)

>  Printing a DIB using banding

>  Loading and saving a DIB to a disk file (.BMP file)

>  Converting between DIBs and DDBs

>  Displaying the captured screen DDB

All of these techniques call the DIB API. WINCAP includes
the source code for these functions. You can call these
functions easily from a different application by simply
compiling the enclosed DIBAPI.DLL, and linking with the
DIBAPI.LIB import library.

The preferred way to capture a screen in Microsoft(R)
Windows(TM) is to copy the screen pixels into a DIB, and
then to use this DIB in subsequent operations (for
example, to save the bitmap to a file or print the
bitmap).

If you do not use a DIB in the intermediate step, the
results of the screen print may be less than desirable. If
you use a DIB to hold the screen image, device-dependent
information is removed from the bitmap. This simplifies
the process of displaying the image on devices with
different display capabilities. For instance, capturing a
screen from a 24-bit display adapter and printing it on a
1-bit (monochrome) printer can produce exceptional results
if DIBs are used. Additionally, many printer drivers
implement gray-scale dithering; the output on these
printers is also excellent when DIBs are used.

NOTE:  Because bitmaps are device-dependent, you should
avoid the BitBlt function when printing bitmaps. The type
of bitmaps that the BitBlt function requires are normally
in the format of the display driver rather than the
printer driver. Depending on the drivers involved, the
results of using BitBlt to print a bitmap can vary from
extremely poor output quality to no output at all.

Although all printer drivers are able to BitBlt a
monochrome bitmap to the printer, this technique generally
produces poor results because the printer cannot apply
gray-scaling to the image.

This technique of using a DIB to convert a bitmap between
display devices with different capabilities can also be
used to convert bitmaps while preserving the original
color information (for example, loading a 256-color bitmap
from a .BMP file and printing it to a 3-color printer or
displaying it on a 24-bit display).

The file DIBAPI.TXT contains more information on function
parameters and usage. A Windows Help file for the DIB APIs
is also included.

WINCAP was built and tested under Microsoft Windows
version 3.1.



=============================================================================

****
**** The BACKGRND sample can be downloaded from the
**** file 4-18.zip in the moresamp directory
****

BACKGRND: Demonstrates Background Processing

BACKGRND uses a PeekMessage loop to do background
processing. The background task is to draw random
rectangles. BACKGRND draws one "batch" of rectangles with
each PeekMessage loop. The rectangles in each batch are
drawn in the same color, providing a visual indication of
how much background work is being done before BACKGRND
offers to yield. You can change both the "batch size" and
the total number of rectangles to be drawn through menu
options.

BACKGRND does not replace the main GetMessage loop with a
PeekMessage loop. Instead, it enters a PeekMessage loop
only when the user chooses the Draw! command.

For more information on BACKGRND, please see the module
and function headers in the source code.

BACKGRND was built and tested under Microsoft(R)
Windows(TM) version 3.1.

KEYWORDS: PR-CD2; GetClientRect; ClientToScreen;
ScreenToClient; SetFocus; SetRect; SetTextColor;
ExtTextOut; SetBkColor; LoadIcon; LoadCursor; Rectangle

=============================================================================

****
**** The MAKEAPP sample can be downloaded from the
**** file 4-19.zip in the moresamp directory
****

MAKEAPP: Generates a Microsoft Windows-based Application

MAKEAPP illustrates the use of the WINDOWS.H STRICT option
and provides examples of the following WINDOWSX.H
features: message crackers, control functions, and macro
functions.

You can run the MAKEAPP.BAT batch file to create a new
Windows(TM)-based application. MAKEAPP changes the names
of files, constants, and functions to names that you
specify and creates a clone of the MAKEAPP application
project. For more information, see the MAKEAPP.TXT and
WINDOWSX.TXT files.

MAKEAPP was built and tested under Microsoft(R) Windows
version 3.1.

=============================================================================

****
**** The PMU sample can be downloaded from the
**** file 4-65.zip in the moresamp directory
****

Project Manager Utilities (PMU): For Working with Projects

Project Manager Utilities(PMU) is a FoxPro(R) application
that provides the following utilities:

1.  Copy: Copies a project and, optionally, its
components.

2.  Pack: Packs each table-oriented component in a project
(that is, screens).

3.  Purge: Jettisons the object code stored in a project.

4.  Remove Platform: Removes given platforms from each
screen and report in a project.

5.  Revert: Reverts specified project components into
FoxPro 2.0 format.

6.  Transport: Activates the Transporter on each component
in a project.

7.  Statistics: Provides information on a project and its
components.

PMU was designed to run on any platform.

KEYWORDS: CD4

=============================================================================

****
**** The RESEXT sample can be downloaded from the
**** file 4-61.zip in the moresamp directory
****

RESEXT: Extracts Resources from .EXE and .LIB Files

RESEXT extracts information from an executable file
without requiring the application to be loaded. The
Microsoft(R) Windows(TM) Program Manager uses this
procedure when it extracts an icon from the .EXE file to
represent the application. An .EXE file or a dynamic-link
library (DLL) contains other resources and tables that may
be useful to certain applications. RESEXT demonstrates how
to extract and decode these resources for executable or
library files. (FONTS and DRVs qualify as DLLs.)

RESEXT uses the old and new header formats as documented
in "The MS-DOS(R) Encyclopedia," by Ray Duncan (Microsoft
Press, 1988). RESEXT loads these headers, the resource
table, and the icon, cursor, and bitmap resources found in
the resource table and lets you save the resources in
files.

For more information on file and resource formats, see
"The MS-DOS Encyclopedia" or "What's in There? Windows 3.0
Executable and Resource File Formats Revealed!" by Kevin
P. Welch (Microsoft Systems Journal, Vol. 6, No. 5).

RESEXT was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: CD3

=============================================================================

****
**** The SHOWGRP sample can be downloaded from the
**** file 4-20.zip in the moresamp directory
****

SHOWGRP: Reads Group Files

SHOWGRP demonstrates how to read group files. The group
file format is documented in the Microsoft(R) Windows(TM)
version 3.1 Software Development Kit (SDK) "Programmer's
Reference."

SHOWGRP was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: PR-CD2; LoadString; GetPrivateProfileString;
SetMapMode; DrawIcon

=============================================================================

****
**** The VERSTAMP sample can be downloaded from the
**** file 4-21.zip in the moresamp directory
****

VERSTAMP: Accesses the Version Information Resource for a
File

VERSTAMP demonstrates how to use the VER.DLL and VER.LIB
libraries, which provide version-stamping for Microsoft(R)
Windows(TM) and MS-DOS(R) executable files.

Use the Open command from the File menu to select a source
file and to display its file version information in the
main window. If the file does not have a version
information resource, VERSTAMP notifies you with a message
box. If the file has a version information resource, press
the More Info button in the main window to display the
information. If you press the Install File button,
VERSTAMP uses the VerFindFile function to determine where
the source file should be installed. If VerFindFile
returns an error, VERSTAMP displays a message box
prompting you to continue or to quit. If you choose to
continue, VERSTAMP proceeds with the installation,
captures the result of VerInstallFile, and displays it in
a message box.

VERSTAMP was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: GetFileVersionInfo; GetFileVersionInfoSize;
GetSystemDirectory; GetWindowsDirectory; VerLanguageName;
VerQueryValue

=============================================================================

****
**** The WINQUERY sample can be downloaded from the
**** file 4-22.zip in the moresamp directory
****

WINQUERY: Demonstrates SQL Server Query

WINQUERY demonstrates ad-hoc queries in Microsoft(R) SQL
Server. It multitasks to do background query processing
using a PeekMessage loop.

WINQUERY requires three SQL Server files to build, and two
SQL files to run. The three SQL Server include files come
with the SQL Server Programmer's Toolkit for C:
SQLFRONT.H, SQLDB.H, and W3DBLIB.LIB along with the two
SQL Server run-time files:W3DBLIB.DLL and DBNMP3.DLL.

WINQUERY was built and tested under Microsoft Windows(TM)
version 3.1 and SQL Server PTK for C version 4.2 A.

KEYWORDS: PR-CD2; GetStockObject; SendMessage; TextOut

=============================================================================

****
**** The XTENSION sample can be downloaded from the
**** file 4-23.zip in the moresamp directory
****

XTENSION: Extension DLL for File Manager

XTENSION is an extension dynamic-link library (DLL) that
adds administration support features such as file and disk
utilities to Microsoft(R) Windows(TM) File Manager.
XTENSION contains an entry point to process menu commands
and notification messages sent by File Manager and can
retrieve information about File Manager windows.

XTENSION adds a menu called Extension to File Manager and
processes all messages that File Manager sends to an
extension DLL. It also creates a status window using the
DLL's instance handle and adds the following commands to
the File Manager Extension menu:

>  Status Window: Shows/hides status window.

>  Selected File(s) Size: Displays disk space taken by the
files.

>  Selected Drive Info: Displays selected drive
information.

>  Focused Item Info: Displays the name of the selected
item.

>  Reload Extension: Reloads this extension.

>  Refresh Window: Refreshes File Manager's active window.

>  Refresh All Windows: Refreshes all File Manager
windows.

>  About Extension: Displays About dialog box.

To load XTENSION.DLL as a File Manager extension, add the
following lines to the WINFILE.INI initialization file:

[AddOns]
SDK Demo Extension=<path to XTENSION.DLL>

File Manager installs the extensions that have entries in
the [AddOns] section of WINFILE.INI. Each entry consists
of a tag and a value.

The File Manager extensions are new in Microsoft Windows
version 3.1. For information on relevant functions and
messages, see the Windows version 3.1 Software Development
Kit (SDK) "Programmer's Reference" manual.

XTENSION was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: FMExtensionProc; FM_GETFOCUS;
FM_REFRESH_WINDOWS; FMEVENT_INITMENU; FMEVENT_LOAD;
FMEVENT_SELCHANGE; FMEVENT_UNLOAD; FMEVENT_USER_REFRESH;
FMS_GETDRIVEINFO; FMS_GETFILESEL

=============================================================================

****
**** The BADAPP sample can be downloaded from the
**** file 4-24.zip in the moresamp directory
****

BADAPP: Demonstrates "Bad Application" Handling

BADAPP is an application designed for Microsoft(R)
Windows(TM) versions 3.0 and 3.1 that can generate a GP
fault and hang after receiving input. Its purpose is to
demonstrate how Windows version 3.1 handles "bad
applications."

WARNING:  Before running BADAPP, save your work and close
all other applications to avoid any problems that the GP
fault or hang may cause.

When you choose GP-Fault or Hang from the Action menu, the
"fuse" in the display area burns down before the GP fault
occurs. If you have a multimedia system, the burning fuse
will be accompanied by sound effects. You can choose
Options from the Action menu to disable the sound, to
modify the zoom factor, and to change the visible
application title (limited to eight characters).

BADAPP was built with Microsoft QuickC(R) version 1.0. The
fuse icons were created using the IconWorks sample
application from Visual Basic(TM) version 1.0. ICO2BMP.EXE
was used to convert the FUSE*.ICO and BOOM*.ICO files to
FUSE*.BMP and BOOM*.BMP files.

BADAPP was built and tested under Microsoft Windows
version 3.1.



=============================================================================

****
**** The DLLFLOAT sample can be downloaded from the
**** file 4-25.zip in the moresamp directory
****

DLLFLOAT: Converts Floating Points to Character Strings

DLLFLOAT demonstrates a function in a dynamic-link library
(DLL) for converting a floating-point number to a
character string. It displays eight floating-point numbers
and eight conversions.

DLLFLOAT was built and tested under Microsoft(R)
Windows(TM) version 3.1.

KEYWORDS: PR-CD2

=============================================================================

****
**** The DLLSKEL sample can be downloaded from the
**** file 4-26.zip in the moresamp directory
****

DLLSKEL: Demonstrates Medium-Model DLL

DLLSKEL shows how to create a medium-model dynamic-link
library (DLL) and how to load it implicitly. The program
demonstrates C and Pascal calling conventions.

DLLSKEL was built and tested under Microsoft(R)
Windows(TM) version 3.1.

KEYWORDS: PR-CD2

=============================================================================

****
**** The FAULT sample can be downloaded from the
**** file 4-27.zip in the moresamp directory
****

FAULT: Demonstrates Exception and Fault Trapping

FAULT demonstrates a method for trapping divide-by-zero
exceptions and general protection (GP) faults in a retail
application. It also shows how to recover from these
problems using the Catch and Throw functions in
Microsoft(R) Windows(TM). Instead of forcing the user to
terminate, the application can quietly recover from the
problem and fail the operation, if at all possible. FAULT
is a companion program for the "Bulletproof Functions With
ToolHelper" technical article on the Microsoft Developer
Network CD.

The ability to trap exceptions gives an application
considerable power and responsibility. ToolHelper lets you
trap all exceptions, including Interrupt 3 (debug
breakpoints) and the CTRL+ALT+SYSRQ key sequence. Some
exception-handling techniques (for example, debugging
interrupts) should never be used in a retail product.
However, these techniques let you perform minor cleanup,
error logging, and similar tasks without user intervention
and without terminating the application in the debugging
version of your application.

FAULT was built and tested under Microsoft Windows version
3.1.

KEYWORDS: PR-CD2; InterruptRegister; InterruptUnRegister;
asm; assembler

=============================================================================

****
**** The ISHANDLE sample can be downloaded from the
**** file 4-28.zip in the moresamp directory
****

HANDLE and ISHANDLE: Validate Global and Local Handles

This sample consists of two components:

>  ISHANDLE.DLL is a dynamic-link library (DLL) that
exports two functions, IsGlobalHandle and IsLocalHandle,
which validate global and local handles.

>  HANDLE.EXE is an application that tests these two
functions by linking into the DLL.

The IsLocalHandle and IsGlobalHandle functions in
ISHANDLE.DLL use a set of functions from TOOLHELP.DLL to
validate the given local or global handle. IsLocalHandle
uses the LocalFirst and LocalNext functions to walk the
local heap until the desired local handle is found.
Similarly, IsGlobalFunction uses the GlobalFirst and
GlobalNext functions to walk the global heap until the
desired global handle is found.

HANDLE demonstrates the IsLocalHandle and IsGlobalHandle
functions by passing good and bad handles to these
functions.

The following code shows how IsLocalHandle walks the local
heap and validates the given local handle, hLocalHandle.


/* Declare local variables. */
LOCALENTRY LEntry;

/* Allocate a buffer to do the local heap walk. */
bFound = FALSE;
LEntry.dwSize = sizeof(LOCALENTRY);

/* Loop through the local heap until hLocalHandle is
found. */
if (LocalFirst(&LEntry, wHeap))
{
do
{
if (LEntry.hHandle == hLocalHandle)
{
bFound = TRUE;
break;
}
} while (LocalNext(&LEntry));
}

if (bFound)
return hLocalHandle;
else
return NULL;

You can adopt this idea to walk the local/global heap and
obtain/store more information on a block of memory from
the LOCALENTRY and GLOBALENTRY structures. For example,
you can build a dynamic list that maintains information
about the heaps, or use the DLL to simulate the
functionality of the TOOLHELP ModuleFindHandle and
TaskFindHandle functions.

HANDLE requires Microsoft(R) Windows(TM) version 3.1 to
build, but has been compiled for 3.1 and 3.0
compatibility. TOOLHELP.DLL was not shipped with Windows
3.0; you must copy this library to the \WINDOWS\SYSTEM
directory to run HANDLE under 3.0.

KEYWORDS: PR-CD2

=============================================================================

****
**** The MULTAPP sample can be downloaded from the
**** file 4-29.zip in the moresamp directory
****

MULTAPP: Multi-Instance DLL with Separate Data

MULTAPP creates a multi-instance dynamic-link library
(DLL) that maintains separate data for each task that
links to it. A task is identified by the value of its
stack segment (SS). Data for each task is stored in a
block of memory obtained through GlobalAlloc. When a task
calls a function in the DLL, the DLL looks up the task in
its list and gets the segment (selector) of the global
memory block that contains the data for that task. The
segment address is then placed into the DS register. After
this point, all static data and the local heap are
specific to the task that called the DLL.

MULTAPP provides menu options for entering data into the
DLL's data segment, retrieving data from the DLL's data
segment, and filling the local heap with data items.

The first time a task calls into the DLL, a new block of
memory is allocated for the task's data. The initial
values for the static variables are copied into the block
and a local heap is initialized.

When a task that has called into the DLL shuts down, it
must call the UnregisterTask function. This function
removes the task from the DLL's list and frees the data
associated with the task. If the task does not call
UnregisterTask, another task with the same SS as the first
task might link to the DLL. Since the first task did not
unregister itself, the SS will be associated with a DS
that is no longer present, and will cause a UAE.

MULTAPP was built and tested under Microsoft(R)
Windows(TM) version 3.1.

KEYWORDS: PR-CD2; LocalReAlloc; LocalAlloc; LocalLock;
LocalUnLock; GlobalSize; GlobalAlloc; GlobalLock; _fmemcpy

=============================================================================

****
**** The TERMWAIT sample can be downloaded from the
**** file 4-30.zip in the moresamp directory
****

TERMWAIT: Launches Child Task and Waits

TERMWAIT launches a child task and waits for it to
terminate before executing specific code. The program uses
TOOLHELP library functions for this purpose and launches
Notepad as an example.

TERMWAIT installs a notification callback function using
NotifyRegister before calling WinExec to launch the child
task. All system tasks call this notification function
before termination. The notification function calls
TaskFindHandle to obtain TASKENTRY information about the
terminating task and consequently determines if TERMWAIT
launched the terminating task.

TERMWAIT sets the bChildIsExecuting global variable to
TRUE when the child task is spawned and sets it to FALSE
after the child task has terminated. Any code that should
not be executed while the child is running can check the
value of bChildIsExecuting. Menu choices that may cause re-
entrancy problems during the wait should be grayed. The
AfterChildHasTerminated function contains code that can be
executed only after the child task has terminated.

If an application needs to keep track of a number of child
tasks, it can process both NFY_STARTTASK and NFY_ENDTASK
in the NotifyRegister callback function. GetCurrentTask
will return the handle of the task that called the
notification. This information can be managed by the
parent task. Although tasks cannot share the same handle,
task handles can be re-used. If one task terminates and
another one starts, the new task can have the same handle
as the task that just terminated. This is not a problem if
the parent task uses the NotifyRegister callback function
to detect when a task has terminated.

TERMWAIT was built and tested under Microsoft(R)
Windows(TM) version 3.1. TERMWAIT requires Windows 3.1 to
build, but has been compiled for 3.1 and 3.0
compatibility. TOOLHELP.DLL was not shipped with Windows
3.0; you must copy this library to the \WINDOWS\SYSTEM
directory to run TERMWAIT under 3.0.

KEYWORDS: PR-CD2; GetCurrentTask; NotifyUnRegister;
TaskFindHandle

=============================================================================

****
**** The MIDIKEYB sample can be downloaded from the
**** file 4-31.zip in the moresamp directory
****

MIDIKEYB: Demonstrates the midiKeyB Control

MIDIKEYB is designed to show how to use midiKeyB, which is
a custom control that implements a musical instrument
digital interface (MIDI)-style keyboard. This keyboard is
not exactly the best keyboard for a jam session; don't
expect to hit a bunch of hemidemisemiquavers at correct
tempo.

The midiKeyB control responds to and sends short MIDI
messages. The right mouse button is used for "sticky keys"
and toggles the state appropriately.

For more information, see the function headers in the
source code.

MIDIKEYB was built and tested under Microsoft(R)
Windows(TM) version 3.1.

=============================================================================

****
**** The ZYZGAUGE sample can be downloaded from the
**** file 4-32.zip in the moresamp directory
****

ZYZGAUGE: Demonstrates Progress Bar

ZYZGAUGE shows how to use the zYzGauge control. The Gas
Gauge Custom Control in the client window gives you a
progress bar class named zYzGauge. You can set the range,
position, font, color, orientation, and 3D effect of the
gauge by sending messages to the control.

For more information on using the control, please see the
header information in ZYZGAUGE.C.

ZYZGAUGE was built and tested under Microsoft(R)
Windows(TM) version 3.1.

=============================================================================

****
**** The ALCKEY sample can be downloaded from the
**** file 4-33.zip in the moresamp directory
****

ALCKEY: Uses ALC Values to Filter Input

ALCKEY is a Microsoft(R) Windows(TM) for Pen Computing
program that shows how to use ALC values to specify how an
hedit (or bedit) control will filter its input.

ALC values define the types of values that a pen hedit or
bedit control will recognize. For example, ALC_NUMERIC
allows only numeric values to be recognized in a
particular control. Using ALC values allows you greater
freedom in customizing your application's response to ink.
Defining a small subset of ALC values for an edit control
increases the recognition of those values.

ALCKEY displays two edit controls: an hedit and a bedit.
You can select flags from the ALC dialog box for the hedit
control. The bedit control remains unchanged so you can
see the difference between the settings of the two
controls.

ALCKEY also demonstrates the use of the ShowKeyboard
function and shows the recommended way of interfacing to
the virtual keyboard through an owner-drawn "keyboard"
button. Notice that the virtual keyboard always stays on
top but never has the focus. The keyboard output is
directed to the last control that had the focus. ALCKEY
also demonstrates a way to ensure that only valid controls
get the focus. The virtual keyboard in Windows for Pen
Computing version 1.0 is not affected by the filtering
effects of ALC values. Only recognized ink is affected;
the keyboard does not involve inking so it bypasses this
step.

ALCKEY was built and tested under Microsoft Windows
version 3.1. The program requires PENWIN.DLL, which can be
found in both Microsoft Windows for Pen Computing and the
Microsoft Windows version 3.1 Software Development Kit
(SDK).

KEYWORDS: PR-CD2; LoadString; LoadBitmap;
GetSystemMetrics; CreateCompatibleDC; StretchBlt; _fmemcpy

=============================================================================

****
**** The ANNOPRNT sample can be downloaded from the
**** file 4-34.zip in the moresamp directory
****

ANNOPRNT: Annotates and Prints Text and Ink

ANNOPRNT is a Microsoft(R) Windows(TM) for Pen Computing
program that demonstrates how to annotate a text file with
ink and output the annotated text to a printer.

The program demonstrates several techniques for printing
annotated text:

> Certain pen functions are more suitable for printer
output. For example, DrawPenData is more suitable than
RedisplayPenData, which depends on the video driver.

>  ANNOPRNT shows how to output different colors of ink,
so you can see the results of the color mapping on
specific printers (some colors do not show up on a
printer).

>  Another method involves printing the annotated text
file as a device-independent bitmap (DIB), thus allowing
the driver to do the color mapping instead of the graphics
device interface (GDI). Drivers typically map better to
gray scale, so you can use this technique if color is
important. The WINCAP sample application on the Microsoft
Developer Network CD demonstrates how to output DIBs to
printers.

Although ANNOPRNT was checked carefully for possible
printing problems, some printer drivers may cause errors.
If you experience problems running this program, contact
the Windows for Pen Computing support group on the
CompuServe(R) WINEXT forum, section 8 (the Pen Section).

ANNOPRNT was built and tested under Microsoft Windows
version 3.1. The program requires PENWIN.DLL, which can be
found in both Microsoft Windows for Pen Computing and the
Microsoft Windows version 3.1 Software Development Kit
(SDK).

KEYWORDS: PR-CD2; GetPenDataInfo; GetDeviceCaps;
CreatePen; DrawPenData; SetBkMode; SetMapMode;
SetWindowExt; SetViewportExt; PrintDlg; _lopen; _lread;
DestroyPenData; GetOpenFileName; IsPenEvent;
DuplicatePenData; CompactPenData; MetricScalePenData;
OffsetPenData; RedisplayPenData

=============================================================================

****
**** The ANNOTATE sample can be downloaded from the
**** file 4-34.zip in the moresamp directory
****

ANNOTATE: Adds Handwriting to a Text File

ANNOTATE adds handwriting information to a text file. This
sample can serve as a starting point for writing pen-
centric annotation applications.

There are many issues involved in writing an application
that offers full-scale annotations: movement, saving ink
to a file, delayed recognition, and use of gestures. To
attach ink to a specified position of the text file
involves scrolling and repainting the ink in the
appropriate position. ANNOTATE demonstrates a scrolling
algorithm that scrolls the ink with the text file
appropriately. Other scrolling algorithms are also
possible. The RedisplayPenData function redisplays the
ink, and the DuplicatePenData function saves ink over the
life of the application.

ANNOTATE also demonstrates how to change ink color and
width dynamically.

ANNOTATE was built and tested under Microsoft(R)
Windows(TM) version 3.1. The program requires PENWIN.DLL,
which can be found in both Microsoft Windows for Pen
Computing and the Microsoft Windows version 3.1 Software
Development Kit (SDK).




=============================================================================

****
**** The DYNBEDIT sample can be downloaded from the
**** file 4-36.zip in the moresamp directory
****

DYNBEDIT: Changes Edit Control to Bedit Control at Run
Time

DYNBEDIT shows how to change a normal edit control to a
bedit control at run time. This allows an application to
run unmodified in Microsoft(R) Windows(TM) for Pen
Computing or in the retail version of Windows.

DYNBEDIT requires PENWIN.DLL, which can be found in both
Microsoft Windows for Pen Computing and the Microsoft
Windows version 3.1 Software Development Kit (SDK).

By default, the Windows for Pen Computing system changes
an edit control to a hedit control at run time but lacks
the mechanism for changing an edit control to a bedit
control.

To perform this transition, the application must query the
information from the edit control, destroy the edit
control, and then call CreateWindow to make the new bedit
control. However, this technique causes problems if you
use a font other than the system font in a dialog box. For
example, the font statement FONT 8,"Helv" will cause the
combs of the bedit control to appear below the bottom
border of the control because Windows for Pen Computing
calculates the size of the combs in the system font. To
avoid this problem, the application must reduce the size
of the GUIDE structure in the RC structure for the new
control. The system will pick a new font that matches the
new GUIDE size. For more information, please see the
README.TXT file.

DYNBEDIT was built and tested under Microsoft Windows
version 3.1.



=============================================================================

****
**** The GRID sample can be downloaded from the
**** file 4-37.zip in the moresamp directory
****

GRID: Demonstrates Circle Gestures and Much More

GRID is a sample pen application that demonstrates the
following features:

>  How to change the shape of a mouse cursor when the
state of the system changes

>  How to process the REC_POINTEREVENT return code from
the Recognize function to distinguish between a Tap and a
TapNHold

>  How to support a circle gesture

>  How to cut and paste ink to the Clipboard,

>  How to operate the correct writing dialog

>  How to use the recognition termination condition of
PCM_RECTBOUND to allow a user to enter information quickly

GRID was built and tested under Microsoft(R) Windows(TM)
version 3.1. The program requires Microsoft Windows for
Pen Computing.



=============================================================================

****
**** The HOTSPOTS sample can be downloaded from the
**** file 4-38.zip in the moresamp directory
****

HOTSPOTS: Reconizes Hotspots Associated with Gestures

HOTSPOTS is a pen application that helps developers
recognize hotspots associated with gestures. When the user
draws a gesture, HOTSPOTS redisplays the ink using a red
pen. If the gesture has a hotspot, the hotspot is circled
with a small black dot. If the input was not a gesture, it
is drawn in black.

HOTSPOTS requires PENWIN.DLL, which can be found in both
Microsoft(R) Windows(TM) for Pen Computing and the
Microsoft Windows version 3.1 Software Development Kit
(SDK).

HOTSPOTS was built and tested under Microsoft Windows
version 3.1. The program is designed to work with
Microsoft Windows for Pen Computing.



=============================================================================

****
**** The PARSER sample can be downloaded from the
**** file 4-39.zip in the moresamp directory
****

Parser: Maps Raw Data to Recognized Characters

Parser is a Microsoft(R) Windows(TM) for Pen Computing
program that demonstrates how to parse the symbol element
(SYE) array of the symbol graph (SYG) structure using
symbol values (SYVs) and symbol correspondence (SYC)
arrays where appropriate. The purpose of the program is to
determine the strokes associated with the recognized
characters.

Parser is designed around three main components of Windows
for Pen Computing: the "best guess" array of SYVs, the
HPENDATA structure, and the SYE in the SYG structure.

During a single recognition session, the "ink" (vector-
based x,y coordinates of the user's input) is stored in
the HPENDATA structure of the RCRESULT structure. The
lpsyv field of the RCRESULT structure also contains the
"best guess" array of symbol values that the system thinks
the ink represents. This array can be used in conjunction
with the SYE array and the SYC structure to isolate
individual characters in the ink and associate them with
their corresponding ink strokes (or partial strokes) in
the HPENDATA structure. SYGs, SYVs, SYEs, and SYC
structures are typically the most difficult and confusing
components of the pen architecture. These structures are
interrelated, and it is necessary to parse one array while
another array is being similarly parsed. The Parser
program provides a clear and fairly simple demonstration
of the parsing mechanism. For more information on SYGs,
SYVs, SYEs, and SYCs, see the Windows for Pen Computing
online help system or the Windows version 3.1 Software
Development Kit (SDK) "Microsoft Windows for Pen
Computing: Programmer's Reference" manual.

Parser has the same architecture as the View sample
application on the Microsoft Developer Network CD. View
demonstrates slow drawing, automatic positioning of text
strings returned as the "best guess" from the recognizer,
and dynamically sizing the text string with a matching
TrueType(R) font. The View sample returns a TrueType text
string based on the entire HPENDATA structure, and uses
the bounding rectangle of the entire ink data to size the
font for the string. Parser, on the other hand, walks the
SYE array of the SYG structure looking for the iSyc values
so the SYC structure can be used to find the individual
data strokes for the characters in the HPENDATA structure.
For example, the letter "t" will typically consist of two
strokes, although the strokes are not necessarily
sequential in the HPENDATA structure--for example, the
user can cross the "t" after writing other characters. The
SYC references both strokes and gives an index into the
HPENDATA to retrieve them.

Once Parser associates the "best guess" array of symbol
values to the raw data in the HPENDATA structure, it uses
the raw data points to determine the size of the user's
input, and selects a TrueType font. The size and position
of each individual character the user enters is
independent of all other characters and is displayed as
such.

Parser currently displays a maximum of 10 characters (as
text), regardless of how many characters the user has
entered. You can remove this limitation by adjusting the
MAXCHARMAP value in the CONVERT.H file. When you select
DisplayAsText, Parser displays the SYE array in the upper-
left corner of the client area so the user can see the
results of the recognition process.

Parser was built and tested under Microsoft Windows
version 3.1. The program requires PENWIN.DLL, which can be
found in both Microsoft Windows for Pen Computing and the
Microsoft Windows version 3.1 SDK. Parser also requires
the TrueType Arial font.

KEYWORDS: PR-CD2; DuplicatePenData; MetricScalePenData;
FIsGesture; _fstrnlen; _fstrncpy; OffsetPenData;
GetPenDataStroke; SymbolToCharacter; FIsAppGesture;
RedisplayPenData; GetPointsFromPenData; GetPenDataInfo;
BeginEnumStrokes; CreatePenData; AddPointsPenData;
_fmemcpy; EndEnumStrokes; DestroyPenData; IsPenEvent;
InitRC; Recognize

=============================================================================

****
**** The PRESSURE sample can be downloaded from the
**** file 4-40.zip in the moresamp directory
****

PRESSURE: Captures Pressure Information

PRESSURE demonstrates one way of capturing pressure
information from Microsoft(R) Windows(TM) for Pen
Computing using the GetPenHwEventData function.

PRESSURE requires PENWIN.DLL, which can be found in both
Microsoft Windows for Pen Computing and the Microsoft
Windows version 3.1 Software Development Kit (SDK).
PRESSURE also works on a tablet that has pressure-sensing
capabilities.

PRESSURE was built and tested under Microsoft Windows
version 3.1.



=============================================================================

****
**** The RCDUMP sample can be downloaded from the
**** file 4-41.zip in the moresamp directory
****

RCDUMP: Displays RCRESULT Structure

The RCDUMP sample program displays the entire RCRESULT
structure and shows the cause and effect of different RC
options in real time.

Developers who are unfamiliar with the Microsoft(R)
Windows(TM) for Pen Computing system can use RCDUMP while
reading the pen documentation to understand the actions of
different flags and settings.

Developers who are implementing recognizers and
dictionaries for Windows for Pen Computing can use RCDUMP
to view and test different RC settings in their system
components. RCDUMP allows you to change RC settings and
immediately see the effects of the change.

For more information on RCDUMP, please see the RCDUMP.DOC
file.

RCDUMP was built and tested under Microsoft Windows
verison 3.1.

KEYWORDS: PR-CD2

=============================================================================

****
**** The VIEW sample can be downloaded from the
**** file 4-42.zip in the moresamp directory
****

View : Draws Ink at a Slower Rate

View is a Microsoft(R) Windows(TM) for Pen Computing
program that demonstrates the following:

>  Displaying ink using the RedisplayPenData function.

>  Displaying the "best guess" in text from the
recognizer.

>  Using TrueType(R) fonts to mimic the height of the raw
ink text.

>  Parsing the individual ink data points and doing a
"slow draw" of the ink.

View demonstrates a conversion algorithm that you can use
to convert raw ink into recognized values. These values
can then be converted and displayed as text on a device
context (DC) in a TrueType font so that the font string
mimics the raw ink string height. See the Windows version
3.1 Software Development Kit (SDK) "Microsoft Windows for
Pen Computing: Programmer's Reference" manual for more
information on recognition results.

View also shows how to use a timer callback function to
walk through the individual stroke points and draw them
one by one. A timer allows you to slow down the speed at
which the ink is redrawn to observe how the user draws the
ink.

View was built and tested under Microsoft Windows version
3.1. The program requires PENWIN.DLL, which can be found
in both Microsoft Windows for Pen Computing and the
Microsoft Windows version 3.1 SDK. View also requires the
TrueType Arial font.

KEYWORDS: PR-CD2; SymbolToCharacter; _fstrncpy;
IsPenEvent; DestroyPenData; Recognize; DuplicatePenData;
MetricScalePenData; OffsetPenData; GetPenDataInfo;
BeginEnumStrokes; GetPenDataStrokes; GetPointsFromPenData;
EndEnumStrokes

=============================================================================

****
**** The EDTINFO sample can be downloaded from the
**** file 4-66.zip in the moresamp directory
****

EDIT_INFO: Retrieves Status of Text Box Using Windows
Messages

EDIT_INFO shows how to access retrieval information from a
Microsoft(R) Visual Basic(TM) application. It uses
Microsoft Windows(TM) functions to retrieve information
about the status of a text box. The Visual Basic language
does not provide this capability.

EDIT_INFO allows you to use the Windows message constants
listed below for the following tasks:

>  EM_GETLINE: Copy a specific line of text from the edit
control.

>  EM_GETLINECOUNT: Retrieve the number of lines within
the edit control.

>  EM_GETSEL: Position the cursor at a specific character
location.

>  EM_LINEFROMCHAR: Retrieve the line number of a specific
character location.

>  EM_LINEINDEX: Retrieve the number of lines prior to a
specified character position.

>  EM_LINELENGTH: Retrieve the number of characters in a
specified line.

>  EM_REPLACESEL: Replace the specified text with another
text string.

For information on specifying the amount of text allowed
within a text control, search the Knowledge Base for
EM_LIMITTEXT.

For information on setting tab stops within a control,
search the Knowledge Base for EM_SETTABSTOPS.

EDIT_INFO was built and tested under Microsoft Windows
version 3.1 and Visual Basic version 3.0.

KEYWORDS: CD4

=============================================================================

****
**** The EIGEN sample can be downloaded from the
**** file 4-67.zip in the moresamp directory
****

EIGEN: Calculates Unique Vector (Eigenvector) for a Matrix

Scientists and engineers who work with matrices use an
eigenvalue calculator to calculate the unique vector
(eigenvector) for a given matrix.

The EIGEN sample provides an eigenvalue calculator created
with Microsoft(R) Visual Basic(TM) and Microsoft FORTRAN
version 5.1. EIGEN calls a Microsoft Windows(TM) dynamic-
link library (DLL) written in FORTRAN. The EIGEN.FOR file
contains the code for the DLL. FORTRAN's ability to handle
multi-dimensional arrays makes it possible to calculate
the eigenvector easily.

EIGEN demonstrates how easy it is to attach a graphical
front-end to an existing FORTRAN algorithm and thus
leverage existing code to create new Windows-based
applications. Visual Basic's strong DLL support and
parameter-passing makes this possible.

EIGEN was built and tested under Microsoft Windows version
3.1 and Visual Basic version 3.0.

KEYWORDS: CD4

=============================================================================

****
**** The FLIP sample can be downloaded from the
**** file 4-68.zip in the moresamp directory
****

FLIP: Demonstrates BitBlt and StretchBlt Animation

FLIP is a Visual Basic(TM) program that uses the BitBlt
and StretchBlt functions to animate graphics. The program
simulates flipping tiles.

BitBlt copies icons instead of using individual picture
boxes. StretchBlt also copies bitmaps from a source to a
destination, but compresses or stretches the original
bitmap.

To load FLIP files in the Visual Basic environment, run
VB.EXE, choose Open Project from the File menu, and select
the FLIP.MAK file.

FLIP was built with Microsoft(R) Visual Basic version 3.0
and tested under Microsoft Windows(TM) version 3.1.

KEYWORDS: CD4; VB

=============================================================================

****
**** The FRMSCROL sample can be downloaded from the
**** file 4-69.zip in the moresamp directory
****

FrmScroll: Demonstrates How to Scroll Inside a Form

FrmScroll shows how to scroll inside a form using Visual
Basic(TM) version 3.0.

KEYWORDS: CD4

=============================================================================

****
**** The JIGSAW sample can be downloaded from the
**** file 4-70.zip in the moresamp directory
****

JIGSAW: Demonstrates GDI Region, Clipping, and Bitmap
Functions

JIGSAW uses region functions (CreateRectRgn, CombineRgn,
SetRectRgn), clipping functions (SelectClipRgn), and
bitmap functions (BitBlt) from the Microsoft(R)
Windows(TM) graphics device interface (GDI) to simulate a
jigsaw puzzle.

These functions use less memory and fewer resources than
individual picture box controls to display and move the
different pieces of the puzzle around the window.

Region functions create, alter, and retrieve information
about regions that can be filled with graphical output.
You can use region functions with clipping functions to
create clipping regions. A clipping region is a portion of
a window where GDI creates output. If you send output to
an area of a window outside a clipping region, the output
will not be visible. Bitmap functions display bitmaps;
these functions let you prepare images in memory and then
copy the images to the display.

To load JIGSAW files in the Visual Basic(TM) environment,
run VB.EXE, choose Open Project from the File menu, and
select the JIGSAW.MAK file. You can also make an
executable file and run it as a separate program using the
Visual Basic run-time file VBRUN200.DLL.

JIGSAW was built with Microsoft Visual Basic version 3.0
and tested under Microsoft Windows version 3.1.

KEYWORDS: CD4; VB

=============================================================================

****
**** The KWIKZONE sample can be downloaded from the
**** file 4-71.zip in the moresamp directory
****

Kwikzone: Demonstrates File Input and Output in Visual
Basic

Kwikzone is a Visual Basic(TM) version 3.0 program that
shows state and city area codes.

KEYWORDS: CD4

=============================================================================

****
**** The MKEGROUP sample can be downloaded from the
**** file 4-72.zip in the moresamp directory
****

Mkegroup: Uses DDE to Create Program Manager Groups and
Items

The Mkegroup (Make Group) sample application demonstrates
the ease of creating Microsoft(R) Windows(TM) Program
Manager groups and items with dynamic data exchange (DDE).

The application displays a form from which the user can
select a program group name (for example, Games) and a
bunch of files. Clicking on the Make Group button either
creates a new group with the specified name in the Program
Manager or opens a group by that name, if one already
exists. The application then creates program items in the
group for each selected file.

Of course, the user can create groups and items manually
using the Program Manager File New command or by dragging
files from the File Manager to the Program Manager.
However, as an added bonus, Mkegroup provides an Iterate
button that scans all of the subdirectories below the
current directory, looking for files that match the
currently selected pattern (for example, *.EXE), and adds
all matching files to the list of selected files.

For example, let's say you have a directory called
C:\VB\VBSAMPLE on your hard disk that contains a
subdirectory for each sample program you have written. If
you want to create a program group that contains program
items for all of the samples, open Mkegroup, select
C:\VB\VBSAMPLE in the directory list box, and choose the
Iterate button. This is much easier than opening each
subdirectory individually.

KEYWORDS: CD4

=============================================================================

****
**** The NAMESORT sample can be downloaded from the
**** file 4-73.zip in the moresamp directory
****

NameSort: Sorts Names Alphabetically

NameSort alphabetizes long lists of names in ascending
order based on last names. This utility was designed for
people who write memos with long TO: and CC: lists but who
hate to alphabetize names manually. NameSort is one of the
few Visual Basic(TM)/Windows(TM) applications that have no
visual representation.

To use NameSort from a document, highlight the text you
want sorted and copy it to the Clipboard. The names must
appear in the following format:

Steve Podradchik, Bill Gates, Paul Allen

Multiple lines with random carriage returns are OK.

Double-click NameSort. When the pointer icon returns, the
sorted text will be back in the Clipboard, in the form:

Paul Allen, Bill Gates, Steve Podradchik

Now you are ready to paste back over the original text.

NameSort was built with Visual Basic version 3.0.

KEYWORDS: CD4

=============================================================================

****
**** The SHUFFLE sample can be downloaded from the
**** file 4-74.zip in the moresamp directory
****

Shuffle: Demonstrates BitBlts to Shuffle Around the Screen

Shuffle is a Visual Basic(TM) version 3.0 sample that uses
Windows(TM) BitBlts to shuffle around the screen (similar
to IdleWild).

KEYWORDS: CD4

=============================================================================

****
**** The BNDBUF sample can be downloaded from the
**** file 4-75.zip in the moresamp directory
****

BNDBUF: Demonstrates Distributed Bounded Buffer Solution

The BNDBUF sample demonstrates the distributed version of
the operating systems producer-consumer problem. The
producers and consumers use a centralized buffer pool
managed by the remote process control (RPC) server.
Semaphores are counted to make sure that consumptions take
place when the buffer pool contains at least one
unconsumed string, and productions take place when the
buffer pool contains at least one empty slot. Access to
the shared buffer pool is synchronized by means of a
mutex.

To use this program, you must first start the RPC locator
service using the following command line:

start locator /noservice

Next, start the application server by typing:

start bndbufs

Then, you can start multiple clients by typing:

start bndbufc

for each client to be started.

The application uses WHILE loops to run forever; you must
use CTRL+C to terminate each component.

The Microsoft(R) Windows NT(TM) version 3.1 operating
system was not available at the time this sample was
acquired for the Microsoft Developer Network CD. For this
reason, the CD includes only the source files for the
sample, not the executable file or any DLLs. If you have
Windows NT version 3.1 installed on your system, you may
copy the source files to your hard drive and invoke the
Windows NT make file to build the sample.

KEYWORDS: CD4

=============================================================================

****
**** The GUIGREP sample can be downloaded from the
**** file 4-76.zip in the moresamp directory
****

GUIGREP: Extends the File Manager to Browse Files

GUIGREP implements a File Manager extension for browsing
source files. Like the grep utility, GUIGREP finds
occurrences of a search string in files selected through
the File Manager.

The sample demonstrates multithreading, structured
exception handling, C++ code, File Manager extensions, and
memory-mapped file manipulation. NTGREP.EXE "installs" the
File Manager extension by adding an entry to WINFILE.INI.

The Microsoft(R) Windows NT(TM) version 3.1 operating
system was not available at the time this sample was
acquired for the Microsoft Developer Network CD. For this
reason, the CD includes only the source files for the
sample, not the executable file or any DLLs. If you have
Windows NT version 3.1 installed on your system, you may
copy the source files to your hard drive and invoke the
Windows NT make file to build the sample.

KEYWORDS: CD4

=============================================================================

****
**** The MASKBLT sample can be downloaded from the
**** file 4-77.zip in the moresamp directory
****

MASKBLT: Demonstrates Win32 MaskBlt Function

MASKBLT provides an easy-to-use demonstration of the
MaskBlt function in the Win32(TM) application programming
interface (API). The program displays a dialog box that
allows you to manipulate the parameters to MaskBlt. The
main window has three sections: the source bitmap is
displayed in the center, the monochrome bitmap mask is
displayed on the right, and the destination bitmap is
displayed on the left.

You can change the destination rectangle either from the
dialog box or by using the direct-manipulation object in
the left section of the window. Clicking and dragging the
mouse in the upper-left corner moves the rectangle;
clicking and dragging the mouse in the lower-right corner
sizes the rectangle. The function requires only a starting
point (not a rectangle) for the source and mask bitmaps.
Additional direct-manipulation objects are provided for
the source and for the mask. You can move these objects by
clicking and dragging with the mouse.

You can change the raster operation for the MaskBlt
function by changing the values in the rightmost entry
fields in the dialog box. These entries are interpreted in
hexadecimal. The combo box directly below these fields
lists all standard raster operations. When you select a
standard ROP from this combo box, the contents of the
combo box are copied into the ROP entry fields and used in
the MaskBlt call.

MASKBLT provides Clipboard support as follows:

>  Press CTRL+INSERT to copy the destination image to the
Clipboard.

>  Press SHIFT+INSERT to copy a bitmap from the Clipboard
to the source region.

>  Press ALT+INSERT to do both. This key sequence copies
the destination image to the Clipboard and then down to
the source region.

The Microsoft(R) Windows NT(TM) version 3.1 operating
system was not available at the time this sample was
acquired for the Microsoft Developer Network CD. For this
reason, the CD includes only the source files for the
sample, not the executable file or any DLLs. If you have
Windows NT version 3.1 installed on your system, you may
copy the source files to your hard drive and invoke the
Windows NT make file to build the sample.

KEYWORDS: CD4; _lclose; _lopen; _lread; AngleArc;
BeginPaint; BitBlt; ClientToScreen; CloseClipBoard;
CreateCompatibleBitmap; CreateCompatibleDC; CreateDialog;
CreateDIBitmap; CreatePen; CreateRectRgnIndirect;
CreateWindow; DeleteDC; DeleteObject; DispatchMessage;
DPtoLP; EndPaint; FillRect; GetClassLong; GetClientRect;
GetClipboardData; GetClipBox; GetDC; GetDlgItemInt;
GetDlgItemtext; GetFileSize; GetMessage; GetObject;
GetStockObject; GetViewportOrgEx; GetWorldTransform;
InvalidateRect; LineTo; LoadAccelerators; LoadCursor;
LoadIcon; LocalAlloc; LocalFree; LocalHandle; LPtoDP;
IsWindow; MaskBlt; MessageBox; ModifyWorldTransform;
MoveToEx; OpenClipboard; OpenFile; PostMessage;
PostQuitMessage; PtInRect; Rectangle; ReleaseCapture;
ReleaseDC; SelectClipRgn; SelectObject;
SendDlgItemMessage; SendMessage; SetCapture;
SetClipboardData; SetCursorPos; SetDlgItemInt;
SetDlgItemText; SetROP2; SetViewportOrgEx; SetWindowPos;
SetWorldTransform; ShowWindow; StretchBlt

=============================================================================

****
**** The PATHS sample can be downloaded from the
**** file 4-78.zip in the moresamp directory
****

PATHS: Uses Paths for Drawing, Filling, and Clipping

The PATHS sample demonstrates the use of paths for
drawing, filling, and clipping. The program draws six
different figures in the window and labels each one. Each
figure is based on the same path recreated six times. The
six figures are the result of calling the following
Microsoft(R) Windows(TM) functions (the poly fill mode is
indicated in parentheses):

>  StrokePath

>  FillPath

>  StrokeAndFill(Winding)

>  StrokeAndFill(Alternate)

>  SelectClipPath(Winding)

>  SelectClipPath(Alternate)

The Microsoft Windows NT(TM) version 3.1 operating system
was not available at the time this sample was acquired for
the Microsoft Developer Network CD. For this reason, the
CD includes only the source files for the sample, not the
executable file or any DLLs. If you have Windows NT
version 3.1 installed on your system, you may copy the
source files to your hard drive and invoke the Windows NT
make file to build the sample.

KEYWORDS: CD4; AngleArc; BeginPaint; BeginPath; CopyRect;
CreatePen; CreateWindow; DeleteObject; DispatchMessage;
Ellipse; EndPaint; EndPath; FillPath; GetClientRect;
GetMessage; GetStockObject; InflateRect; LoadCursor;
LoadIcon; MoveToEx; PathToRegion; PostQuitMessageTextOut;
Rectangle; SelectClipRgn; SelectObject; SetBkMode;
SetPolyFillMode; SetViewportOrgEx; ShowWindow;
StrokeAndFillPath; StrokePath; TranslateMessage;
UpdateWindow

=============================================================================

****
**** The READWRIT sample can be downloaded from the
**** file 4-79.zip in the moresamp directory
****

READWRIT: Demonstrates Read/Write Synchronization

READWRIT implements a variation of the reader/writer
synchronization problem, first stated and solved by
Courtois. The reader/writer problem revolves around a
shared resource, which is typically a database. The goal
is to allow readers and writers access to the database
without corrupting it.

Typically, one allows multiple readers to access the
database as long as a writer is not accessing it. However,
when a writer accesses the database, all other readers or
writers are denied access. There are several variations of
this problem. The simplest variations favor readers to the
exclusion of writers or vice versa.

The implementation used by the READWRIT sample allows
multiple readers in the database until a writer asks for
entry. At this point, no other reader can access the
database until the writer is finished. All readers who are
currently accessing the database, however, can finish
their tasks. This method avoids the starvation of readers
and writers that is inherent in the simpler methods. The
user interface is intentionally very simple to keep the
sample focused.

To run READWRIT, type:

READWRIT

at the command prompt.

The Microsoft(R) Windows NT(TM) version 3.1 operating
system was not available at the time this sample was
acquired for the Microsoft Developer Network CD. For this
reason, the CD includes only the source files for the
sample, not the executable file or any DLLs. If you have
Windows NT version 3.1 installed on your system, you may
copy the source files to your hard drive and invoke the
Windows NT make file to build the sample.

KEYWORDS: CD4

=============================================================================

****
**** The UNINPUT sample can be downloaded from the
**** file 4-80.zip in the moresamp directory
****

UNINPUT: Demonstrates Primitive Drag-and-Drop Unicode
Input Method

UNINPUT provides a primitive, mouse-based, drag-and-drop
input method. It allows the user to grab any character
covered by a Unicode font, and drag the character to a
second window. If the user drops the character on the
second window, that window is sent a WM_CHAR message with
the appropriate key code.

The status bar at the bottom of the window displays three
fields of information:

>  The title of the last window to receive a WM_CHAR
(left)

>  The type of the last window to receive a WM_CHAR--
either Unicode or ANSI (center)

>  A list of the most recently dropped characters--similar
to a history buffer (right)

Please see the online help file for more information.

The Microsoft(R) Windows NT(TM) version 3.1 operating
system was not available at the time this sample was
acquired for the Microsoft Developer Network CD. For this
reason, the CD includes only the source files for the
sample, not the executable file or any DLLs. If you have
Windows NT version 3.1 installed on your system, you may
copy the source files to your hard drive and invoke the
Windows NT make file to build the sample.

KEYWORDS: CD4

=============================================================================

****
**** The WINNET sample can be downloaded from the
**** file 4-81.zip in the moresamp directory
****

WINNET: Demonstrates WIN32 Network Functions

The WINNET sample finds a connectable disk resource on the
network, connects to it, then disconnects. It demonstrates
the following Win32(TM) functions: WNetAddConnection,
WNetAddConnection2, WNetCancelConnection,
WNetCancelConnection2, WNetCloseEnum, WNetEnumResource,
WNetGetConnection, WNetGetLastError, WNetGetUser, and
WNetOpenEnum.

WINNET requires one or more network disk shares that can
be used by the machine/user-ID you are running WINNET on.
Make sure that these shares are not already connected to
the machine/user-ID and do not require passwords.

IMPORTANT: Ensure that network drive W: is not in use when
you run WINNET.

The Microsoft(R) Windows NT(TM) version 3.1 operating
system was not available at the time this sample was
acquired for the Microsoft Developer Network CD. For this
reason, the CD includes only the source files for the
sample, not the executable file or any DLLs. If you have
Windows NT version 3.1 installed on your system, you may
copy the source files to your hard drive and invoke the
Windows NT make file to build the sample.

KEYWORDS: CD4

=============================================================================

****
**** The WORLD sample can be downloaded from the
**** file 4-82.zip in the moresamp directory
****

WORLD: Demonstrates World Coordinate Transforms

WORLD reads an image from a metafile and demonstrates how
the image can be translated and scaled using the
SetWorldTransform function.

After starting WORLD, choose the Open command from the
Metafile menu and specify the metafile that should be
used. WORLD displays the image. The horizontal and
vertical scroll boxes are set to the middle of the scroll
bars. Use the scroll bars to translate the image. To scale
the image, choose the Scale command. Select the desired
horizontal and vertical scaling factors from the list
boxes.

The SetWorldTransform function takes two parameters: a
device context and a structure that defines the transform
to be applied. The transform contains six fields:

>  eM11: Horizontal scaling factor

>  eM12: Not used

>  eM21: Not used

>  eM22: Vertical scaling factor

>  eDx: Horizontal translation

>  eDy: Vertical translation

When you choose the OK button in the Scale Image dialog
box, WORLD updates the transform and calls InvalidRect to
update the window.

The Microsoft(R) Windows NT(TM) version 3.1 operating
system was not available at the time this sample was
acquired for the Microsoft Developer Network CD. For this
reason, the CD includes only the source files for the
sample, not the executable file or any DLLs. If you have
Windows NT version 3.1 installed on your system, you may
copy the source files to your hard drive and invoke the
Windows NT make file to build the sample.

KEYWORDS: CD4

=============================================================================

****
**** The COOLCOLR sample can be downloaded from the
**** file 4-48.zip in the moresamp directory
****

COOLCOLR: Changes System Colors

COOLCOLR is a Control Panel extension that lets you change
your system colors by dragging and dropping color
selections. To install COOLCOLR, copy the COOLCOLR.CPL
file to your Microsoft(R) Windows(TM) SYSTEM directory.
The next time you run Control Panel, the System Color
Dropper icon will appear in the Control Panel window.

Start COOLCOLR by double-clicking the System Color Dropper
icon. Click a basic color from the System Color Dropper
window, drag it to a menu, scroll bar, or any other system
area on the screen, and drop it. The system color is
updated immediately. Choose Cancel from the System Color
Dropper window to restore your original settings, or OK to
save your color changes to the WIN.INI file.

COOLCOLR uses a modified version of the ChooseColor common
dialog box, a custom template, and a hook function.

COOLCOLR was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: PR-CD2

=============================================================================

****
**** The DYNDLG sample can be downloaded from the
**** file 4-49.zip in the moresamp directory
****

DYNDLG: Implements Options Dialog Box

DYNDLG implements the Options dialog box that users can
access from the Tools menu in Word for Windows(TM) version
2.0. It creates an owner-drawn list box of icons
representing option categories, and depending on the
category icon selected, changes the options on the right
side of the dialog box.

DYNDLG was built and tested under Microsoft(R) Windows
version 3.1.

KEYWORDS: PR-CD2; DialogBox; SendDlgItemMessage; DrawIcon;
GetTextMetrics; DrawText; AddIconToListBox;
ShowAllControls; GetSystemMetrics; GetSysColor; PatBlt;
EndDialog

=============================================================================

****
**** The EXEVIEW sample can be downloaded from the
**** file 4-50.zip in the moresamp directory
****

EXEVIEW: Extracts and Decodes Information from Executable
Files

EXEVIEW demonstrates how to extract and decode resources
and tables from executable files or library files. (FONTS
and DRVs qualify as dynamic link libraries [DLLs]).

Applications often wish to extract information from an
executable file without loading the application itself.
For example, the Microsoft(R) Windows(TM) Program Manager
extracts an icon from an .EXE file to represent an
application. There are many other resources and tables in
an .EXE file (or in a DLL) that may be useful to certain
applications.

EXEVIEW uses the old and new header formats, which are
documented in the "MS-DOS Encyclopedia" (Microsoft Press,
1988). EXEVIEW loads these headers and the associated
tables that these headers point at, including the entry
table, the segment table, the resource table, the resident
and non-resident name tables, and the imported name
tables. EXEVIEW also loads the resources from the resource
table. If a resource can be displayed graphically (for
example, icons, cursors, bitmaps, menus), it is. Resources
for string tables and directories (for example, icons,
cursors, fonts) are listed in a text format.

For more information on file and resource formats, see the
Microsoft Systems Journal, Vol. 6, No. 5
(September/October 1991) or the "MS-DOS Encyclopedia"
(Microsoft Press, 1988).

EXEVIEW was built and tested under Microsoft Windows
version 3.1.

=============================================================================

****
**** The HITTEST sample can be downloaded from the
**** file 4-51.zip in the moresamp directory
****

HITTEST: Displays Dialog Box for Icon

HITTEST lets you double-click an icon to display a dialog
box associated with the icon. It is similar to the Control
Panel, which runs an applet associated with an icon.

HITTEST was built and tested under Microsoft(R)
Windows(TM) version 3.1.

KEYWORDS: PR-CD2; SetDlgItemText; EndDialog;
CreateCompatibleDC; CreateBitmap; GetObject; SelectObject;
SetOKColor; BitBlt; GetStockObject; GetSystemMetrics;
LoadIcon; SetTextColor; SetBkColor; DrawText;
DrawItemText; DialogBoxParam; BitBlt

=============================================================================

****
**** The HOTKEYED sample can be downloaded from the
**** file 4-52.zip in the moresamp directory
****

HotKeyed: Implements an Edit Control for Shortcut Keys

HotKeyed implements a shortcut key (hot key) edit control.
The application displays a dialog box that allows the user
to specify a shortcut key. This dialog box uses a
subclassed edit control to display the name of the
shortcut key the user enters.

The edit control checks the shortcut key to prevent the
user from specifying invalid keys. HotKeyed uses the
GetKeyNameText function to retrieve the key name.

A shortcut key must have an ALT or/and CTRL modifier. The
SHIFT modifier can also be added to the ALT or CTRL
sequence. To erase a key combination from the edit
control, use BACKSPACE or enter another key combination.
The ESC, ENTER, TAB, SPACEBAR, and PRINT SCREEN keys are
not allowed.

If the user enters a valid shortcut key, HotKeyed lets the
user install the key. HotKeyed uses the SetWindowsHookEx
hook function available in Microsoft(R) Windows(TM)
version 3.1 to install a task-specific keyboard hook. The
user can remove the shortcut key by selecting a menu
option or by exiting the application.

When the shortcut key is installed, HotKeyed flashes the
main window's title bar to indicate that a hot key has
been installed. The title bar continues to flash until the
shortcut key is removed. When the user presses the
shortcut key, HotKeyed toggles the main window's
background color.

HotKeyed was built and tested under Microsoft Windows
version 3.1, and requires this version of the operating
system.

KEYWORDS: PR-CD2; CreateSolidBrush; SetClassWord;
DialogBox; SetWindowLong; GetDlgItem; GetWindowText;
GetKeyState; SetTimer; KillTimer

=============================================================================

****
**** The MDIDLG sample can be downloaded from the
**** file 4-53.zip in the moresamp directory
****

MDIDLG: Demonstrates MDI Dialog Box

Revised: November 24, 1992

MDIDLG demonstrates a multiple document interface (MDI)
dialog box that contains a combo box, an edit control, and
a list box. To see the dialog box, select New from the
File menu.

MDIDLG was built and tested under Microsoft(R) Windows(TM)
version 3.1.



=============================================================================

****
**** The SIGNON sample can be downloaded from the
**** file 4-54.zip in the moresamp directory
****

SIGNON: Creates Sign-On Screen

Many companies like to display a sign-on screen while
their application is loading and initializing. When the
user performs some action indicating that he or she is
ready to begin using the application, the sign-on screen
disappears and the application proceeds as normal.

SIGNON is implemented with a modeless dialog box and some
extra processing in the main message loop. After the main
window is created and displayed, a modeless dialog
(usually containing the company name and copyright
information) appears in the main window. The main message
loop then watches for any action (for example, mouse
clicks, keystrokes, and menu accesses) indicating that the
user is ready to work. You can also create a timer to
remove the sign-on screen after a certain amount of time
(say, 5 seconds).

SIGNON was built and tested under Microsoft(R) Windows(TM)
version 3.1, but will also run under Windows version 3.0.

KEYWORDS: PR-CD2

=============================================================================

****
**** The SYSPARAM sample can be downloaded from the
**** file 4-55.zip in the moresamp directory
****

SYSPARAM: Demonstrates the SystemParametersInfo Function

SYSPARAM uses the SystemParametersInfo function to display
and modify systemwide parameters.

SystemParametersInfo is a new function in the Microsoft(R)
Window(TM) version 3.1 Software Development Kit (SDK) that
lets you query or change most of the systemwide settings--
everything from the wallpaper on the desktop to the width
of window borders. SYSPARAM displays the systemwide
parameters and their current values in the client area.
You can choose options from the Set Params menu to change
these settings.

WARNING:  This sample modifies the WIN.INI file. Please
remember any changes you make to the system parameters so
you can reset them to their original values.

SYSPARAM was built and tested under Microsoft Windows
version 3.1.

KEYWORDS: icon spacing; language driver; screen saver;
keyboard speed; grid granularity; wallpaper; beep; border
width; menu drop

=============================================================================

****
**** The CROSSTAB sample can be downloaded from the
**** file 4-83.zip in the moresamp directory
****

CROSSTAB 1.0: Demonstrates Microsoft Access Crosstab
Report

CROSSTAB is an example crosstab report that uses clever
programming tricks.

CROSSTAB is one of several samples and tools that
demonstrate what other developers have done with Microsoft
Access(R) databases. These tools have not been tested,
although some of them have been around for a while. The
Microsoft Access tools are not supported by Microsoft
Product Support Services (PSS) or on CompuServe(R); please
use these tools at your own risk.

CROSSTAB was built and tested under Microsoft Access
version 1.0.

KEYWORDS: CD4

=============================================================================

****
**** The DDL sample can be downloaded from the
**** file 4-84.zip in the moresamp directory
****

MSADDL10: Demonstrates Microsoft Access Data Definition
Language DLL

MSADDL10 is a data definition language (DDL) dynamic-link
library (DLL) that provides data definition support beyond
that provided by standard Microsoft Access(R).

This DLL enables the Access Basic programmer to create and
alter tables, fields, indexes, and relationships, and then
use those tables in Microsoft Access and Access Basic. The
DLL is provided specifically as an aid to developers who
need additional data definition information not provided
in the Microsoft Access retail documentation. As with any
DLL, passing an incorrect argument type or value could
result in general-protection fault (GPF) errors. If this
happens, check your arguments carefully. You can use the
MSADDL10.BAS include file to declare functions. This
utility is not supported by Microsoft; you should save
your work frequently to avoid loss of data.

For function descriptions, please see MSADDL10.TXT. Table
1 lists the functions provided by MSADDL10.DLL.

NOTE: You can use these functions only with Microsoft
Access databases and tables, and not with any other
databases or tables.

MSADDL10 is one of several samples and tools that
demonstrate what other developers have done with Microsoft
Access databases. These tools have not been tested,
although some of them have been around for a while. The
Microsoft Access tools are not supported by Microsoft
Product Support Services (PSS) or on CompuServe(R); please
use these tools at your own risk.

MSADDL10 was built and tested under Microsoft Access
version 1.0.

KEYWORDS: CD4

=============================================================================

****
**** The DDL2 sample can be downloaded from the
**** file 4-85.zip in the moresamp directory
****

MSADDL11: Demonstrates Microsoft Access Data Definition
Language DLL

MSADDL11 is a data definition language (DDL) dynamic-link
library (DLL) that provides data definition support beyond
that provided by standard Microsoft Access(R).

This DLL enables the Access Basic programmer to create and
alter tables, fields, indexes, and relationships, and then
use those tables in Microsoft Access and Access Basic. The
DLL is provided specifically as an aid to developers who
need additional data definition information not provided
in the Microsoft Access retail documentation. As with any
DLL, passing an incorrect argument type or value could
result in general-protection fault (GPF) errors. If this
happens, check your arguments carefully. You can use the
MSADDL11.BAS include file to declare functions. This
utility is not supported by Microsoft; you should save
your work frequently to avoid loss of data.

For function descriptions, please see MSADDL10.TXT. Table
1 lists the functions provided by MSADDL10.DLL.

NOTE: You can use these functions only with Microsoft
Access databases and tables, and not with any other
databases or tables.

MSADDL11 is one of several samples and tools that
demonstrate what other developers have done with Microsoft
Access databases. These tools have not been tested,
although some of them have been around for a while. The
Microsoft Access tools are not supported by Microsoft
Product Support Services (PSS) or on CompuServe(R); please
use these tools at your own risk.

MSADDL11 was built and tested under Microsoft Access
version 1.1.

KEYWORDS: CD4

=============================================================================

****
**** The OUTPUTAS sample can be downloaded from the
**** file 4-86.zip in the moresamp directory
****

OUTPUTAS: Saves Microsoft Access Reports in BIFF, RTF, and
ASCII Formats

OUTPUTAS is an extension to Microsoft Access(R) that
allows you to save report output in text files, in a
Microsoft(R) Excel spreadsheet, or in Microsoft Word
document format.

Rather than previewing or printing a report in Microsoft
Access, you may want to save it in a file format that can
be read by another program (for example, by a spreadsheet
application or a word-processor). OUTPUTAS adds the Save
Report As command to the Help menu in your copy of
Microsoft Access. This command allows you to create the
following file formats:

>  BIFF (binary interchange file format; Microsoft Excel
version 3 and later)

>  RTF (rich text format; Microsoft standard document
interchange)

>  ASCII (American standard code for information
interchange; text-only format)

To add the Save Report As command to your copy of
Microsoft Access:

1.  Copy OUTPUTAS.DLL to your Microsoft Access
installation directory or to your Windows directory.

2.  Copy OUTPUTAS.MDA to your Microsoft Access
installation directory.

3.  Open the MSACCESS.INI file from your Windows
directory, and add the following option to the [Libraries]
section:

>c:\MyMicrosoftAccessDirectory\outputas.mda=ro

4.  Create a new section in the MSACCESS.INI file with the
following information:

[Menu Add-Ins]
Save Report As==SaveReportAs()

Note that you must enter two equal signs.

5.  Restart Microsoft Access.

See the OUTPUTAS.TXT file for usage instructions.

OUTPUTAS is one of several samples and tools that
demonstrate what other developers have done with Microsoft
Access databases. These tools have not been tested,
although some of them have been around for a while. The
Microsoft Access tools are not supported by Microsoft
Product Support Services (PSS) or on CompuServe(R); please
use these tools at your own risk.

OUTPUTAS was built and tested under Microsoft Access
version 1.0.

KEYWORDS: CD4


=============================================================================

****
**** The RMTDDL sample can be downloaded from the
**** file 4-87.zip in the moresamp directory
****

RMTDDL: Uses SPT.DLL to Connect to SQL Server

RMTDDL is a tool that provides remote data definition
using Microsoft SQL Server. RMTDDL is based on the SPT
dynamic-link library (DLL). To use RMTDDL, log into the
RMTDDL.MDB database, minimize the SPT form that is
displayed, open the form called DDL, and you're on your
way to creating tables and indexes with SQL Server.

RMTDDL is one of several samples and tools that
demonstrate what other developers have done with Microsoft
Access(R) databases. These tools have not been tested,
although some of them have been around for a while. The
Microsoft Access tools are not supported by Microsoft
Product Support Services (PSS) or on CompuServe(R); please
use these tools at your own risk.

RMTDDL was built and tested under Microsoft Access version
1.0.

KEYWORDS: CD4

=============================================================================

****
**** The SQLPASS sample can be downloaded from the
**** file 4-88.zip in the moresamp directory
****

DEMOSPT 1.0: Passes SQL Commands to SQL Back-End Via ODBC

DEMOSPT.MDB is a Microsoft Access(R) database. It uses a
dynamic-link library (DLL) that enables Microsoft Access
Basic programmers to pass SQL commands directly to SQL
back-end databases via open database connectivity (ODBC).

DEMOSPT is one of several samples and tools that
demonstrate what other developers have done with Microsoft
Access databases. These tools have not been tested,
although some of them have been around for a while. The
Microsoft Access tools are not supported by Microsoft
Product Support Services (PSS) or on CompuServe(R); please
use these tools at your own risk.

To run DEMOSPT, copy the SPT.DLL file into your Windows
SYSTEM directory (or into the directory your system checks
for DLL files), and double-click the DEMOSPT.MDB file.

The SQL Pass-Through DLL (SPT.DLL) provides SQL support
beyond that provided by Microsoft Access linked tables.
Although linked tables cover a wide range of requirements
for transparent access to remote data (including binding
Microsoft Access form, report, and query objects directly
to remote tables and views and performing local-remote
joins), linked tables don't support functionality such as
executing row-returning stored procedures, remote DDL, and
back-end-specific SQL. SPT.DLL provides these
capabilities. The DLL requires Microsoft Access and ODBC.

SPT.DLL allows an Access Basic programmer to pass back-end-
specific (possibly row-returning) SQL strings to an SQL
processing back-end. In other words, the DLL is simply a
link between Microsoft Access and ODBC. ODBC is a
specification that defines a call-level interface, or set
of function calls, for applications. The interface enables
communication between an application and one or more
database management systems. Note that SPT.DLL doesn't
parse the passed string. For example, it doesn't check to
see if a called function is actually supported by the back-
end. The assumption is that users of this DLL will know
the type of back-end they are connected to and the
specific version of SQL that the back-end uses. The
Message table documents any errors.

SPT.DLL contains four functions: one establishes a
connection with a remote database; one terminates that
connection; a third performs the SQL pass-through and
deals with any returned items or messages; and a fourth
returns the last error. This last function is provided in
case an error occurs before the Message table can be
created. SPT.DLL creates two types of tables in Microsoft
Access: Message tables and Result tables.

In the course of establishing links and running SQL and
stored procedures, errors and application-specific
messages originate from the remote server itself, from
Microsoft Access, and from ODBC. SPT.DLL inserts the text
for errors and messages in a Message table. A specific
Message table is defined for each connection. Multiple
connections may share the same Message table. Depending on
how you set the AppendMsgs argument when you make an SQL
pass-through call, you can either append new messages to
the end of the Message table with each call, or purge the
Message table with each call.

You are responsible for deleting the Message tables when
they are no longer needed. For more information on Message
tables, see the SPTDESCR.TXT file.

DEMOSPT was built and tested under Microsoft Access
version 1.0.

KEYWORDS: CD4

=============================================================================

****
**** The SQLPASS2 sample can be downloaded from the
**** file 4-89.zip in the moresamp directory
****

DEMOSPT 1.1: Passes SQL Commands to SQL Back-End Via ODBC

DEMOSPT.MDB is a Microsoft Access(R) database. It uses a
dynamic-link library (DLL) that enables Microsoft Access
Basic programmers to pass SQL commands directly to SQL
back-end databases via open database connectivity (ODBC).

DEMOSPT is one of several samples and tools that
demonstrate what other developers have done with Microsoft
Access databases. These tools have not been tested,
although some of them have been around for a while. The
Microsoft Access tools are not supported by Microsoft
Product Support Services (PSS) or on CompuServe(R); please
use these tools at your own risk.

To run DEMOSPT, copy the SPT.DLL file into your Windows
SYSTEM directory (or into the directory your system checks
for DLL files), and double-click the DEMOSPT.MDB file.

The SQL Pass-Through DLL (SPT.DLL) provides SQL support
beyond that provided by Microsoft Access linked tables.
Although linked tables cover a wide range of requirements
for transparent access to remote data (including binding
Microsoft Access form, report, and query objects directly
to remote tables and views and performing local-remote
joins), linked tables don't support functionality such as
executing row-returning stored procedures, remote DDL, and
back-end-specific SQL. SPT.DLL provides these
capabilities. The DLL requires Microsoft Access and ODBC.

SPT.DLL allows an Access Basic programmer to pass back-end-
specific (possibly row-returning) SQL strings to an SQL
processing back-end. In other words, the DLL is simply a
link between Microsoft Access and ODBC. ODBC is a
specification that defines a call-level interface, or set
of function calls, for applications. The interface enables
communication between an application and one or more
database management systems. Note that SPT.DLL doesn't
parse the passed string. For example, it doesn't check to
see if a called function is actually supported by the back-
end. The assumption is that users of this DLL will know
the type of back-end they are connected to and the
specific version of SQL that the back-end uses. The
Message table documents any errors.

SPT.DLL contains four functions: one establishes a
connection with a remote database; one terminates that
connection; a third performs the SQL pass-through and
deals with any returned items or messages; and a fourth
returns the last error. This last function is provided in
case an error occurs before the Message table can be
created. SPT.DLL creates two types of tables in Microsoft
Access: Message tables and Result tables.

In the course of establishing links and running SQL and
stored procedures, errors and application-specific
messages originate from the remote server itself, from
Microsoft Access, and from ODBC. SPT.DLL inserts the text
for errors and messages in a Message table. A specific
Message table is defined for each connection. Multiple
connections may share the same Message table. Depending on
how you set the AppendMsgs argument when you make an SQL
pass-through call, you can either append new messages to
the end of the Message table with each call, or purge the
Message table with each call.

You are responsible for deleting the Message tables when
they are no longer needed. For more information on Message
tables, see the SPTDESCR.TXT file.

DEMOSPT was built and tested under Microsoft Access
version 1.1.

KEYWORDS: CD4

=============================================================================

****
**** The TOOLS sample can be downloaded from the
**** file 7-5.zip in the moresamp directory
****

TOOLS: Development Tools for Microsoft Access

The TOOLS directory contains a collection of development
tools for the Microsoft Access(R) database developer,
including the Color Builder (a color picker) and Macro
Builders (a utility that allows users to open a new macro
directly from the properties sheet).

These tools demonstrate what other developers have done
with Microsoft Access databases. These tools have not been
tested, although some of them have been around for a
while. The Microsoft Access tools are not supported by
Microsoft Product Support Services (PSS) or on
CompuServe(R); please use these tools at your own risk.

To install the Microsoft Access tools, place TOOLS.MDA in
the library section; don't make this file read-only.

To invoke the Color Builder, press SHIFT+F2 on any color
property. This key combination brings up the window's
color picker with default and custom colors. Custom colors
are stored in the library and remembered across sessions.

To invoke the Macro Builders, press SHIFT+F2 on any macro
property of a form or control (for example, On Open). This
key combination opens the correct macro for editing.

These tools were built and tested under Microsoft Access
version 1.0.

KEYWORDS: CD4

=============================================================================

****
**** The XVTWIZ sample can be downloaded from the
**** file 4-90.zip in the moresamp directory
****

XVTWIZ: Demonstrates CrosstabWizard for a Query

XVTWIZ is a CrosstabWizard that leads you through the
steps of creating a crosstab query.

XVTWIZ is one of several samples and tools that
demonstrate what other developers have done with Microsoft
Access(R) databases. These tools have not been tested,
although some of them have been around for a while. The
Microsoft Access tools are not supported by Microsoft
Product Support Services (PSS) or on CompuServe(R); please
use these tools at your own risk.

To install XVTWIZ:

1.  Copy XVTWIZ.MDA to your Microsoft Access installation
directory.

2.  Open the MSACCESS.INI file from your Windows(TM)
directory, and add the following line to the [Libraries]
section:

xvtwiz.mda=ro

3.  Create a new section in the MSACCESS.INI file with the
following information:

[Menu Add-Ins]
C&rosstab Wizard==xw_AddInStartup()

Note that you must enter two equal signs.

4.  Restart Microsoft Access.

XVTWIZ was built and tested under Microsoft Access version
1.0.

KEYWORDS: CD4

=============================================================================

****
**** The BITMAP sample can be downloaded from the
**** file 5-1.zip in the sdksamp directory
****


BITMAP: Draws and Manipulates Bitmaps in Menus and in
Client Windows

BITMAP demonstrates creating, loading, and stretching
bitmaps. It also shows how to change the foreground and
background of a bitmap using raster operations, how to
trap mouse messages, and how to display bitmaps in menus.

BITMAP draws a dog, a cat, or a multi-colored box bitmap,
according to the selection on the Bitmap menu. The Pattern
menu updates the background of the client window to black,
white, zigzag pattern, or crosshatch pattern. The Mode
menu sets the foreground and background of the next
displayed bitmap to white-on-black, black-on-white, or
color-on-color.

To display the selected bitmap, click the right mouse
button in the BITMAP main window. To display the bitmap in
a different size, click and drag with the left mouse
button to define a region. The bitmap is stretched or
compressed to fit the region when you release the mouse
button.

BITMAP was built and tested under Microsoft(R) Windows(TM)
version 3.1.

KEYWORDS: outline; bmp; MoveTo; LineTo; CreatBitmap;
LoadBitmap; BitBlt; PatBlt; StretchBlt; SetStretchBltMode;
CreateSolidBrush; CreateCompatibleBitmap;
CreatePatternBrush; CreateCompatibleDC; SelectObject;
GetObject; CreateMenu; GetMenu; AppendMenu; ModifyMenu;
CheckMenuItem; PostQuitMessage; SetRectEmpty;
GetClientRect; WM_ERASEBKGND; WM_LBUTTONUP; WM_RBUTTONUP;
WM_MOUSEMOVE; SetCapture

TAGS:

=============================================================================

****
**** The BLANDMDI sample can be downloaded from the
**** file 5-2.zip in the sdksamp directory
****


BLANDMDI: Skeleton MDI Sample Application

BLANDMDI demonstrates the minimum amount of source code
required to create a multiple document interface (MDI)
application. (The MULTIPAD sample application demonstrates
a more complex MDI application with editing capabilities.)

BLANDMDI's File New command creates a new document window.
The Window menu provides commands for tiling or cascading
document windows, arranging icons, and closing all
document windows. A list of document windows, with the
active window indicated by a check mark, appears after all
other Window menu items.

BLANDMDI was built and tested under Microsoft(R)
Windows(TM) version 3.1.

KEYWORDS: MDI; DefMDIChildProc; WM_MDITILE; WM_MDICASCADE;
WM_MDIICONARRANGE; WM_MDIDESTROY; MDICREATESTRUCT;
TranslateMDISysAccel; DefFrameProc;

TAGS:

=============================================================================

****
**** The BOUNCER sample can be downloaded from the
**** file 5-3.zip in the sdksamp directory
****

BOUNCER: Screen Saver that Bounces Bitmaps Across the
Screen with Sound Effects

BOUNCER is a sample screen-saver application that bounces a 
bitmap across the screen and produces a sound when the 
bitmap image is at the bottom of the screen. BOUNCER 
demonstrates loading a device-independent bitmap (DIB) 
image, creating a timer to move the image, moving the image 
across the screen, and reading initial settings from 
WIN.INI.

BOUNCER handles the following command-line switches for 
debugging the screen-saver application:

>  /c, -c, or c:  Display configuration dialog box and 
return.

>  /s, -s, or s:  Start screen saver.

>  Default:  Display configuration dialog box and return.

When BOUNCER starts, it displays a dialog box with default 
values for the time interval, initial x position, initial y 
position, initial x velocity, gravity, bouncing sound, and 
pause at the bottom of the screen. The user can modify 
these options.

BOUNCER was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The CDDEMO sample can be downloaded from the
**** file 5-4.zip in the sdksamp directory
****

CDDEMO: Illustrates Common Dialog Boxes in COMMDLG.DLL

CDDEMO implements the common dialog boxes: File Open, File 
Save, Find, Find and Replace, Colors, Fonts, and Print. You 
can access each dialog box from the Common Dialogs menu. 
CDDEMO only displays the selected dialog box; it does not 
demonstrate the function of the dialog box. For example, it 
displays the common File Open dialog box, but does not open 
a file.

For more information, see the Microsoft(R) Windows(TM) 
version 3.1 Software Development Kit (SDK) "Programmer's 
Reference, Volume 1: Overview" manual. 

CDDEMO was built and tested under Microsoft Windows version 
3.1.

=============================================================================

****
**** The CLIDEMO sample can be downloaded from the
**** file 5-5.zip in the sdksamp directory
****

CLIDEMO: Illustrates an OLE Client Application

CLIDEMO is a sample object linking and embedding (OLE) 
client application that works with the SRVRDEMO sample 
server application to demonstrate the use of OLECLI.DLL and 
OLESRV.DLL. The first step in using these applications is 
to run CLIDEMO.

Note: SRVRDEMO does not register itself with the 
registration database. Please see the SRVRDEMO abstract for 
information on registering the server.

For instructions on using CLIDEMO, see the CLIDEMO.TXT 
file. For more information on OLE client applications, see 
the Microsoft(R) Windows(TM) version 3.1 Software 
Development Kit (SDK) "Programmer's Reference, Volume 1: 
Overview" manual.

CLIDEMO was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The CROPDIB sample can be downloaded from the
**** file 5-6.zip in the sdksamp directory
****

CROPDIB: Manipulates DIB Pixel Data and DIB Palette Data

CROPDIB is a Microsoft Microsoft(R) Windows(TM) with 
Multimedia Extensions sample application that crops and 
manipulates a series of device-independent bitmaps (DIBs).

CROPDIB uses the DIB driver, although the DIB driver is the 
only multimedia component that it demonstrates. CROPDIB 
contains many useful functions for manipulating DIB pixel 
data and DIB palette data. It also demonstrates DIB driver 
caching to avoid reloading.

CROPDIB reads a single input file or a series of input 
files containing one or more DIBs. You can brighten a DIB 
by incrementing the palette entries. CROPDIB outputs to a 
single DIB output file or to a series of DIB output files.

CROPDIB was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The DBWIN sample can be downloaded from the
**** file 5-7.zip in the sdksamp directory
****


DBWIN: Traps Debug Strings and RIPs Without Debug Terminal

Revised: November 24, 1992

DBWIN uses TOOLHELP.DLL to trap all calls to the
OutputDebugString function and to all FatalExit events.
Normally, text from these events is sent to the AUX port.
If no device is connected to AUX, the infamous "Can't read
from device AUX" message is displayed. DBWIN traps these
events and either directs the text to a window, to a
secondary monochrome monitor, or to a COMM port or
completely ignores the message, thus eliminating the need
to attach a debugging terminal to the COMM port.

When running the debugging version of the Microsoft(R)
Windows(TM) graphical environment, having DBWIN run all
the time is extremely useful. You can monitor the
diagnostic messages DBWIN traps to see when your
application or the system encounters problems.

DBWIN also demonstrates the use of TOOLHELP to trap
debugging events and messages and includes code that
displays text on a secondary monochrome monitor.

For further information on DBWIN and its functions, see
the DBWIN.TXT and DBAPI.TXT files. For more information on
TOOLHELP, see the Microsoft Windows version 3.1 Software
Development Kit (SDK) "Programmer's Reference, Volume 1:
Overview" manual.

DBWIN was built and tested under Microsoft Windows version
3.1.

KEYWORDS:NotifyRegister;

TAGS:

=============================================================================

****
**** The DDE sample can be downloaded from the
**** file 5-8.zip in the sdksamp directory
****

DDE CLIENT/SERVER: Illustrates the Use of the Message-Based
DDE System

The DDE CLIENT and SERVER sample applications implement a
dynamic data exchange (DDE) client and server through the
message-based system. You should use the DDE management 
library (DDEML) for all new development work with DDE.

To use the DDE message system, follow the instructions in 
the DDE.TXT file. 

The DDE CLIENT and SERVER applications were built and 
tested under Microsoft(R) Windows(TM) version 3.1.

=============================================================================

****
**** The DDEMLCL sample can be downloaded from the
**** file 5-9.zip in the sdksamp directory
****

DDEMLCL: DDE Client that Uses the DDE Management Library

DDEMLCL implements a dynamic data exchange (DDE) client 
application using the DDE management library (DDEML).

To see the messages being exchanged in the system, start up 
the Spy application, choose Options, and under Messages, 
click to deselect all check boxes except DDE. Click OK to 
close the dialog box, and choose the All Windows command 
from the Windows menu.

To use DDEMLCL, you must have a DDEML server application 
running so that a DDE conversation can take place. We will 
use the sample DDEMLCLK application as the server. Start 
DDEMLCLK and then start DDEMLCL. In the DDEMLCL window, 
choose Connect from the DDE menu. In the DDE Connect dialog 
box, enter "Clock" as the application and "System" as the 
topic. Click Connect to start a conversation with DDEMLCLK.

For additional information on using DDEMLCL, see the 
DDEMLCL.TXT file.

DDEMLCL was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The DDEMLCLK sample can be downloaded from the
**** file 5-10.zip in the sdksamp directory
****

DDEMLCLK: DDEML Server That Works with DDEMLCL

DDEMLCLK demonstrates painting in the icon area, placing 
your private data in the RC file, setting up timers, and 
creating a sample dynamic data exchange (DDE) server 
program. The WRAPPER.C module contains all the code 
necessary to handle the server side of a DDE application 
and the System topic.

When you start DDEMLCLK, it displays the current system 
time. To use DDEMLCLK as a DDE server application, you must 
start a conversation with it on the System or Time topic. 
Start the DDEMLCL application. Choose Connect from the DDE 
menu and enter "Clock" as the application and "Timer" as 
the topic. Click Connect to start a conversation with 
DDEMLCLK.

For more information, see the DDEMLCL abstract.

To use DDEMLCLK with Microsoft(R) Excel, enter in the 
following string in any cell:

=Clock|Timer!Now

Microsoft Excel displays the time it receives from 
DDEMLCLK. You may have to choose Number from the Format 
menu and select the "hh:mm:ss" format to see the seconds 
being updated.

DDEMLCLK was built and tested under Microsoft Windows(TM) 
version 3.1.

=============================================================================

****
**** The DDEMLSVR sample can be downloaded from the
**** file 5-11.zip in the sdksamp directory
****

DDEMLSVR: DDEML Server that Works with DDEMLCL

DDEMLSVR implements a dynamic data exchange (DDE) server 
application using the DDE management library (DDEML). It 
also lets you test your DDEML client application.

DDEMLSVR registers itself with DDEML at startup. After 
starting DDEMLSVR, start a DDE client application such as 
DDEMLCL. From the client application, choose Connect from 
the DDE menu and enter "Server" as the application and 
"Test" as the topic. Click Connect. DDEMLCL displays status 
information in its window. Choose DDE Start Transaction 
from DDEMLCL. Specify "Rand" as the item and "Request" as 
the transaction type. Click OK. The server window displays 
the value it receives.

Choose Change Data from the server's Options menu to change 
the value in Rand. In the client, repeat DDE Start 
Transaction with another Request of Rand. The server window 
now displays new data.

To end the conversation, choose DDE Disconnect for the 
client window or press the DELETE key.

DDEMLSVR was built and tested under Microsoft(R) 
Windows(TM) version 3.1.

=============================================================================

****
**** The DIBIT sample can be downloaded from the
**** file 5-12.zip in the sdksamp directory
****

DIBIT: Loads, Displays, and Stretches DIBs

DIBIT loads a device-independent bitmap (DIB) from a file, 
displays the DIB in the client area, and saves the DIB to a 
file. DIBIT also stretches the DIB to fit the current 
client area.

DIBIT is easy to use. Use the File menu to load and save 
the DIB. Choose SetDIBits, SetDIBitsToDevice, or 
StretchDIBits from the Options menu to specify how the DIB 
is displayed. Use the Palette menu to display the DIB using 
palette-relative RGBs or palette indexes.

DIBIT was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The DIBVIEW sample can be downloaded from the
**** file 5-13.zip in the sdksamp directory
****

DIBVIEW: Manipulates DIBs, Illustrates Printing in
Microsoft(R) Windows(TM) Versions 3.0 and 3.1

DIBVIEW provides the same functionality as SHOWDIB, but 
adds multiple document interface (MDI) capabilities, more 
modular functions, and banded printing.

The application manipulates device-independent bitmaps 
(DIBs) by loading a DIB from a file, saving a DIB, 
converting a DIB to a device-dependent bitmap (DDB) and 
vice versa, displaying a DDB or a DIB, and stretching the 
DIB to the screen or to the printer. The application also 
demonstrates extracting, creating, realizing palettes from 
DIB color tables, palette animation, copying and pasting 
from the clipboard, using common dialog boxes, installing a 
Microsoft(R) Windows(TM) hook, and displaying a system 
palette. DIBVIEW demonstrates printing in Windows versions 
3.0 and 3.1, and can toggle between using the version 3.0 
escape functions and the version 3.1 printer functions.

DIBVIEW uses a significant amount of memory. Whereas 
SHOWDIB lets the user have disk-based DIBs and read the DIB 
in small chunks, DIBVIEW keeps two copies of a bitmap in 
memory--a DIB and a DDB--at any one time.

Most menu options are self-explanatory. The Options dialog 
box lets a user change the way the currently selected 
bitmap is displayed.

DIBVIEW was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The DRAGDROP sample can be downloaded from the
**** file 5-14.zip in the sdksamp directory
****

DRAGDROP: Illustrates How to Drag File Names from the File
Manager to an Application

DRAGDROP demonstrates how to drag file names from File 
Manager into an application. To use DRAGDROP, run DRAGDROP 
and File Manager. Arrange the application windows so they 
do not overlap. Click to select a file in File Manager, 
drag the file into the DRAGDROP window, and release. 
DRAGDROP displays the path of the file. Select the 
Information menu to display the number of files dropped and 
the window coordinates of the mouse pointer where the files
were dropped.

DRAGDROP was built and tested under Microsoft(R) 
Windows(TM) version 3.1.

=============================================================================

****
**** The FONTEST sample can be downloaded from the
**** file 5-15.zip in the sdksamp directory
****


FONTEST: Demonstrates a Common Dialog for Choosing Fonts
Using ChooseFont

Revised: November 24, 1992

FONTEST lets you select fonts based on the destination
device (printer or screen), font style, font size, color,
point size, and font effects (strikeout or underline). The
ChooseFont function invokes the common dialog box for
choosing fonts.

FONTEST demonstrates the ChooseFont function using
predefined constants to set the font selection criteria
and displays current font information in the client area.
You can use the Font and Print menus to change or print
the current font information displayed on the screen.

The Font menu displays a list of initial font selection
criteria. The selected criteria determine the options and
fonts available in the ChooseFont common dialog box.
FONTEST demonstrates the following flags in the ChooseFont
function: CF_INITOLOGFONTSTRUCT, CF_PRINTERFONTS,
CF_FIXEDPITCHONLY, CF_NOSIMULATIONS, CF_LIMITSIZE,
CF_SCREENFONTS, CF_WYSIWYG, CF_EFFECTS, CF_ANSIONLY, and
CF_FORCEFONTEXIST. The Font menu contains commands that
correspond directly to these flags. The Font menu also
contains the following commands:

>  The No Whirl command demonstrates font rotation and
spinning.

>  The Set LogFont command lets you modify the LOGFONT
structure before calling the ChooseFont function.

>  The Choose Font command calls the ChooseFont function
with the combination of selected flags and the current
LOGFONT structure.

FONTEST was built and tested under Microsoft(R)
Windows(TM) version 3.1.

KEYWORDS: ChooseFont; LOGFONT; NEWFRAME; SetBkMode;
CreateFontIndirect; GetCharWidth; GetTextFace;
GetTextMetrics; GetDeviceCaps; LOGPIXELSX; EXTDEVICEMODE;
CreateFont; DM_UPDATE; DM_MODIFY; DM_ORIENTATION;
DMORIENT_PORTRAIT; DMORIENT_LANDSCAPE; DM_COPY; HFONT;
SETABORTPROC; ABORTDOC;

TAGS:

=============================================================================

****
**** The GDOSMEM sample can be downloaded from the
**** file 5-16.zip in the sdksamp directory
****

GDOSMEM: Demonstrates How a Microsoft(R) Windows(TM)
Application and an MS-DOS(R) TSR Share Global Memory

GDOSMEM communicates with the GTSR program to demonstrate a 
technique for passing data between a Microsoft(R) 
Windows(TM) application and an MS-DOS(R) terminate-and-stay-
resident (TSR) program.

GDOSMEM uses the GlobalDosAlloc and DPMI functions to 
allocate memory that a Windows-based application and an MS-
DOS TSR can both access. GDOSMEM and TDOSMEM show how to 
"sync" up protected mode and Real mode memory access and 
demonstrate protected mode concepts. GTSR is the companion 
TSR for GDOSMEM that hooks INT 60h and waits for requests 
from GDOSMEM. The memory allocated using GlobalDosAlloc is 
local to the Windows virtual machine (VM). Thus, other VMs 
cannot access this memory location. GDOSMEM also 
illustrates in-line assembly in C.

Install the TSR GTSR before loading Windows and before 
running GDOSMEM. Click on Alloc! in the GDOSMEM main window 
to allocate a tiny buffer. The client area displays the 
location of this buffer and its contents (a WORD). Clicking 
on Request! causes GDOSMEM to request the TSR to increment 
the value in the buffer and updates the results on the 
display.

GDOSMEM was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The GWAPI sample can be downloaded from the
**** file 5-17.zip in the sdksamp directory
****

GWAPI: Demonstrates Recognition Without Messages in
Microsoft(R) Windows(TM) for Pen Computing

GWAPI demonstrates how to get recognition results from 
Microsoft(R) Windows(TM) for Pen Computing without 
messages. It also shows how to register a window class in a 
dynamic link library (DLL).

GWAPI traps WM_RCRESULT messages and illustrates how an 
application can receive recognition results through a 
single call without processing random Windows messages such 
as WM_RCRESULT.

To demonstrate GWAPI, a Windows for Pen Computing 
application must create a window with a class of GRWClass.

GWAPI was built and tested under Microsoft Windows version 
3.1.

=============================================================================

****
**** The HANDLER sample can be downloaded from the
**** file 5-18.zip in the sdksamp directory
****

HANDTEST: Demonstrates Interrupt Handlers in a Microsoft(R)
Windows(TM) DLL

HANDTEST displays the number of keyboard interrupts a 
Microsoft(R) Windows(TM) application receives. HANDTEST 
calls the HANDLER dynamic link library (DLL) which, in 
turn, installs the keyboard interrupt handler.

HANDTEST demonstrates how to interface with the interrupt 
service routine (ISR) in the HANDLER DLL. It also shows how 
to install an interrupt handler, how to post a message to a 
Windows application, and how to deinstall the handler.

Run HANDTEST and press any key to initiate the 
demonstration. The ISR installed from HANDLER reports the 
number of keyboard interrupts it receives to HANDTEST.

HANDTEST was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The HELPEX sample can be downloaded from the
**** file 5-19.zip in the sdksamp directory
****

HELPEX: Illustrates How to Access a Help File from an
Application

HELPEX shows how to bring up a help file from a 
Microsoft(R) Windows(TM) application. HELPEX starts WinHelp 
with your help file, pointing to the topic that you select. 
HELPEX uses the WinHelp function with the context ID value 
and the string name.

The HELPEX.HLP file illustrates a variety of Help features. 
It demonstrates the many ways to load and use a help file.

After starting HELPEX, choose the Index command from the 
Help menu. WinHelp starts with HELPEX.HLP loaded and 
pointing to the index section of the help file. Choose the 
Help Keyboard command from the HELPEX window. WinHelp 
displays the Keyboard topic. Choose the Help Using Help 
command from the HELPEX window. WinHelp now loads the 
WINHELP.HLP file to give you information on using the 
WinHelp program. Click on the green jumps to see what it 
does.

The HC30.EXE utility in the Microsoft Windows version 3.1 
Software Development Kit (SDK) creates help files for 
Windows version 3.0 and later. Compile the HELPEX.HPJ file 
with HC30.EXE. The resulting help (HLP) file works in 
Windows version 3.1. To load the help file, start WinHelp 
from the File Manager and choose File Open.

For more information on help files, see the Microsoft 
Windows version 3.1 SDK "Programming Tools" manual.

HELPEX was built and tested under Microsoft Windows version 
3.1.

=============================================================================

****
**** The HELPHOOK sample can be downloaded from the
**** file 5-20.zip in the sdksamp directory
****

HELPHOOK: Demonstrates a Function Key Hook from a Dialog
Box

HELPHOOK sets up the F1 key to access help from a dialog 
box. It also lets you bring up a dialog box from another 
dialog box.

HELPHOOK is easy to use: Choose a command from the Dialogs 
menu to display a dialog box. From this dialog box, you can 
choose a command button to bring up another dialog box or 
press F1 to access help.

HELPEX was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The HFORM sample can be downloaded from the
**** file 5-21.zip in the sdksamp directory
****

HFORM: Demonstrates a Pen Application that Uses Different
Character Sets for Each Field

HFORM is a Microsoft(R) Windows(TM) for Pen Computing 
application that uses different character sets for each 
field. HFORM dynamically detects the presence of the pen 
extensions. If the pen extensions are available, the HFORM 
controls allow handwriting input; otherwise, they default 
to standard edit control behavior. HFORM requires 
PENWIN.DLL contained in either Microsoft Windows for Pen 
Computing or the Microsoft Windows Software Development Kit 
version 3.1.

HFORM demonstrates registering a pen-aware application, 
setting an application recognition hook, implementing 
delayed recognition, and detecting the presence of the pen 
extensions.

HFORM is a typical generic form application with several 
edit fields (name, address, city, and so on). HFORM 
registers itself as a pen-aware application so that its 
edit controls will be replaced by hedit controls.

HFORM was built with Windows version 3.1 and runs under 
Windows versions 3.0 and 3.1. In Windows version 3.0, the 
application provides edit controls but does not include 
boxed edit fields or picture fields.

When you enable the Delay Directions Recognition option, 
the inking field captures ink. When the option is disabled, 
the first tap in the field causes recognition. After that, 
the field behaves like a normal hedit control. An 
accelerator gesture (circle-D) brings up the sample dialog 
box.

For more information on HFORM, see the Microsoft Windows 
version 3.1 Software Development Kit (SDK) "Microsoft 
Windows for Pen Computing: Programmer's Reference" manual.

=============================================================================

****
**** The HOOKS sample can be downloaded from the
**** file 5-22.zip in the sdksamp directory
****

HOOKS: Uses SetWindowsHook to Install System Hooks

HOOKS uses the SetWindowsHook function to install the 
following system hooks: WH_CALLWNDPROC, WH_CBT, 
WH_GETMESSAGE, WH_JOURNALPLAYBACK, WH_JOURNALRECORD, 
WH_KEYBOARD, WH_MOUSE, WH_MSGFILTER, and WH_SYSMSGFILTER. 
The SetWindowsHook function allows message processing 
inside a dialog box or a message-box function.

When you select the System Hook command, HOOKS installs the 
system hook and displays information on the messages 
hooked.

For more information on HOOKS, see the "Microsoft(R) Windows(TM) Hooks"
technical article.

HOOKS was built and tested under Microsoft Windows version 3.1.

=============================================================================

****
**** The INPUT sample can be downloaded from the
**** file 5-23.zip in the sdksamp directory
****

INPUT: Illustrates How to Process Keyboard Input and Mouse Input

INPUT processes keyboard and mouse input. It demonstrates 
how to process the following input-related messages: 
WM_MOUSEMOVE, WM_LBUTTONDOWN, WM_LBUTTONUP, 
WM_LBUTTONDBLCLK, WM_KEYDOWN, WM_KEYUP, WM_CHAR, WM_TIMER, 
WM_HSCROLL, and WM_VSCROLL. INPUT displays x and y 
coordinates when these messages are processed and when you 
click the scroll bars and move the scroll box.

INPUT was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The INSTVER sample can be downloaded from the
**** file 5-24.zip in the sdksamp directory
****

INSTVER: Illustrates Installation Routines Using VER.DLL

INSTVER uses the VER.DLL installation routines. It 
demonstrates the use of versioning functions in a 
Microsoft(R) Windows(TM) dynamic link library (DLL) or an 
MS-DOS(R) application.

To use the routines, a Windows-based application links to 
INSTVER.DLL and an MS-DOS application links to INSTVER.OBJ. 
The Windows version of INSTVER.DLL has no user interface. 

INSTVER was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The LISTHORZ sample can be downloaded from the
**** file 5-25.zip in the sdksamp directory
****

LISTHORZ: Demonstrates Scrolling in List Boxes

LISTHORZ lets you add strings to, and delete strings from, 
a list box. The application window contains a text box, a 
list box, and Add and Delete buttons. To add a string to 
the list box, type the string into the text box and click 
Add. To delete a string from the list box, select the 
string and click Delete. If the number of strings in the 
list box exceeds the size of the list box, a vertical 
scroll bar appears. If a string is longer than the width of 
the list box, a horizontal scroll bar appears.

LISTHORZ also demonstrates horizontal and vertical list box 
scrolling. The LISTHSCR dynamic link library (DLL) can 
support any number of scrolling list boxes until it runs 
out of memory.

LISTHORZ was built and tested under Microsoft(R) 
Windows(TM) version 3.1.

=============================================================================

****
**** The LOWPASS sample can be downloaded from the
**** file 5-26.zip in the sdksamp directory
****

LOWPASS: Demonstrates Multimedia File I/O Services to Read
and Write RIFF Files

The LOWPASS sample application illustrates how to use 
multimedia file I/O services to read and write resource 
interchange file format (RIFF) files.

LOWPASS runs a simple low-pass filter over an 8-bit-per-
sample mono WAVE file. The program displays a dialog box in 
which you can enter input and output WAVE file names. When 
you click Run Filter, the program retrieves the file names 
from the dialog box, reads the waveform data from the input 
file, performs a simple low-pass filter by averaging 
adjacent samples, and writes the filtered waveform data to 
the output WAVE file. LOWPASS does not copy unknown chunks 
to the output file.

LOWPASS was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The MCITEST sample can be downloaded from the
**** file 5-27.zip in the sdksamp directory
****

MCITEST: Records and Plays Script Files

MCITEST shows how to record and play script files with 
media control interface (MCI) functions and command 
strings. It demonstrates how you can use the MCI command 
string syntax described in the Microsoft(R) Windows(TM) 
version 3.1 Software Development Kit (SDK) "Multimedia 
Programmer's Reference" manual, Appendix A.

To use MCITEST, place the cursor in the large multiline 
text box in the main window and type:

open c:\mmdata\bells.wav type WaveAudio alias test

where c:\mmdata\bells.wav is the full path of the WAV file 
you want play. The MCI Output box displays "1" and the 
Error box indicates whether the function was successful. 
Now type:

play test

to play the sound. If it does not play, your sound card may 
be set up incorrectly. After you are done, type:

close test

to close the file.

The main window also contains a Notification section that 
displays information if you append the keyword "status" to 
a command. Choose Devices from the menu bar and move the 
Open MCI Devices dialog box so it does not overlap other 
windows. In the multiline text box, type:

open WaveAudio notify

WaveAudio is now listed in the Open MCI Devices dialog box, 
and an option button is selected under Notification, based 
on the return value of the function (the Successful button 
should be selected).

Now type:

close WaveAudio notify

The Devices dialog is now empty, and the Successful button 
is selected under Notification. The Superseded button is 
set if another wave file is started before the current file 
completes execution. The Aborted button is set if a 
function is canceled before completion.

You can use the File Save command to save your script and 
File Open to play the script another time with the Go and 
Step buttons. For more information, see the Microsoft 
Windows SDK "Multimedia Programmer's Reference" manual.

MCITEST was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The MEMORY sample can be downloaded from the
**** file 5-28.zip in the sdksamp directory
****

MEMORY: Breaks an Application into Code Segments

MEMORY breaks your application into different code segments 
to demonstrate the use of memory. It illustrates how to set 
up the SEGMENTS section of your module DEF file to mark 
different segments as PRELOAD, MOVEABLE, and LOADONCALL.

To view how MEMORY splits up code segments, note the 
segment names on the C compile line after the -NT switch 
and examine the MAP file to see the code segment names. For 
further demonstration, modify the make file for MEMORY. 
Change the name used after the -NT switch, rebuild, and 
view the new MAP file.

MEMORY was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The MENU sample can be downloaded from the
**** file 5-29.zip in the sdksamp directory
****

MENU: Illustrates Sample Menus

The MENU sample application demonstrates:

>  How to use most of the menu functions 

>  How to use owner-draw menus

>  How to place a pop-up menu on the screen using 
TrackPopupMenu

>  How to create a check box in a bitmap with 
CreateCompatibleDC, CreateCompatibleBitmap, and StretchBlt

After starting MENU, choose any menu for a demonstration or 
click inside the window to display a pop-up menu.

MENU was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The MIDIMON sample can be downloaded from the
**** file 5-30.zip in the sdksamp directory
****

MIDIMON: Monitors, Records, and Displays Incoming MIDI
Information

MIDIMON is a Microsoft(R) Windows(TM) multimedia 
application that monitors, records, and displays incoming 
musical instrument digital interface (MIDI) information.

MIDIMON uses a low-level callback function to get time-
stamped MIDI input. The callback function puts the incoming 
MIDI event information (source device, time stamp, and raw 
MIDI data) in a circular input buffer and notifies the 
application by posting a MM_MIDIINPUT message. When the 
application processes the MM_MIDIINPUT message, it removes 
the MIDI event from the input buffer and puts it in a 
display buffer. The information in the display buffer is 
converted to text and displayed in a scrollable window. The 
user may choose to send incoming MIDI data to the MIDI 
Mapper. The display buffer supports filtering; the Mapper 
does not.

MIDIMON requires a MIDI board hooked up to your computer. 
The application window provides the following menus:

>  File: The Exit command stops the program. The About 
command displays copyright information.

>  Setup: The Send to MIDI Mapper command directs notes to 
the MIDI Mapper. The Save Setup command saves the current 
location and size of the display window in the MIDIMON.INI 
file.

>  Filter: You can set commands on or off for different 
channels or events.

>  Start/Stop: Toggles recording on or off.

>  Clear: Resets the display buffer, recalibrates the 
scroll bars, and updates the display.

To start MIDIMON, press a note on your MIDI device. The 
client area displays:

Timestamp Status Data1 Data2 Chan Event

>  When you play a note on the MIDI device, MIDIMON assigns 
the note a time stamp in hexadecimal notation.

>  Status identifies the channel at the end of the number.

>  Data1 is the note or key number on a piano keyboard.

>  Data2 is either 40 for on or 00 for off.

>  Chan is the channel on which the note came in. Channel 
numbers start at zero and reflect the number of channels 
your MIDI device supports.

>  Event describes what happened, for example, Note On or 
Note Off. For a list of event names, see the Filter Events 
command. When you change the channel, you get two messages--
one for the previous channel and one for the new channel. 
The Event is Pitch Bend and the Status is Ex where x is the 
channel.

MIDIMON was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The MULTIPAD sample can be downloaded from the
**** file 5-31.zip in the sdksamp directory
****

MULTIPAD: Demonstrates an MDI Application with Edit
Controls

MULTIPAD demonstrates how to implement multiple document 
interface (MDI) windows, how to print files, and how to 
give edit controls their own memory (up to 64K).

MULTIPAD is basically the Notepad application converted 
into an MDI program. When you start MULTIPAD, it displays a 
default "untitled" MDI window. The Window menu commands 
demonstrate MDI concepts such as tiling and cascading 
windows, arranging icons, and closing all open documents. 
For information on editing commands, see the Notepad Help 
file.

MULTIPAD was built and tested under Microsoft(R) 
Windows(TM) version 3.1.

=============================================================================

****
**** The MUSCROLL sample can be downloaded from the
**** file 5-32.zip in the sdksamp directory
****

MUSTEST: Custom Control Sample for Implementing a Spin Box

MUSTEST is an extension to the Microsoft(R) Windows(TM) 
interface. MUSTEST calls the dynamic link library (DLL) 
MUSCROLL.DLL that contains interface functions for the 
Windows Software Development Kit (SDK) Dialog Editor.

MUSCROLL.DLL implements a miniature scrollbar that consists 
of only scroll arrows. Because MUSCROLL is much smaller 
than a standard scrollbar, it can be placed in an edit 
control to create a spin box (for examples, see Control 
Panel's Date/Time dialog box). When you click a scroll 
arrow, MUSCROLL sends scroll messages to its associate 
window. Initially, the associate window is the parent of 
the control and can do whatever it desires with the 
messages. MUSCROLL also provides a cut-and-paste spin box 
implementation.

For a complete list of the programming interface, messages, 
and functions, see the MUSCROLL.TXT file.

MUSTEST was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The MYPAL sample can be downloaded from the
**** file 5-33.zip in the sdksamp directory
****

MYPAL: Manipulates the System Palette and the Title Bar

MYPAL demonstrates how to display the current system 
palette, capture mouse input outside the application's main 
window, change the title bar, process the HOME, END, 
PAGEUP, and PAGEDOWN keys, and process the WM_GETMINMAXINFO 
message to control the size of the window.

When you start MYPAL, the application's main window 
displays all the colors on the system palette and the title 
bar specifies the number of colors displayed.

When you click the left mouse button on a color in the 
window, the title bar reflects the index number into the 
system palette and specifies the red-green-blue (RGB) 
values for that color. Boxes at either end of the title bar 
show the color selected.

When you click the right mouse button on a color in the 
Window, the title bar reflects the index number of colors 
on the system palette, the index of the selected color on 
the system palette, the number of colors on the palette 
(PalSize), and a RasterCaps setting of 0 or 1, depending on 
whether a palette is supported.

When you drag the mouse with the right button down, the 
title bar reflects the index number and RGB values for each 
color as the pointer moves across the window. Boxes at 
either end of the title bar show each color selected.

You can use MYPAL to find the RGB values of a color 
displayed on the screen and plug those values into your 
color selector.

MYPAL was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The OWNCOMBO sample can be downloaded from the
**** file 5-34.zip in the sdksamp directory
****

OWNCOMBO: Illustrates Owner-Draw Controls

OWNCOMBO illustrates the implementation of owner-draw 
controls. It lets you create owner-draw list boxes, 
multiple-selection list boxes, combo boxes, and drop-down 
combo boxes. The Examples menu lists the types of owner-
draw controls available.

For more information, see the OWNCOMBO.TXT file.

OWNCOMBO was built and tested under Microsoft(R) 
Windows(TM) version 3.1.

=============================================================================

****
**** The OWNERB sample can be downloaded from the
**** file 5-35.zip in the sdksamp directory
****

OWNERB: lllustrates an Owner-Draw Button

OWNERB creates an owner-draw button. It demonstrates how to 
process the messages for an owner-draw button and how to 
add a 3-D look to a control. To use OWNERB, start the 
application and click the button in the main window with 
the mouse.

OWNERB was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The PALETTE sample can be downloaded from the
**** file 5-36.zip in the sdksamp directory
****

PALETTE: Displays the Current Palette

PALETTE demonstrates simple palette operations by 
displaying the current palette in a grid. PALETTE queries 
the device for palette support and size. It creates, 
selects, and realizes a logical palette using the 
Microsoft(R) Windows(TM) CreatePalette, SelectPalette, and 
RealizePalette functions. The source code calculates the 
red-green-blue (RGB) value of a given pixel at the mouse 
position using palette indexes.

To display the RGB value for a palette entry, point to the 
entry and press the left mouse button. To display the RGB 
for any pixel on the screen, click inside the Palette 
window, and then drag the pointer outside the window.

PALETTE was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The PENPAD sample can be downloaded from the
**** file 5-37.zip in the sdksamp directory
****

PENPAD: Demonstrates the Sample Custom Recognizer

PENPAD demonstrates how to load custom recognizers, how to 
redisplay raw data using the DrawPenData function, and how 
to process the WM_GLOBALRCCHANGE message. PENPAD requires 
PENWIN.DLL contained in either Microsoft Windows for Pen 
Computing or the Microsoft Windows Software Development Kit 
version 3.1.

PENPAD is a skeleton program that can recognize pen input 
using three separate recognizers: a custom recognizer, a 
shape recognizer, and the system recognizer.

PENPAD accepts pen input through the input window and sends 
the input to the system default recognizer, the sample 
custom recognizer (SREC), or the shape recognizer 
(SHAPEREC), depending on the menu option you choose.

The output from the recognizers is displayed in the Raw 
Data and Information windows. The Raw Data window displays 
the actual ink the user wrote or drew. The Information 
window displays one of the following:

>  For the system recognizer, it displays the recognized 
ANSI text.

>  For the sample custom recognizer, it displays an arrow 
indicating the direction of the input stroke (up, down, 
left, or right).

>  For the shape recognizer, it displays a "clean" image of 
the shape. Recognized shapes may be rectangles, ellipses, 
or lines.

PENPAD was built and tested under Microsoft(R) Windows(TM) 
version 3.1 and requires Microsoft Windows for Pen 
Computing.

=============================================================================

****
**** The PRNTFILE sample can be downloaded from the
**** file 5-38.zip in the sdksamp directory
****

PRNTFILE: Illustrates Printing Functions

PRNTFILE demonstrates how to open a file using the 
GetFileOpen function from COMMDLG.DLL, how to save a file 
using the GetSaveFileName function from COMMDLG.DLL, how to 
select a printer using the PrintDlg function, and how to 
print the selected file using printer Escape functions. 
PRNTFILE has the same user interface as Notepad.

PRNTFILE was built and tested under Microsoft(R) 
Windows(TM) version 3.1.

=============================================================================

****
**** The RAINBOW sample can be downloaded from the
**** file 5-39.zip in the sdksamp directory
****

RAINBOW: Illustrates Custom Controls Used in the Dialog
Editor

RAINBOW is a dynamic link library (DLL) that illustrates 
custom controls used in the Dialog Editor. To use RAINBOW, 
you must call RAINBOW's functions from a Microsoft(R) 
Windows(TM) application.

RAINBOW was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The REVERSE sample can be downloaded from the
**** file 5-40.zip in the sdksamp directory
****

REVERSE: Demonstrates Multimedia File I/O Services and
Waveform Audio Functions

REVERSE is a Microsoft(R) Windows(TM) multimedia 
application that plays a WAVE waveform audio file in 
reverse. REVERSE illustrates how to use multimedia file I/O 
services to read data from a WAVE file and how to use low-
level waveform playback functions to play the file.

To use REVERSE, start the application and enter the name of 
a WAVE file in the text box. REVERSE uses multimedia file 
I/O services to read data from the specified file. If the 
file is a proper WAVE file, REVERSE reverses the order of 
the waveform samples in the file and plays the reversed 
waveform data. To play the waveform data forward, press 
RETURN after entering the file name.

REVERSE handles only a single waveform data block. If the 
requested WAVE file does not fit within a single block, it 
is not played. The size of a single data block depends on 
available system memory.

REVERSE was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The ROTARY sample can be downloaded from the
**** file 5-41.zip in the sdksamp directory
****

ROTARY: Simulates Turning a Knob

The ROTARY sample application simulates turning a custom 
knob control. To use ROTARY, click the mouse directly on 
or near the knob. With each click, the knob "turns" and
its value increases or decreases, as indicated in units
below the knob.

ROTARY was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The SHOWDIB sample can be downloaded from the
**** file 5-42.zip in the sdksamp directory
****

SHOWDIB: Reads, Writes, and Prints a BMP and DIB Using RLE

SHOWDIB reads, writes, and prints bitmap (BMP) and device-
independent bitmap (DIB) files using run length encoding 
(RLE). SHOWDIB is another version of the DIBVIEW sample 
application and duplicates most of DIBVIEW's functionality. 
In addition, SHOWDIB shows you how to convert an OS/2(R) 
bitmap to a Microsoft(R) Windows(TM) DIB.

For more information, see the DIBVIEW abstract.

SHOWDIB was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The SHOWGDI sample can be downloaded from the
**** file 5-43.zip in the sdksamp directory
****

SHOWGDI: Provides an Interactive Way to Use GDI Functions

SHOWGDI helps you experiment with and analyze graphics 
device interface (GDI) behavior. It provides an interactive 
user interface for most GDI functions and displays the 
results on the screen. The SHOWGDI interface consists of a 
set of dialog boxes that let the user specify parameters to 
GDI functions.

Draw menu commands execute GDI graphics output functions 
using the current device context (DC) settings set in the 
General, Pen, Brush, and Text menus. The View menu controls 
the screen display. The screen shows a scaled copy of the 
actual drawing, which is drawn using a memory DC, and an 
optional grid of pixels with coordinates numbered in units 
corresponding to the memory DC's pixels. You can magnify 
the display to show the positions of individual pixels 
clearly.

SHOWGDI was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The SNOOP sample can be downloaded from the
**** file 5-44.zip in the sdksamp directory
****

SNOOP: Traps Recognition Results and Displays Best Guess

SNOOP is a pen application similar to Spy that watches and 
traps recognition results before an application can see 
them. SNOOP displays the symbol graph, the best guess of 
symbols, and raw data. SNOOP requires PENWIN.DLL contained 
in either Microsoft Windows for Pen Computing or the 
Microsoft Windows Software Development Kit version 3.1.

SNOOP demonstrates setting a systemwide recognition hook, 
processing WM_HOOKRCRESULT messages, redrawing ink exactly 
as entered using the RedisplayPenData function, and 
converting symbols to ANSI characters.

SNOOP requires Microsoft(R) Windows(TM) for Pen Computing. 
The program receives a WM_HOOKRCRESULT message whenever a 
WM_RCRESULT message is sent to an application running on 
the system. SNOOP deciphers the symbol graph, converts it 
into an ANSI string, and displays it. SNOOP also displays 
the lpsyv array or the "best guess" string of characters 
and the raw data with the same "look" as when it was 
entered.

If pen extensions are not loaded in memory, Windows 
displays an error message when you start SNOOP.

SNOOP was built and tested under Microsoft Windows version 
3.1.

=============================================================================

****
**** The SREC sample can be downloaded from the
**** file 5-45.zip in the sdksamp directory
****

PENAPP: Illustrates a Custom Pen Recognizer

PENAPP is a skeleton program that contains the minimum 
functionality for a sample recognizer. A recognizer is a 
dynamic link library (DLL) loaded at run time by a pen-
aware application.  The PENAPP sample application uses the 
SREC recognizer. PENAPP requires PENWIN.DLL contained in 
either Microsoft Windows for Pen Computing or the Microsoft 
Windows Software Development Kit version 3.1.

PENAPP inputs a single stroke of data points and calculates 
the nearest compass direction of the line formed by the 
beginning and ending points of the stroke. PENAPP then 
fills out the symbol graph using the following special 
codes:

>  syvEast: right

>  syvSouth: down

>  syvWest: left

>  syvNorth: up

>  syvDot: point

PENAPP was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The SRVRDEMO sample can be downloaded from the
**** file 5-46.zip in the sdksamp directory
****

SRVRDEMO: lllustrates an OLE Server Application

SRVRDEMO is a sample object linking and embedding (OLE) 
server application that works with the CLIDEMO sample 
client application to demonstrate the use of OLECLI.DLL and 
OLESRV.DLL.

To use SRVRDEMO, you must register it in the system 
registration database. (An OLE server usually registers 
itself during setup or initialization, but SRVRDEMO does 
not.) 

A registration file  called INI.REG exists with the SRVRDEMO sample
and can be merged with the registration database. From the Program
Manager File menu, and type the following command:

REGEDIT /S INI.REG

where INI.REG is the registration file. This command merges 
INI.REG with the registration database and allows you to 
run SRVRDEMO. 

For information on using CLIDEMO and SRVRDEMO, see the 
CLIDEMO abstract.

SRVRDEMO was built and tested under Microsoft(R) 
Windows(TM) version 3.1.

=============================================================================

****
**** The TDOSMEM sample can be downloaded from the
**** file 5-47.zip in the sdksamp directory
****

TDOSMEM: Passes Data between a Microsoft(R) Windows(TM)
Application and an MS-DOS(R) TSR

TDOSMEM communicates with the TTSR program to demonstrate a 
technique for passing data between a Microsoft(R) 
Windows(TM) application and an MS-DOS(R) terminate-and-stay-
resident (TSR) program. 

TDOSMEM calls the kernel functions AllocSelector, 
SetSelectorBase, and SetSelectorLimit and uses these 
functions to update a buffer in a global TSR program. 
Running multiple copies of TDOSMEM demonstrates how 
different instances of a Windows program can access a TSR 
program's private buffer directly.

Before you start Windows, run TTSR.EXE from the MS-DOS 
prompt to install the TSR program that TDOSMEM will call. 
After you start Windows, run the TDOSMEM program. The 
TDOSMEM main window displays the buffer address and buffer 
contents of the TSR program. Clicking on the Request menu 
causes TDOSMEM to increment a WORD value in the TSR 
program's private buffer and updates the results in the 
TDOSMEM main window.

TDOSMEM was built and tested under Microsoft Windows 
version 3.1.

=============================================================================

****
**** The THSAMPLE sample can be downloaded from the
**** file 5-48.zip in the sdksamp directory
****

THSAMPLE: Uses TOOLHELP.DLL to Display Heap Information

THSAMPLE illustrates how to walk or list the following
systemwide information: LocalHeap, GlobalHeap, FreeList, 
LRUList, ModuleList, TaskList, ClassList, and HeapInfo. It 
also lets you perform a read memory test, StackTrace test, 
GlobalEntryModule test, and memory management test.

The tool helper library (TOOLHELP.DLL) makes it easier for 
developers who work with the Microsoft(R) Windows(TM) 
version 3.1 operating system to obtain system information 
and control system activity. This dynamic link library 
streamlines the creation of Windows-hosted tools, 
specifically Windows-hosted debugging applications.

TOOLHELP.DLL is available to applications running with 
Windows versions 3.0 and later. To use TOOLHELP.DLL in an 
application, you must include the TOOLHELP.H header file in 
the application source files, link the application with 
TOOLHELP.LIB, and ensure that TOOLHELP.DLL is in the system 
path.

For more information, see the Microsoft Windows version 3.1 
Software Development Kit (SDK) "Programmer's Reference, 
Volume 1: Overview" manual.

THSAMPLE was built and tested under Microsoft Windows
version 3.1.

=============================================================================

****
**** The TIMERS sample can be downloaded from the
**** file 5-49.zip in the sdksamp directory
****

TIMERS: Creates, Modifies, and Terminates Application
Timers

TIMERS demonstrates how to create and terminate application 
timers and how to change the rate of an existing timer.

Start the TIMERS application and choose an option from the 
Timers menu to create a timer that either dispatches a 
WM_TIMER message to a window procedure or calls a callback 
timer procedure. You can set the timer to run at one of 
three speeds: 0.25, 1, or 5 seconds.

Depending on the menu option you selected, TIMERS displays 
either the number of WM_TIMER messages sent to the window 
procedure or the number of times the callback procedure was 
called and beeps with each increment. Both methods call 
TOOLHELP.DLL timer services to display the number of 
milliseconds since the start of the application and the 
start of the current virtual machine (VM). To stop the 
timer, choose Timer Stopped from the Timers menu.

TIMERS was built and tested under Microsoft(R) Windows(TM) 
version 3.1.

=============================================================================

****
**** The TTY sample can be downloaded from the
**** file 5-50.zip in the sdksamp directory
****

TTY: Demonstrates Basic Microsoft(R) Windows(TM)
Communication Functions

TTY demonstrates the Microsoft(R) Windows(TM) communication 
functions OpenComm, SetCommState, WriteComm, ReadComm, 
SetCommEventMask, GetCommEventMask, CloseComm, and the new 
Windows version 3.1 function EnableCommNotification.

TTY uses the WM_COMMNOTIFY message by either enabling the 
EV_RXFLAG event flag and the CN_EVENT notification, or by 
using CN_RECEIVE to receive trigger thresholds for 
detecting the characters received. The Windows version 3.1 
COMM.DRV posts the WM_COMMNOTIFY message to the associated 
windows when the necessary events occur. TTY performs 
simple character translation and implements a screen buffer 
for use as the I/O window.

Use the Settings menu to change the port, baud rate, data 
bits, parity, stop bits, and handshaking options (RTS/CTS, 
DTR/DSR, and XON/XOFF). After setting these communication 
options, use the Action menu to connect or disconnect the 
TTY program.

TTY was built and tested under Microsoft Windows version 
3.1.

=============================================================================

****
**** The WMFDCODE sample can be downloaded from the
**** file 5-51.zip in the sdksamp directory
****

WMFDCODE: Decodes Normal, Placeable, and CLP Metafiles

WMFDCODE decodes three types of metafiles: normal 
metafiles, "placeable" metafiles, and metafiles that are 
saved on the clipboard as CLP files. WMFDCODE enumerates 
and plays all or a specified range of records in a 
metafile.

Choose the File Open command from the WMFDCODE main window 
to read in a metafile. Select either BIRD.WMF or 
BALLON.CLP, which are provided as examples.

The View Headers command displays information on the 
metafile header, the METAFILEPICT data structure, and the 
placeable WMF header (if available). The View List command 
lists all of the records in the metafile. You can select 
and play any combination of records from the list to debug 
the contents of a metafile. The View Clear command erases 
the metafile that is currently displayed.

The Play Destination command lets you play each record to 
the screen or to a user-named metafile. The Play All 
command plays all metafile records to the selected 
destination. The Play Step command examines the contents of 
records and lets you play or skip each record. You may step 
through all records or enter a range of records in 
hexadecimal, decimal, or character format.

WMFDCODE was built and tested under Microsoft(R) 
Windows(TM) version 3.1.

=============================================================================

****
**** The EATPAGES sample can be downloaded from the
**** file 7-1.zip in the vxdsamp directory
****

Eatpages: A VxD that Consumes Physical Pages

Revised: February 1993

Eatpages is a virtual device (VxD) that demonstrates the
use of the virtual machine manager (VMM) linked list
services and page allocation services. The VxD simply
allocates half of the free physical pages at boot time and
frees the pages at system exit. This can be useful for
simulating low-memory conditions.

Eatpages uses the following VMM services:

>  _GetDemandPageInfo
>  _PageAllocate
>  _PageFree
>  List_Create
>  List_Allocate
>  List_Attach_Tail
>  List_Get_First
>  List_Get_Next
>  List_Remove
>  List_Deallocate


To build Eatpages:

You will need Microsoft(R) Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows(TM) version 3.1 Device Driver Kit
(DDK), you can build its version of Eatpages using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute Eatpages:

1.  Run EATPAGES.EXE from the MS-DOS(R) prompt before
starting Windows. When enhanced-mode Windows starts up,
the VxD will load automatically. Thus, you do not need to
modify the SYSTEM.INI file to load this VxD. Eatpages will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename EATPAGES.EXE
to EATPAGES.386 and move it to the Windows SYSTEM
subdirectory. Add the line DEVICE=EATPAGES.386 to the
[386Enh] section of the SYSTEM.INI file.

2.  Run Windows in enhanced mode. The code responsible for
self-loading the VxD is in the VXDSTUB.ASM file and is
linked into the final VxD file by the STUB 'VXDSTUB.EXE'
module definition (.DEF) file statement. When executed
from the MS-DOS prompt, the VxDStub hooks Interrupt 2Fh,
terminates, and stays resident. When Microsoft Windows
initializes itself, the TSR responds to the Interrupt 2Fh,
AX=1605h broadcast and returns a structure that causes the
VxD to be loaded. This technique is discussed in the "TSR
Support in Microsoft Windows Version 3.1" technical
article on the Microsoft Developer Network CD.

Eatpages was built and tested under Microsoft Windows
version 3.1 using Microsoft MASM versions 6.0 and 6.1 and
the tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The GENERIC sample can be downloaded from the
**** file 7-2.zip in the vxdsamp directory
****

Generic: Illustrates the Basic Structure of a VxD

Revised: February 1993

Generic illustrates the basic structure of a virtual
device (VxD). This VxD can be used as a base set of source
files for starting a VxD project. Generic can be loaded,
but it performs no function.


To build Generic:

You will need Microsoft(R) Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows(TM) version 3.1 Device Driver Kit
(DDK), you can build its version of Generic using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute Generic:

1.  Run GENERIC.EXE from the MS-DOS(R) prompt before
starting Windows. When enhanced-mode Windows starts up,
the VxD will load automatically. Thus, you do not need to
modify the SYSTEM.INI file to load this VxD. Generic will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename GENERIC.EXE to
GENERIC.386 and move it to the Windows SYSTEM
subdirectory. Add the line DEVICE=GENERIC.386 to the
[386Enh] section of the SYSTEM.INI file.

2.  Run Windows in enhanced mode. The code responsible for
self-loading the VxD is in the VXDSTUB.ASM file and is
linked into the final VxD file by the STUB 'VXDSTUB.EXE'
module definition (.DEF) file statement. When executed
from the MS-DOS prompt, the VxDStub hooks Interrupt 2Fh,
terminates, and stays resident. When Microsoft Windows
initializes itself, the TSR responds to the Interrupt 2Fh,
AX=1605h broadcast and returns a structure that causes the
VxD to be loaded. This technique is discussed in the "TSR
Support in Microsoft Windows Version 3.1" technical
article on the Microsoft Developer Network CD.

Generic was built and tested under Microsoft Windows
version 3.1 using Microsoft MASM versions 6.0 and 6.1 and
the tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The GPTRAP sample can be downloaded from the
**** file 7-3.zip in the vxdsamp directory
****

GPTrap: A VxD that Traps GP Faults

Revised: February 1993

GPTrap is a virtual device (VxD) that uses the
Hook_PM_Fault service to catch general protection (GP)
faults. When a GP fault occurs, GPTrap receives control
and executes an Interrupt 1. If execution is then
continued, control is passed to the next handler in the
fault handler chain.


To build GPTrap:

You will need Microsoft(R) Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows(TM) version 3.1 Device Driver Kit
(DDK), you can build its version of GPTrap using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute GPTrap:

1.  Run GPTRAP.EXE from the MS-DOS(R) prompt before
starting Windows. When enhanced-mode Windows starts up,
the VxD will load automatically. Thus, you do not need to
modify the SYSTEM.INI file to load this VxD. GPTrap will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename GPTRAP.EXE to
GPTRAP.386 and move it to the Windows SYSTEM subdirectory.
Add the line DEVICE=GPTRAP.386 to the [386Enh] section of
the SYSTEM.INI file.

2.  Run Windows in enhanced mode. The code responsible for
self-loading the VxD is in the VXDSTUB.ASM file and is
linked into the final VxD file by the STUB 'VXDSTUB.EXE'
module definition (.DEF) file statement. When executed
from the MS-DOS prompt, the VxDStub hooks Interrupt 2Fh,
terminates, and stays resident. When Microsoft Windows
initializes itself, the TSR responds to the Interrupt 2Fh,
AX=1605h broadcast and returns a structure that causes the
VxD to be loaded. This technique is discussed in the "TSR
Support in Microsoft Windows Version 3.1" technical
article on the Microsoft Developer Network CD.

GPTrap was built and tested under Microsoft Windows
version 3.1 using Microsoft MASM versions 6.0 and 6.1 and
the tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The VDIALOG sample can be downloaded from the
**** file 7-6.zip in the vxdsamp directory
****

VDialog: A VxD that Demonstrates How to Serialize I/O to a
Device

Revised: February 1993

VDialog is a virtual device (VxD) that demonstrates how to
serialize I/O to a device in Microsoft(R) Windows(TM)
enhanced mode. Install this VxD as described below and run
the accompanying sample programs, WINACC and DOSACC. These
two programs simply try to perform an IN instruction to a
predetermined but undefined port. VDialog protects
multiple virtual machines (VMs) from accessing (either
reading from or writing to) the port and displays a dialog
box to resolve the contention.

VDialog uses the following services:

>  Install_IO_Handler
>  Shell_Resolve_Contention
>  Enable_Local_Trapping
>  Disable_Local_Trapping


To build VDialog:

You will need Microsoft Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows version 3.1 Device Driver Kit
(DDK), you can build its version of VDialog using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute VDialog:

1.  Run VDIALOG.EXE from the MS-DOS(R) prompt before
starting Windows. When enhanced-mode Windows starts up,
the VxD will load automatically. Thus, you do not need to
modify the SYSTEM.INI file to load this VxD. VDialog will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename VDIALOG.EXE to
VDIALOG.386 and move it to the Windows SYSTEM
subdirectory. Add the line DEVICE=VDIALOG.386 to the
[386Enh] section of the SYSTEM.INI file.

2.  Run Windows in enhanced mode. The code responsible for
self-loading the VxD is in the VXDSTUB.ASM file and is
linked into the final VxD file by the STUB 'VXDSTUB.EXE'
module definition (.DEF) file statement. When executed
from the MS-DOS prompt, the VxDStub hooks Interrupt 2Fh,
terminates, and stays resident. When Microsoft Windows
initializes itself, the TSR responds to the Interrupt 2Fh,
AX=1605h broadcast and returns a structure that causes the
VxD to be loaded. This technique is discussed in the "TSR
Support in Microsoft Windows Version 3.1" technical
article on the Microsoft Developer Network CD.

3.  Open an MS-DOS box (that is, execute COMMAND.COM).

4.  Execute DOSACC.EXE in the MS-DOS box.

5.  Switch back to Windows without destroying the MS-DOS
box (that is, do not "exit").

6.  Execute WINACC.EXE, and choose Read! from its menu
bar.

7.  Admire the contention dialog box that has appeared.

Another way to generate the contention dialog is to switch
steps 4 and 6.

VDialog was built and tested under Microsoft Windows
version 3.1 using Microsoft MASM versions 6.0 and 6.1 and
the tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The VFINTD sample can be downloaded from the
**** file 7-7.zip in the vxdsamp directory
****

VFIntD: A VxD that Captures Floppy Disk Interrupts

Revised: February 1993

VFIntD, the virtual floppy interrupt device, is a VxD that
shows how to handle the virtualization of a particular
interrupt request (IRQ). This VxD provides a good base for
other VxDs that need to perform similar functions.

VFIntD uses the VPICD_Virtualize_IRQ service to allow an
application to "capture" the interrupts on IRQ6 (used by
the floppy device); this interrupt is normally global. For
example, a backup program that must access the floppy
controller hardware directly to improve performance would
"lose" interrupts to other virtual machines unless action
is taken to change the global nature of IRQ6. VFintD can
be used in this case to capture the "focus" of the floppy
device and the interrupts it generates.

VFIntD has two components: the VxD and a sample MS-DOS(R)
application. All the files that have the VFINTD filename
are part of the VxD. The MS-DOS application is called
TSTFINT; its only purpose is to capture the floppy
interrupts. The focus is not released in the sample
application, but this functionality is provided in the
VxD.

VFIntD uses the following services:

>  VPICD_Virtualize_IRQ
>  VPICD_Phys_EOI
>  VPICD_Clear_Int_Request
>  VPICD_Set_Int_Request


To build VFIntD:

You will need Microsoft(R) Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows(TM) version 3.1 Device Driver Kit
(DDK), you can build its version of VFIntD using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute VFIntD:

1.  Run VFINTD.EXE from the MS-DOS prompt before starting
Windows. When enhanced-mode Windows starts up, the VxD
will load automatically. Thus, you do not need to modify
the SYSTEM.INI file to load this VxD. VFIntD will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename VFINTD.EXE to
VFINTD.386 and move it to the Windows SYSTEM subdirectory.
Add the line DEVICE=VFINTD.386 to the [386Enh] section of
the SYSTEM.INI file.

2.  Run Windows in enhanced mode. The code responsible for
self-loading the VxD is in the VXDSTUB.ASM file and is
linked into the final VxD file by the STUB 'VXDSTUB.EXE'
module definition (.DEF) file statement. When executed
from the MS-DOS prompt, the VxDStub hooks Interrupt 2Fh,
terminates, and stays resident. When Microsoft Windows
initializes itself, the TSR responds to the Interrupt 2Fh,
AX=1605h broadcast and returns a structure that causes the
VxD to be loaded. This technique is discussed in the "TSR
Support in Microsoft Windows Version 3.1" technical
article on the Microsoft Developer Network CD.

3.  Run TSTFINT.EXE from an MS-DOS virtual machine (VM)
such as COMMAND.COM to capture the floppy interrupts.
TSTFINT will print the VxD's version number to indicate
that it has successfully communicated with the VxD.

VFIntD was built and tested under Microsoft Windows
version 3.1 using Microsoft MASM versions 6.0 and 6.1 and
the tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The VHOOK86D sample can be downloaded from the
**** file 7-8.zip in the vxdsamp directory
****

VHook86D: A VxD that Hooks Interrupt 2Fh in V86 Mode

Revised: February 1993

VHook86D is a virtual device (VxD) that demonstrates the
use of Hook_V86_Int_Chain, which is one of the virtual
machine (VM) interrupt and callback services. VHook86D
exists for demonstration purposes only; this VxD adversely
affects system performance because it hooks Interrupt 2Fh
and prints Trace_Out messages to the debugging monitor.


To build VHook86D:

You will need Microsoft(R) Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows(TM) version 3.1 Device Driver Kit
(DDK), you can build its version of VHook86D using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute VHook86D:

1.  Run VHOOK86D.EXE from the MS-DOS(R) prompt before
starting Windows. When enhanced-mode Windows starts up,
the VxD will load automatically. Thus, you do not need to
modify the SYSTEM.INI file to load this VxD. VHook86D will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename VHOOK86D.EXE
to VHOOK86D.386 and move it to the Windows SYSTEM
subdirectory. Add the line DEVICE=VHOOK86D.386 to the
[386Enh] section of the SYSTEM.INI file.

2.  Run Windows in enhanced mode and watch the debugging
display (which must be connected to COM1). The Trace_Out
messages will slow the system down to a c-r-a-w-l.

The code responsible for self-loading the VxD is in the
VXDSTUB.ASM file and is linked into the final VxD file by
the STUB 'VXDSTUB.EXE' module definition (.DEF) file
statement. When executed from the MS-DOS prompt, the
VxDStub hooks Interrupt 2Fh, terminates, and stays
resident. When Microsoft Windows initializes itself, the
TSR responds to the Interrupt 2Fh, AX=1605h broadcast and
returns a structure that causes the VxD to be loaded. This
technique is discussed in the "TSR Support in Microsoft
Windows Version 3.1" technical article on the Microsoft
Developer Network CD.

VHook86D was built and tested under Microsoft Windows
version 3.1 using Microsoft MASM versions 6.0 and 6.1 and
the tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The VIDLED sample can be downloaded from the
**** file 7-9.zip in the vxdsamp directory
****

VIdleD: A VxD that Demonstrates the Call_When_Idle Service

Revised: February 1993

VIdleD is a virtual device (VxD) that demonstrates the use
of the virtual machine manager (VMM) Call_When_Idle
primary scheduler service. VIdleD exists for demonstration
purposes only; the VxD may impair system performance
because it issues a Trace_Out call on every idle callback.


To build VIdleD:

You will need Microsoft(R) Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows(TM) version 3.1 Device Driver Kit
(DDK), you can build its version of VIdleD using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute VIdleD:

1.  Run VIDLED.EXE from the MS-DOS(R) prompt before
starting Windows. When enhanced-mode Windows starts up,
the VxD will load automatically. Thus, you do not need to
modify the SYSTEM.INI file to load this VxD. VIdleD will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename VIDLED.EXE to
VIDLED.386 and move it to the Windows SYSTEM subdirectory.
Add the line DEVICE=VIDLED.386 to the [386Enh] section of
the SYSTEM.INI file.

2.  Run Windows in enhanced mode. The code responsible for
self-loading the VxD is in the VXDSTUB.ASM file and is
linked into the final VxD file by the STUB 'VXDSTUB.EXE'
module definition (.DEF) file statement. When executed
from the MS-DOS prompt, the VxDStub hooks Interrupt 2Fh,
terminates, and stays resident. When Microsoft Windows
initializes itself, the TSR responds to the Interrupt 2Fh,
AX=1605h broadcast and returns a structure that causes the
VxD to be loaded. This technique is discussed in the "TSR
Support in Microsoft Windows Version 3.1" technical
article on the Microsoft Developer Network CD.

VIdleD was built and tested under Microsoft Windows
version 3.1 using Microsoft MASM versions 6.0 and 6.1 and
the tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The VITD sample can be downloaded from the
**** file 7-10.zip in the vxdsamp directory
****

VITD: A VxD that Simulates an Interval Timer Device

Revised: February 1993

VITD, the virtual interval timer device, is a VxD that
creates an "interval timer"--a non-existent piece of
hardware that enables programs to measure elapsed CPU time
in a virtual machine (VM). Applications communicate with
VITD the same way they communicate with real hardware
timers: through I/O ports.

VITD uses the following virtual machine manager (VMM) and
virtual timer device (VTD) services:

>  _Allocate_Device_CB_Area
>  Fatal_Memory_Error
>  Install_Mult_IO_Handlers
>  Get_VM_Exec_Time
>  Set_VM_Time_Out
>  Cancel_Time_Out
>  Get_VM_Exec_Time
>  Call_Priority_VM_Event
>  Begin_Nest_Exec
>  End_Nest_Exec
>  Exec_Int
>  VTD_Get_Interrupt_Period
>  VTD_Begin_Min_Int_Period
>  VTD_End_Min_Int_Period
>  VTD_Get_Version
>  VTD_Get_Interrupt_Period


To build VITD:

You will need Microsoft(R) Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows(TM) version 3.1 Device Driver Kit
(DDK), you can build its version of VITD using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute VITD:

1.  Run VITD.EXE from the MS-DOS(R) prompt before starting
Windows. When enhanced-mode Windows starts up, the VxD
will load automatically. Thus, you do not need to modify
the SYSTEM.INI file to load this VxD. VITD will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename VITD.EXE to
VITD.386 and move it to the Windows SYSTEM subdirectory.
Add the line DEVICE=VITD.386 to the [386Enh] section of
the SYSTEM.INI file.

2.  Run Windows in enhanced mode. The code responsible for
self-loading the VxD is in the VXDSTUB.ASM file and is
linked into the final VxD file by the STUB 'VXDSTUB.EXE'
module definition (.DEF) file statement. When executed
from the MS-DOS prompt, the VxDStub hooks Interrupt 2Fh,
terminates, and stays resident. When Microsoft Windows
initializes itself, the TSR responds to the Interrupt 2Fh,
AX=1605h broadcast and returns a structure that causes the
VxD to be loaded. This technique is discussed in the "TSR
Support in Microsoft Windows Version 3.1" technical
article on the Microsoft Developer Network CD.

3.  Create an MS-DOS virtual machine (for example, run
COMMAND.COM).

Inside the virtual machine:

4.  Run SAMPLE.EXE to set up an interval timer.

5.  Run GETCOUNT.EXE to report the current interval timer
count.

6.  Run DOSIT.EXE to register an interval timer interrupt
handler that will start an interval timer. Wait until an
interval timer interrupt occurs.

The interrupt usage, I/O addresses, status bits, and
overall functioning of VITD are documented in the
ITIMER.INC header file and the VITD.ASM source file.

VITD was built and tested under Microsoft Windows version
3.1 using Microsoft MASM versions 6.0 and 6.1 and the
tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The VKXD sample can be downloaded from the
**** file 7-11.zip in the vxdsamp directory
****

VKXD: A VxD that Simulates the ALT+ENTER Key Combination

Revised: February 1993

VKXD, the virtual keyboard extension device, is a VxD that
demonstrates how to write extensions to the virtual
keyboard device (VKD).

VKXD extends VKD by letting you use F9 as the ALT+ENTER
key combination to switch your MS-DOS(R) applications
between full-screen mode and window mode.

Warning:  The ALT+ENTER key combination causes different
actions in Microsoft(R) Windows(TM) versions 3.0 and 3.1
(for example, in the Windows 3.1 Program Manager, pressing
ALT+ENTER when a program icon is selected will bring up
the Program Item Properties dialog box). VKXD is given as
an example of using VKD services; it is not intended to be
a "perfect" implementation of a window-to-full-screen
toggle key.

VKXD uses the following VKD services:

>  VKD_Define_Hot_Key
>  VKD_Cancel_Hot_Key_State
>  VKD_Force_Keys


To build VKXD:

You will need Microsoft(R) Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows(TM) version 3.1 Device Driver Kit
(DDK), you can build its version of VKXD using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute VKXD:

1.  Run VKXD.EXE from the MS-DOS(R) prompt before starting
Windows. When enhanced-mode Windows starts up, the VxD
will load automatically. Thus, you do not need to modify
the SYSTEM.INI file to load this VxD. VKXD will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename VKXD.EXE to
VKXD.386 and move it to the Windows SYSTEM subdirectory.
Add the line DEVICE=VKXD.386 to the [386Enh] section of
the SYSTEM.INI file.

2.  Run Windows in enhanced mode. The code responsible for
self-loading the VxD is in the VXDSTUB.ASM file and is
linked into the final VxD file by the STUB 'VXDSTUB.EXE'
module definition (.DEF) file statement. When executed
from the MS-DOS prompt, the VxDStub hooks Interrupt 2Fh,
terminates, and stays resident. When Microsoft Windows
initializes itself, the TSR responds to the Interrupt 2Fh,
AX=1605h broadcast and returns a structure that causes the
VxD to be loaded. This technique is discussed in the "TSR
Support in Microsoft Windows Version 3.1" technical
article on the Microsoft Developer Network CD.

VKXD was built and tested under Microsoft Windows version
3.1 using Microsoft MASM versions 6.0 and 6.1 and the
tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The VMIOD sample can be downloaded from the
**** file 7-12.zip in the vxdsamp directory
****

VMIOD: A VxD that Monitors I/O Traffic on a Port

Revised: February 1993

VMIOD, the virtual monitor I/O device, is a VxD that
demonstrates how to call the Install_IO_Handler service to
monitor I/O traffic on a port. Although most VxDs that use
this service are designed to virtualize the I/O port,
VMIOD only monitors the port and writes to a secondary
monitor to display the port activity.

Warning:  The Microsoft(R) Windows(TM) operating system
allows only one I/O handler per port. This means that you
can't install an I/O handler on a port that is already
trapped in the system. Most of the hardware devices that
Windows knows about (keyboard, timer, video) are trapped
ports, and thus cannot be monitored by VMIOD. For a simple
demonstration of VMIOD, try 3F5, a floppy controller port.
This port was untrapped in the retail release of Windows
versions 3.0 and 3.1.

VMIOD only demonstrates I/O port trapping, not interrupt
request (IRQ) handling. See the VMIRQD sample for more
information on working with IRQs.

VMIOD uses the following virtual machine manager (VMM)
services:

>  Get_Profile_Hex_Int
>  Install_IO_Handler
>  Clear_Mono_Screen
>  Set_Mono_Cur_Pos
>  Out_Mono_String


To build VMIOD:

You will need Microsoft Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows version 3.1 Device Driver Kit
(DDK), you can build its version of VMIOD using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute VMIOD:

To use VMIOD, you must have a secondary (monochrome)
monitor on your system.

1.  Place the following lines in the [386Enh] section of
your SYSTEM.INI file:

DEBUGMONO=TRUE
VMIOD_Port=nnnn

where nnnn is the hex I/O port number to monitor (try
floppy controller port 3F5).

2.  Run VMIOD.EXE from the MS-DOS(R) prompt before
starting Windows. When enhanced-mode Windows starts up,
the VxD will load automatically. Thus, you do not need to
modify the SYSTEM.INI file to load this VxD. VMIOD will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename VMIOD.EXE to
VMIOD.386 and move it to the Windows SYSTEM subdirectory.
Add the line DEVICE=VMIOD.386 to the [386Enh] section of
the SYSTEM.INI file.

3.  Run Windows in enhanced mode. The code responsible for
self-loading the VxD is in the VXDSTUB.ASM file and is
linked into the final VxD file by the STUB 'VXDSTUB.EXE'
module definition (.DEF) file statement. When executed
from the MS-DOS prompt, the VxDStub hooks Interrupt 2Fh,
terminates, and stays resident. When Microsoft Windows
initializes itself, the TSR responds to the Interrupt 2Fh,
AX=1605h broadcast and returns a structure that causes the
VxD to be loaded. This technique is discussed in the "TSR
Support in Microsoft Windows Version 3.1" technical
article on the Microsoft Developer Network CD.

VMIOD was built and tested under Microsoft Windows version
3.1 using Microsoft MASM versions 6.0 and 6.1 and the
tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The VMIRQD sample can be downloaded from the
**** file 7-13.zip in the vxdsamp directory
****

VMIRQD: A VxD that Virtualizes a Hardware Interrupt

Revised: February 1993

VMIRQD, the virtual monitor interrupt request (IRQ)
device, is a VxD that demonstrates the virtualization of a
hardware interrupt. This VxD declares a virtual device ID
number; see the VMIRQD.INC file for the declaration.
VMIRQD works only for unvirtualized IRQs. Most of the
hardware interrupts that Windows knows about (keyboard,
timer, mouse) use IRQs that are already virtualized, and
thus cannot be monitored by this VxD. For a simple
demonstration of VMIRQD, try IRQ6, the floppy controller
IRQ. This IRQ was not virtualized in the retail release of
Windows versions 3.0 and 3.1.

VMIRQD uses the following virtual machine manager (VMM)
and virtual programmable interrupt controller device
(VPICD) services:

>  _Get_Profile_Decimal_Int
>  Clear_Mono_Screen
>  Set_Mono_Cur_Pos
>  Out_Mono_String
>  _VPICD_Virtualize_IRQ
>  _VPICD_Phys_EOI


To build VMIRQD:

You will need Microsoft(R) Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows(TM) version 3.1 Device Driver Kit
(DDK), you can build its version of VMIRQD using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute VMIRQD:

To use VMIRQD, you must have a secondary (monochrome)
monitor on your system.

1.  Place the following lines in the [386Enh] section of
your SYSTEM.INI file:

DEBUGMONO=TRUE
VMIRQD_IRQ=x

where x is the IRQ number you wish to monitor (try
floppy controller IRQ 6).

2.  Run VMIRQD.EXE from the MS-DOS(R) prompt before
starting Windows. When enhanced-mode Windows starts up,
the VxD will load automatically. Thus, you do not need to
modify the SYSTEM.INI file to load this VxD. VMIRQD will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename VMIRQD.EXE to
VMIRQD.386 and move it to the Windows SYSTEM subdirectory.
Add the line DEVICE=VMIRQD.386 to the [386Enh] section of
the SYSTEM.INI file.

3.  Run Windows in enhanced mode. The code responsible for
self-loading the VxD is in the VXDSTUB.ASM file and is
linked into the final VxD file by the STUB 'VXDSTUB.EXE'
module definition (.DEF) file statement. When executed
from the MS-DOS prompt, the VxDStub hooks Interrupt 2Fh,
terminates, and stays resident. When Microsoft Windows
initializes itself, the TSR responds to the Interrupt 2Fh,
AX=1605h broadcast and returns a structure that causes the
VxD to be loaded. This technique is discussed in the "TSR
Support in Microsoft Windows Version 3.1" technical
article on the Microsoft Developer Network CD.

VMIRQD was built and tested under Microsoft Windows
version 3.1 using Microsoft MASM versions 6.0 and 6.1 and
the tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The VMPAGES sample can be downloaded from the
**** file 7-14.zip in the vxdsamp directory
****

VMPages: A VxD that Exports a VMM Service to an
Application

Revised: February 1993

VMPages is a virtual device (VxD) that demonstrates how to
export a VxD service (in this case _GetVMPgCount) to an
application. VMPGS.EXE is an MS-DOS(R) application that
calls the application programming interface (API) that
VMPAGES exports. Although VMPages and VMPGS are very
simple and very incomplete samples, they illustrate the
essential requirements for exporting an API from a VxD to
an application.


To build VMPages:

You will need Microsoft(R) Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows(TM) version 3.1 Device Driver Kit
(DDK), you can build its version of VMPages using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute VMPages:

1.  Run VMPAGES.EXE from the MS-DOS prompt before starting
Windows. When enhanced-mode Windows starts up, the VxD
will load automatically. Thus, you do not need to modify
the SYSTEM.INI file to load this VxD. VMPages will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename VMPAGES.EXE to
VMPAGES.386 and move it to the Windows SYSTEM
subdirectory. Add the line DEVICE=VMPAGES.386 to the
[386Enh] section of the SYSTEM.INI file.

2.  Run Windows in enhanced mode under WDEB386 (or any
other debugger that traps Interrupt 01), and then run the
MS-DOS application VMPGS.EXE in a virtual machine (VM)
inside Windows.

The code responsible for self-loading the VxD is in the
VXDSTUB.ASM file and is linked into the final VxD file by
the STUB 'VXDSTUB.EXE' module definition (.DEF) file
statement. When executed from the MS-DOS prompt, the
VxDStub hooks Interrupt 2Fh, terminates, and stays
resident. When Microsoft Windows initializes itself, the
TSR responds to the Interrupt 2Fh, AX=1605h broadcast and
returns a structure that causes the VxD to be loaded. This
technique is discussed in the "TSR Support in Microsoft
Windows Version 3.1" technical article on the Microsoft
Developer Network CD.

3.  Using the debugger, examine the buffer returned after
Interrupt 01.

VMPages was built and tested under Microsoft Windows
version 3.1 using Microsoft MASM versions 6.0 and 6.1 and
the tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The VNMID sample can be downloaded from the
**** file 7-15.zip in the vxdsamp directory
****

VNMID: A VxD that Hooks the Non-Maskable Interrupt

Revised: February 1993

VNMID, the virtual non-maskable interrupt device, is a VxD
that demonstrates hooking the non-maskable interrupt
(NMI). It does not perform any actions during the NMI
except to chain to the previous handler.

VNMID uses the following virtual machine manager (VMM)
services:

>  Get_NMI_Handler_Addr
>  Set_NMI_Handler_Addr
>  Hook_NMI_Event


To build VNMID:

You will need Microsoft(R) Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows(TM) version 3.1 Device Driver Kit
(DDK), you can build its version of VNMID using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute VNMID:

1.  Run VNMID.EXE from the MS-DOS(R) prompt before
starting Windows. When enhanced-mode Windows starts up,
the VxD will load automatically. Thus, you do not need to
modify the SYSTEM.INI file to load this VxD. VNMID will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename VNMID.EXE to
VNMID.386 and move it to the Windows SYSTEM subdirectory.
Add the line DEVICE=VNMID.386 to the [386Enh] section of
the SYSTEM.INI file.

2.  Run Windows in enhanced mode. The code responsible for
self-loading the VxD is in the VXDSTUB.ASM file and is
linked into the final VxD file by the STUB 'VXDSTUB.EXE'
module definition (.DEF) file statement. When executed
from the MS-DOS prompt, the VxDStub hooks Interrupt 2Fh,
terminates, and stays resident. When Microsoft Windows
initializes itself, the TSR responds to the Interrupt 2Fh,
AX=1605h broadcast and returns a structure that causes the
VxD to be loaded. This technique is discussed in the "TSR
Support in Microsoft Windows Version 3.1" technical
article on the Microsoft Developer Network CD.

VNMID was built and tested under Microsoft Windows version
3.1 using Microsoft MASM versions 6.0 and 6.1 and the
tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The VWATCHD sample can be downloaded from the
**** file 7-16.zip in the vxdsamp directory
****

VWatchD: Illustrates the Basic Structure of a VxD

Revised: February 1993

VWatchD, the virtual watch device, demonstrates the basic
structure of a VxD. TEST.EXE is an MS-DOS(R) application
that calls the VWatchD V86 API entry.

VWatchD uses the following virtual machine manager (VMM)
services:

>  _Allocate_Device_CB_Area
>  Get_System_Time
>  Fatal_Memory_Error


To build VWatchD:

You will need Microsoft(R) Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows(TM) version 3.1 Device Driver Kit
(DDK), you can build its version of VWatchD using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute VWatchD:

1.  Run VWATCHD.EXE from the MS-DOS prompt before starting
Windows. When enhanced-mode Windows starts up, the VxD
will load automatically. Thus, you do not need to modify
the SYSTEM.INI file to load this VxD. VWatchD will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename VWATCHD.EXE to
VWATCHD.386 and move it to the Windows SYSTEM
subdirectory. Add the line DEVICE=VWATCHD.386 to the
[386Enh] section of the SYSTEM.INI file.

2.  Run Windows in enhanced mode. The code responsible for
self-loading the VxD is in the VXDSTUB.ASM file and is
linked into the final VxD file by the STUB 'VXDSTUB.EXE'
module definition (.DEF) file statement. When executed
from the MS-DOS prompt, the VxDStub hooks Interrupt 2Fh,
terminates, and stays resident. When Microsoft Windows
initializes itself, the TSR responds to the Interrupt 2Fh,
AX=1605h broadcast and returns a structure that causes the
VxD to be loaded. This technique is discussed in the "TSR
Support in Microsoft Windows Version 3.1" technical
article on the Microsoft Developer Network CD.

3.  Start an MS-DOS virtual machine (VM) and run TEST.EXE
in that VM. TEST.EXE will ask the VWatchD device when the
VM was created and report that number in milliseconds.

4.  Start another MS-DOS VM and run TEST in that VM. Note
the older "birthday" of the second VM.

You should set up a debug terminal to see the debugging
output produced by VWatchD. Run the debugging version of
WIN386.EXE.

VWatchD was built and tested under Microsoft Windows
version 3.1 using Microsoft MASM versions 6.0 and 6.1 and
the tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The VWFD sample can be downloaded from the
**** file 7-17.zip in the vxdsamp directory
****

VWFD: A VxD that Reports a VM's Windowed vs. Full-Screen
State

Revised: February 1993

VWFD is the virtual windowed/full-screen device. When
installed on a system running Microsoft(R) Windows(TM) in
enhanced mode, VWFD allows MS-DOS(R) applications to
determine whether they are running full screen or in a
window. VWFD supplies the following callback to accomplish
this:

call:  VWFD_API_Callback
entry:  BX=VMID of the virtual machine (VM) to test
exit:  AX=0 if VM is full screen

VWFD uses the following virtual machine manager (VMM)
services:

>  Allocate_Device_CB_Area
>  Hook_Device_Service
>  Get_Next_VM_Handle
>  Test_Cur_VM_Handle

TSTWF.ASM is a sample MS-DOS program that uses the VWFD
callback to find out if it is being run in a windowed or
full-screen VM. TSTWF uses the following functions:

>  Interrupt 2Fh, AX=1600h -- Determine if enhanced-mode
Windows is running.
>  Interrupt 2Fh, AX=1684h -- Get VxD function callback
address.


To build VWFD:

You will need Microsoft Macro Assembler version 6.0 or
higher, as well as some special tools and include files;
see the "VxD Tools" and "VxD Include Files" abstracts to
copy these files to your development system. Configure
your development environment as described in the "VxD-Lite
Mini-DDK" technical article on the Microsoft Developer
Network CD.

If you have the Windows version 3.1 Device Driver Kit
(DDK), you can build its version of VWFD using the DDK-
supplied MASM5.EXE (a special version of Macro Assembler
version 5.10). Note that the DDK samples require a
specific structure for the source and include
subdirectories, whereas the corresponding samples in the
"VxD-Lite Mini-DDK" utilize the INCLUDE environment
variable to give you more flexibility in structuring your
development files.


To execute VWFD:

1.  Run VWFD.EXE from the MS-DOS prompt before starting
Windows. When enhanced-mode Windows starts up, the VxD
will load automatically. Thus, you do not need to modify
the SYSTEM.INI file to load this VxD. VWFD will
automatically load each time you start Windows until you
reboot your computer; once rebooted, the stub loader is
cleared from memory and the VxD will not load.

If you prefer to have Windows load the VxD without first
executing it from the MS-DOS prompt, rename VWFD.EXE to
VWFD.386 and move it to the Windows SYSTEM subdirectory.
Add the line DEVICE=VWFD.386 to the [386Enh] section of
the SYSTEM.INI file and restart Windows.

2.  Run Windows in enhanced mode. The code responsible for
self-loading the VxD is in the VXDSTUB.ASM file and is
linked into the final VxD file by the STUB 'VXDSTUB.EXE'
module definition (.DEF) file statement. When executed
from the MS-DOS prompt, the VxDStub hooks Interrupt 2Fh,
terminates, and stays resident. When Microsoft Windows
initializes itself, the TSR responds to the Interrupt 2Fh,
AX=1605h broadcast and returns a structure that causes the
VxD to be loaded. This technique is discussed in the "TSR
Support in Microsoft Windows Version 3.1" technical
article on the Microsoft Developer Network CD.

3.  Run an MS-DOS VM (for example, COMMAND.COM), and run
TSTWF.EXE in it. TSTWF will report whether the VM is
windowed or full-screen.

4.  Press ALT+ENTER to toggle the VM between windowed and
full-screen mode, then run TSTWF.EXE again; it should
report the opposite state.

VWFD was built and tested under Microsoft Windows version
3.1 using Microsoft MASM versions 6.0 and 6.1 and the
tools and include files provided in the "VxD-Lite Mini-
DDK."

KEYWORDS: PR-CD1; CD3 (revised)

THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS
PROVIDED "AS IS" BECAUSE WE BELIEVE IT MAY BE USEFUL TO
YOU. PLEASE DO NOT CONTACT MICROSOFT PRODUCT SUPPORT
SERVICES FOR SUPPORT OR ASSISTANCE SHOULD YOU HAVE
PROBLEMS USING THIS TOOL.

READ THE ASSOCIATED DOCUMENTATION, IF ANY, REGARDING THIS
TOOL PRIOR TO USING. ANY USE BY YOU OF THE TOOL IS AT YOUR
OWN RISK. THE TOOL IS PROVIDED FOR USE "AS IS" WITHOUT
WARRANTY OF ANY KIND. MICROSOFT AND ITS SUPPLIERS DISCLAIM
ALL WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

=============================================================================

****
**** The VXDINC sample can be downloaded from the
**** file 7-18.zip in the vxdsamp directory
****

VxD Include Files: Used for Building Virtual Devices

Revised: February 1993

These include files are needed for building virtual
devices (VxDs). Use them in conjunction with the VxD tools
(see the VxD Tools abstract). These include files are
not the same as the files supplied in the Microsoft(R)
Windows(TM) version 3.1 Device Driver Kit (DDK); they have
been modified to be compatible with Microsoft Macro
Assembler version 6.0 and higher. If you have the Windows
3.1 DDK, you can use the MASM5.EXE assembler that is
included in the DDK and do not need the "VxD-Lite Mini-
DDK" include files or sample VxDs.

Copy these include files to your hard drive in a
subdirectory of your choice. Before assembling one of the
sample VxDs, set your INCLUDE environment variable to this
directory; for example, with the following batch file
command:

set INCLUDE=c:\vxd\include;%INCLUDE%

When deciding on a directory location, keep in mind that
some VxD code (including all of the regular Windows 3.1
DDK code) assumes that the INCLUDE directory is adjacent
to the sample code subdirectories, as shown below:

Parent Directory
|
+------------------+------------------+
|                  |                  |
Sample1            Sample2            Include
1.asm              2.asm              vmm.inc
1.inc              2.inc              v86mmgr.inc
...                ...                ...

Note: The make files for the VxD samples in the "VxD-Lite
Mini-DDK" do not assume this directory structure. Instead,
they use the INCLUDE environment variable to locate the
files.

When building a VxD that uses this convention, you must do
one of the following:

>  Structure your directories according to the assumption
described above.

>  Modify the make file by changing the MASM -I option to
point to the directory location you selected for the
include file.

>  Declare a new MS-DOS(R) environment variable such as
VXDINCLUDE to point to the VxD include files, then modify
the make file so the MASM -I option uses the environment
variable as a macro. For example:

masm -I$(VXDINCLUDE) vxdstub;

>  Set the MS-DOS INCLUDE environment variable to point to
the VxD include files, then remove the MASM -I option and
let MASM find the INCLUDE directory based on the MS-DOS
INCLUDE environment variable.

For more information on using the Windows 3.1 DDK files
included on the Microsoft Developer Network CD, read the
"VxD-Lite Mini-DDK" technical article. For more
information on virtual device programming, see the
"Virtual Device Adaptation Guide" in the Windows 3.1 DDK
and read the relevant articles in the Microsoft Knowledge
Base, Microsoft Systems Journal, and the Technical
Articles sections of the Microsoft Developer Network CD.

KEYWORDS: PR-CD1; CD3 (revised)

=============================================================================

****
**** The VXDTOOLS sample can be downloaded from the
**** file 7-19.zip in the vxdsamp directory
****

VxD Tools: Used for Building Virtual Devices

Revised: February 1993

You will need these tools and Microsoft(R) Macro Assembler
version 6.0 or higher (not included) to build virtual
devices (VxDs). Use them in conjunction with the VxD
include files (see the VxD Include Files abstract). If
you have the Windows(TM) version 3.1 Device Driver Kit
(DDK), you already have these tools as well as MASM5.EXE,
which is a special version of MASM 5.10b that can assemble
32-bit flat-model code.

Copy these executable files to your hard drive in a
subdirectory specified in your MS-DOS(R) environment
variable PATH. If you have already installed the Microsoft
Windows Software Development Kit (SDK), you may copy these
files into the executable files subdirectory (by default,
WINDEV\BIN). The VxD tools include linkers and assemblers
with unique names such as LINK386.EXE, MAPSYM32.EXE, and
ADDHDR.EXE, so they will not overwrite the standard MS-DOS
and Windows SDK versions of the same utilities.

In addition to the standard development tools, the VxD
tools include a debugging version of WIN386.EXE and
symbolic information files for the debug and retail
versions:

>  WIN386D.EXE - debugging version of WIN386.EXE

>  WIN386D.SYM - symbolic information file for debugging
version

>  WIN386R.SYM - symbolic information file for retail
version

These files can be used to switch between the retail and
debugging versions of WIN386.EXE. You should use the
debugging WIN386.EXE when developing virtual devices. The
easiest way to switch between debug and retail versions is
to write batch files that copy the appropriate versions of
WIN386.EXE and WIN386.SYM from the TOOLS directory into
your Windows SYSTEM directory. Before using your batch
files for the first time, you will need to copy the retail
WIN386.EXE from your Windows SYSTEM directory to the TOOLS
directory and rename it as WIN386R.EXE. The "VxD-Lite Mini-
DDK" technical article on the Microsoft Developer Network
CD contains sample batch files to perform this switching.

For more information on using the Windows 3.1 DDK files
included on the Microsoft Developer Network CD, read the
"VxD-Lite Mini-DDK" technical article. For more
information on virtual device programming, see the
"Virtual Device Adaptation Guide" in the Windows 3.1 DDK
and read the relevant articles in the Microsoft Knowledge
Base, Microsoft Systems Journal, and the Technical
Articles sections of the Microsoft Developer Network CD.

KEYWORDS: PR-CD1; CD3 (revised)

=============================================================================

****
**** The CROSSREF technical article can be downloaded from the
**** file 8-1.zip in the vbtech directory
****

Related Articles

Created: April 19, 1993


=============================================================================

****
**** The MIXED technical article can be downloaded from the
**** file 8-2.zip in the vbtech directory
****

Building VB/COBOL/ESQL Mixed-Language Applications

Su Chin Chang

EXEC SQL BEGIN DECLARE SECTION END-EXEC

01 sql-AuID          pic x(11).

END-EXEC

(a)



DATA DIVISION. 

* Declare the global constants.

78     DONE               value 1000.

01     init-flag          pic s9(4) comp-5.


=============================================================================

****
**** The MSGBLAST technical article can be downloaded from the
**** file 8-3.zip in the vbtech directory
****

Message Blaster: Processing Messages in Visual Basic

Ed Staffin, Microsoft Consulting Services
Kyle Marsh, Microsoft Developer Network Technology Group

Created: April 30, 1993

Abstract

The Microsoft Visual Basic development environment is not based on a
message-driven programming model. Instead, Visual Basic supports a predefined
set of events for each object (form or control) that you create. An
application written in Visual Basic cannot respond to messages from Microsoft
Windows that are not handled directly by a Visual Basic event. The Message
Blaster is a Visual Basic control that addresses this restriction by allowing
you to catch and process Windows messages from Visual Basic. This article
describes how the Message Blaster works.


=============================================================================

****
**** The VBCONVNS technical article can be downloaded from the
**** file 8-4.zip in the vbtech directory
****

Visual Basic Programming Conventions from Microsoft Consulting Services


=============================================================================

****
**** The VBDLL technical article can be downloaded from the
**** file 8-5.zip in the vbtech directory
****

Extending Visual Basic with Microsoft Windows DLLs

Bob Gunderson
Microsoft Developer Network Technology Group

Created: January 18, 1993

Abstract

Microsoft Visual Basic is a very powerful and flexible tool for developing
applications for Microsoft Windows. Despite this tool's capabilities,
developers occasionally run into situations where Visual Basic either can't
solve the problem directly or the solution in Visual Basic is clumsy and
inefficient. In most cases, these problems can be solved fairly easily using
alanguage such as C or C++. Fortunately, Visual Basic allows external
functions in dynamic-linked libraries (DLLs) to be called from Visual Basic
programs. Writing your own code in C and packaging it in a DLL that can be
called by a Visual Basic program is an attractive and efficient way to extend
the capabilities of Visual Basic.

Most of the current Visual Basic documentation concerning DLLs discusses the
process of calling preexisting DLLs, specifically the native Windows
application programming interface (API). Very little documentation exists
that describes issues involving the creation of your own DLL that can be
called from Visual Basic. This technical article covers the following topics:

o  Linking to a DLL function from Visual Basic

o  Visual Basic data types as parameters

o  How to debug a DLL called from Visual Basic

o  VBFILEIO, a sample DLL that gives Visual Basic applications access to C
run-time stream input/output (I/O) functions

This technical article is written for developers who create applications for
Windows and have used languages such as C in the past. Knowledge of the
native Windows API, as well as how DLLs operate and are created, is assumed.

This technical article and the accompanying sample application were created
using Microsoft Visual Basic version 2.0 and Microsoft C/C++ version 7.0.


=============================================================================

****
**** The GRIVER2 technical article can be downloaded from the
**** file 9-1.zip in the dbtech directory
****

Developing Reusable Objects

Yair Alan Griver
Flash Creative Management Inc.

Abstract

Writing reusable code is one of the biggest opportunities for developers to
increase productivity and quality for new and existing development efforts.
This article will focus on how to write reusable objects in Microsoft FoxPro
version 2.0, paying particular attention to the use of the power tools in the
development process. We will cover the maintenance issues raised by FoxPro's
environment handling commands, and discuss how the management and use of
reusable code affects the development life cycle.


=============================================================================

****
**** The OLEDDE technical article can be downloaded from the
**** file 9-2.zip in the dbtech directory
****

OLE and DDE in FoxPro for Windows

Abstract

Object Linking and Embedding (OLE) and Dynamic Data Exchange (DDE) are two
key pieces of Microsoft Windows. OLE allows you to embed data that is
intrinsically tied to an application, such as pictures, sound, or video,
right into your FoxPro for Windows database. DDE allows you to write a FoxPro
application that communicates with other Windows-based applications
(including other FoxPro applications), for example, to send data to Microsoft
Excel for integration into a spreadsheet, or for further number crunching
before it is returned for storage in the database. This technical article
gives an overview of OLE and DDE concepts and demonstrates how these features
are exposed in FoxPro for Windows and how you might use them.


=============================================================================

****
**** The STEVMUR1 technical article can be downloaded from the
**** file 9-3.zip in the dbtech directory
****

Exploring the FoxPro 2.5 Power Tools

Steven D. Murch
Product Manager, Microsoft Database Group for Developer Relations

Created: January 15, 1993

Abstract

This article is aimed at users and developers either new to or considering
Microsoft FoxPro 2.5. After reading this article, you should have an
understanding of how to use the FoxPro Power Tools and be able to build a
simple application in FoxPro 2.5 for Windows or MS-DOS.

There are six key power tools that are the backbone of FoxPro 2.5:

o  View window: The View window provides you with an easy way to open table
files, establish relations, and set many FoxPro switches. The View window is
the master control for the interactive FoxPro user.

o  Relational Query by Example (RQBE): With RQBE and SQL, you can express
questions or actions upon data in any set of tables in a standard manner.

o  Screen Builder: Used for practically any situation involving screen input
or output, the Screen Builder (or Generator) speeds up the design process
dramatically.

o  Report Writer: Generate great-looking reports quickly.

o  Menu Builder: With the Menu Builder, you can design menus to let your
users navigate through your application quickly.

o  Project Manager: The Project Manager is the central mechanism for
unifying the elements of a FoxPro application. A FoxPro project remembers the
location of every file it contains, lets you easily access prewritten
programs and components, stores object code, tracks versions of files, and
streamlines distribution.

Time will not permit a complete examination of any one of the tools above.
My objective in this article is to introduce only the most important and
useful features in the FoxPro Power Tools, with particular emphasis on how
they can be used to piece together a FoxPro application quickly. For those
with more interest, several references are listed at the end of this article.


=============================================================================

****
**** The COMPAT technical article can be downloaded from the
**** file 10-71.zip in the wintech directory
****

Application Compatibility in Future Versions of Windows

Created: {3 {5 \*TIME \@ "MMMM d, yyyy"}5 {5 February 12, 1993}5 }3 

Abstract

This article provides guidelines for writing applications for the Microsoft
Windows version 3.x operating system in a manner that will produce the fewest
compatibility problems when the application is run on future versions of
Windows. The discussion focuses on compatibility issues involving
Windows-based applications, Windows display drivers, and MS-DOS--based
applications.


=============================================================================

****
**** The CTL3D technical article can be downloaded from the
**** file 10-4.zip in the wintech directory
****

Adding 3-D Effects to Controls

Wes Cherry, Microsoft Excel Development Group
Kyle Marsh, Microsoft Developer Network Technology Group

Created: September 23, 1992

Revised: February 1993
Added the Ctl3dDlgFramePaint function for 3-D dialog frames.
Added WM_DLGBORDER and WM_DLGSUBCLASS messages.
Added section on using CTL3D with Pascal.
Added section on using CTL3D with Visual Basic.
Color table is now correctly cleared during Ctl3dUnRegister.
CTL3D.DLL now allows up to 512 characters (used to be 256) in MessageBox.
Group box text updates now work correctly when the new text is shorter than
the old text.
CTL3D.DLL's WEP function is now in a fixed, preloaded code segment.
Added Windows NT support. Note that CTL3D32.DLL does not support combo boxes
and list boxes at this time. This will be fixed in a later release.

Revised: May 1993
Updated CTL3D.DLL to work with Microsoft Foundation Class Library.
Added Ctl3dSubclassDlgEx function to subclass all the controls on a dialog
box and the dialog box itself.
Common dialog hook functions are no longer required.
All controls on common dialog boxes are handled for Windows NT.
Added CTL3D_NODLGWINDOW constant for Ctl3dSubclassDlgEx.

Abstract

Microsoft Windows version 3.x adds three-dimensional (3-D) support for
pushbuttons, but all other controls appear two-dimensional (2-D) by default.
This article describes how an application can add 3-D effects to all controls
by using the CTL3D dynamic-link library (CTL3D.DLL).


=============================================================================

****
**** The CTLDLGED technical article can be downloaded from the
**** file 10-5.zip in the wintech directory
****

Developing Custom Controls for the Dialog Editor

Kyle Marsh
Microsoft Developer Network Technology Group

Created: October 13, 1992

Abstract

Custom controls provide a powerful mechanism for extending the functionality
of the Microsoft Windows operating system. To design applications that use
custom controls efficiently, you must ensure that the custom controls
interface with the Dialog Editor. Unfortunately, documentation on this
subject is hard to find. The information is spread over multiple books and is
unclear. This article explains how to develop custom controls that work with
the Dialog Editor, and shows that this process is actually very easy.

The article assumes that the developer already has a custom control in a
dynamic-link library (DLL), which needs an interface to the Dialog Editor.


=============================================================================

****
**** The DDLIST technical article can be downloaded from the
**** file 10-76.zip in the wintech directory
****

Rescue of the COMMDLG Bitmaps

Kraig Brockschmidt
Software Design Engineer, Microsoft Windows Developer Relations

Created: January 13, 1993

Abstract

This article discusses the implementation of an owner-drawn combo box and
list box that use the drive and folder icons from the Microsoft Windows
version 3.1 Software Development Kit (SDK).


=============================================================================

****
**** The EDITCTLS technical article can be downloaded from the
**** file 10-14.zip in the wintech directory
****

Edit Controls

Kyle Marsh
Microsoft Developer Network Technology Group

Created: January 31, 1992

Revised: October 16, 1992. Added GMEM_ZEROINIT to code in step 3 in "Edit
Controls and Memory" section.

Abstract

This article is a complete reference for edit controls. It describes all
edit control styles, messages, and notifications in more detail than those in
the Microsoft Windows versions 3.0 and 3.1 Software Development Kit (SDK)
documentation. Techniques for solving common problems with edit controls are
also described in this article.


=============================================================================

****
**** The FONTUTIL technical article can be downloaded from the
**** file 10-74.zip in the wintech directory
****

Font Utilities---Some Handy-Dandy Font-Handling Functions

Charlie Kindel, Microsoft Premier Support Services
Kyle Marsh, Microsoft Developer Network Technology Group

Created: January 10, 1993

Abstract

Handling fonts in Microsoft Windows-based applications can involve a lot of
grunt work. For example, essential tasks such as creating fonts, retrieving
point sizes, and calculating text metrics can take up a lot of the
developer's time and effort. This article describes some useful font-handling
functions that take care of most of this tedious work, thus making it easier
to create and manipulate fonts in Windows.

The FONTUTIL sample application demonstrates most of the font-handling
functions discussed in this technical article.


=============================================================================

****
**** The GETPEEK technical article can be downloaded from the
**** file 10-75.zip in the wintech directory
****

GetMessage and PeekMessage Internals

Bob Gunderson
Microsoft Developer Network Technology Group

Created: December 11, 1992

Abstract

This article explains the inner workings of GetMessage and PeekMessage and
is the foundation for a set of articles that deal with messaging and its
effect on tasking in the 16-bit MS-DOS/Microsoft Windows environment. The
following topics are discussed:

o  System and application queues

o  GetMessage and PeekMessage functions

o  PeekMessage options

o  Message filtering

o  WM_QUIT message

o  Yielding and sleeping

o  Problems with Yield

o  WaitMessage

There are significant differences between the 16-bit MS-DOS/Windows
environment and the 32-bit Win32/Windows NT environment. These differences
are not covered here, but are left as topics for future articles.


=============================================================================

****
**** The HARDWAY technical article can be downloaded from the
**** file 10-88.zip in the wintech directory
****

Developing Source-Compatible Applications for Win16, Win32s, and Win32

Kyle Marsh
Microsoft Developer Network Technology Group

Created: March 25, 1993

Abstract

This article describes the procedure for making your current Microsoft Win16
applications compatible with Win32 and Win32s. It discusses make file issues,
source code changes, and macros (message crackers and message forwarders)
that you can add to your code to facilitate the porting process.


=============================================================================

****
**** The HIERLIST technical article can be downloaded from the
**** file 10-73.zip in the wintech directory
****

Displaying a Hierarchy in a List Box

Kyle Marsh
Microsoft Developer Network Technology Group

Created: December 22, 1992

Abstract

This article explains how to create a hierarchical list box that includes
icon bitmaps and connecting lines. It describes what an application must do
to display the hierarchy and discusses some helper functions I developed
specifically to make the process easier for the application developer.
HierList, the sample application included with this article, implements a
hierarchical list box with these helper functions.


=============================================================================

****
**** The HOOKS technical article can be downloaded from the
**** file 10-19.zip in the wintech directory
****

Microsoft Windows Hooks

Kyle Marsh
Microsoft Developer Network Technology Group

Created: March 20, 1992
Revised: July 16, 1992

Abstract

This article explains the Microsoft Windows graphical environment hooks and
how to use them. Topics include Windows hook functions, filter functions, and
types of hooks:

o  WH_CALLWNDPROC

o  WH_CBT

o  WH_DEBUG

o  WH_GETMESSAGE

o  WH_HARDWARE

o  WH_JOURNALRECORD

o  WH_JOURNALPLAYBACK

o  WH_KEYBOARD

o  WH_MOUSE

o  WH_MSGFILTER

o  WH_SYSMSGFILTER


=============================================================================

****
**** The ITSYBITS technical article can be downloaded from the
**** file 10-89.zip in the wintech directory
****

ItsyBitsy: Mini Title Bars for Windows

Charlie Kindel, Microsoft Premier Support Services
Kyle Marsh, Microsoft Developer Network Technology Group

Created: February 16, 1993

Abstract

In Microsoft Windows, the standard size of a window's title bar is based on
the size of the current system font and cannot be changed. Some applications
(for example, Microsoft Visual Basic and Microsoft Excel) have toolboxes
consisting of windows with smaller title bars. This article describes how you
can use the itsybitsy functions to implement small title bars in windows.

The ItsyTest sample application demonstrates the use of the itsybitsy
functions.


=============================================================================

****
**** The LISTBOX technical article can be downloaded from the
**** file 10-22.zip in the wintech directory
****

List Box Controls

Kyle Marsh
Microsoft Developer Network Technology Group

Created: March 23, 1992

Abstract

This article is a complete reference for list box controls. It describes all
list box control styles, messages, and notifications in more detail than
found in the Microsoft Windows version 3.x Software Development Kit (SDK)
documentation.

List box controls display a list of items from which the user can choose one
or more items. List box controls can be either single column (one column of
choices) or multiple column (one or more columns of choices), single
selection (allowing only one item to be selected at a time) or multiple
selection (allowing one or more items to be selected at a time).


=============================================================================

****
**** The LISTHRZ2 technical article can be downloaded from the
**** file 10-23.zip in the wintech directory
****

Considerations for Horizontal Scroll Bars in List Boxes

Kraig Brockschmidt and Kyle Marsh
Microsoft Developer Network Technology Group

Created: March 20, 1992

Abstract

Applications can add horizontal and vertical scroll bars to list boxes that
contain items exceeding the length and width of the list box. The Microsoft
Windows graphical environment currently supports both types of scroll bars,
but vertical scroll bars are managed by the system whereas the management of
horizontal scroll bars is left to the application. This article explains how
applications can implement and control the display of horizontal scroll bars
in list boxes. It also describes functions that facilitate the management of
horizontal scroll bars and provides a sample application that illustrates
their use.


=============================================================================

****
**** The MINMAX technical article can be downloaded from the
**** file 10-26.zip in the wintech directory
****

WM_GETMINMAXINFO

Kyle Marsh
Microsoft Developer Network Technology Group

Created: March 20, 1992

Abstract

The Microsoft Windows graphical environment provides the WM_GETMINMAXINFO
message for applications to control the maximized size and position, the
maximum tracking size, and the minimum tracking size of a window.


=============================================================================

****
**** The STATBAR technical article can be downloaded from the
**** file 10-36.zip in the wintech directory
****

Implementing a Status Bar 

Kyle Marsh
Microsoft Developer Network Technology Group

Created: April 2, 1992

Abstract

A status bar is an area in a window that displays information about the
current state of the window or application. The status bar can provide a
variety of information, including descriptions of menu items, current
keyboard-initiated modes such as num lock and caps lock, and brief messages.
This article explains how to implement a 3-D status bar in the Microsoft
Windows graphical environment and how to track information placed on the
status bar.


=============================================================================

****
**** The STATICTL technical article can be downloaded from the
**** file 10-37.zip in the wintech directory
****

Static Controls

Kyle Marsh
Microsoft Developer Network Technology Group

Created: March 20, 1992

Abstract

Static controls are child windows used in Microsoft Windows-based
applications to display text, to draw frames or lines separating other
controls, or to display icons. Static controls do not accept user input and
do not send notification messages to their parent windows. This article
describes how developers can define different types of static controls and
can use text styles, frame styles, and rectangle styles to modify the
appearance of these controls.


=============================================================================

****
**** The STYLES technical article can be downloaded from the
**** file 10-39.zip in the wintech directory
****

Window Hierarchy and Styles

Kyle Marsh
Microsoft Developer Network Technology Group

Created: April 7, 1992

Abstract

This article describes the desktop, top-level, and child windows provided in
the Microsoft Windows graphical environment and their hierarchical
relationships. It explains how an application can use Windows-based functions
to navigate the window structure and to control the style and appearance of a
window on the desktop.


=============================================================================

****
**** The SUBCLASS technical article can be downloaded from the
**** file 10-40.zip in the wintech directory
****

Safe Subclassing

Kyle Marsh
Microsoft Developer Network Technology Group

Created: March 20, 1992

Abstract

This article describes subclassing, how it is done, and the rules that
should be followed to make subclassing safe. Both instance and global
subclassing are covered. Superclassing is described as an alternative to
global subclassing.


=============================================================================

****
**** The TOOLBAR technical article can be downloaded from the
**** file 10-72.zip in the wintech directory
****

Creating a Toolbar

Kyle Marsh
Microsoft Developer Network Technology Group

Created: December 31, 1992

Abstract

A toolbar consists of a row of graphical buttons, usually displayed across
the top of the application window, that give the user quick access to
frequently selected operations. A menu allows the user to choose operations
through easily understood textual commands, and also provides the keyboard
interface that Microsoft Windows-based applications require. A toolbar, on
the other hand, gives experienced users a shortcut to operations and thus
improves the usability of an application.

The toolbar is quickly becoming a standard for Windows-based applications.
The File Manager in Windows for Workgroups version 3.1 has a toolbar that is
implemented in a dynamic-link library (DLL) called COMMCTRL.DLL. The TOOLBAR
sample application included with this article shows how you can build a
toolbar that looks and works like the toolbar in the Windows for Workgroups
File Manager.


=============================================================================

****
**** The USE-CUST technical article can be downloaded from the
**** file 10-48.zip in the wintech directory
****

Using and Customizing Common Dialogs

Kraig Brockschmidt
Systems Developer Relations

Created : June 1992


=============================================================================

****
**** The VLB technical article can be downloaded from the
**** file 10-49.zip in the wintech directory
****

A Virtual List Box Implementation with VLIST

Kyle Marsh
Microsoft Developer Network Technology Group

Created: September 2, 1992

Revised: January 26, 1993 (see the "Revisions" section below for a list of
changes)

Abstract

The standard list box control in Microsoft Windows can contain a limited
number of items. Applications may need to implement list boxes that exceed
this limitation. This article introduces a custom control called VLIST, which
is a virtual list box capable of displaying millions of items. Part 1 of the
article provides instructions for using the VLIST virtual list box, and
documents the styles and messages that VLIST supports. Part 2 describes how
VLIST was implemented, and discusses the problems encountered and decisions
made during the implementation; readers who would like to modify VLIST or
implement their own virtual list box may find this section interesting. For a
working example of VLIST, see the Microsoft Developer Network CD---the topic
listing in the Index window was implemented with VLIST.


=============================================================================

****
**** The DEVENV technical article can be downloaded from the
**** file 10-10.zip in the wintech directory
****

A Flexible Development Environment

Nigel Thompson
Microsoft Developer Technology Group

Created: March 20, 1992

Abstract

The process of developing applications for the Microsoft Windows graphical
environment sometimes requires a machine that is set up with more than one
version of Windows, more than one set of tools (compilers, debuggers, and so
on), and both released versions and development versions of several
applications. This article describes techniques for establishing a correct
development environment for a particular requirement and suggests a directory
structure in which a source control system maintains one or more projects.

These suggestions are based on the system we employed at Microsoft to create
the multimedia extensions to Windows.


=============================================================================

****
**** The EXEMAP technical article can be downloaded from the
**** file 10-80.zip in the wintech directory
****

Using EXEHDR and Map Files for Developing Windows-Based Applications

David Long
Microsoft Developer Network Technology Group

Created: January 15, 1993

Abstract

This article provides ways to understand, view, and adjust an executable
file's header information. The perspective taken is from the point of view of
aprogrammer writing an application or dynamic-link library (DLL) for
Microsoft Windows. The article is divided into the following sections:

o  "Overview of Executable File Headers" introduces the structure of an
executable's file header and the information it contains.

o  "Using EXEHDR" describes how to use the EXEHDR utility to modify stack
and heap settings, verify module settings, and add EXEHDR listing files to
your make file.

o  "Generating, Understanding, and Using Map Files" discusses public symbols
listing, line number and address information, IMPORTS and EXPORTS, the
generation of map files with LINK, and the way you can use these tools to
optimize your executable's segmentation and function distribution.

o  The final section, "Using LIB to Generate a Listing File," describes how
you can track down public symbols declared by libraries and how you can
replace library modules.


=============================================================================

****
**** The FAULTS technical article can be downloaded from the
**** file 10-15.zip in the wintech directory
****

Bulletproof Functions with ToolHelper

Kraig Brockschmidt
Systems Developer Relations

Created: March 30, 1992


=============================================================================

****
**** The PPDEBUG technical article can be downloaded from the
**** file 10-79.zip in the wintech directory
****

Use Your Printer Port to Measure System Timings

Herman Rodent
Microsoft Developer Network Technology Group

Created: January 4, 1993

Abstract

If you need to measure interrupt latency, interrupt-service-routine
execution time, or procedure call overhead---or if you just plain want to
know why your application is so slow---here's an article that describes a
simple way to use a printer port and an oscilloscope to do timing
measurements.

If you don't know what an oscilloscope is, you can either stop reading now
and return to struggling with your code, or look forward to renting a new toy
to play with.


=============================================================================

****
**** The APPEXEC technical article can be downloaded from the
**** file 10-1.zip in the wintech directory
****

Launching Other Windows-Based Applications

Herman Rodent, staff rat
Microsoft Developer Network Technology Group

Created: October 22, 1992

Abstract

An application for Microsoft Windows often needs to be launched from another
Windows-based application. In addition to starting a second application,
sometimes the primary application needs to know when the second application
terminates.

This technical article discusses the following points:

o  Several ways to start applications

o  An approach to finding applications not located on the current Windows
search path

o  A method for detecting whether an application is still running

o  Using the same Windows-based techniques for starting applications for
MS-DOS

AppExec, the sample application provided with this article, contains code
that solves the problems involved in finding and starting one Windows-based
application from another, as well as determining later whether that
application is still running.


=============================================================================

****
**** The DLLINTRO technical article can be downloaded from the
**** file 10-13.zip in the wintech directory
****

Introduction to Microsoft Windows Dynamic-Link Libraries

David Long, Microsoft Developer Network Technology Group 
Dan Ruder, Microsoft Developer Support Group 

Created: August 31, 1992

Abstract

This article provides an introduction to Microsoft Windows dynamic-link
libraries (DLLs), covering the following topics:

o  What is dynamic linking?

o  Dynamic linking in Windows.

o  Advantages and disadvantages of DLLs.

o  What are DLLs used for?


=============================================================================

****
**** The DLLMECH technical article can be downloaded from the
**** file 10-81.zip in the wintech directory
****

Mechanics of Dynamic Linking

David Long, Microsoft Developer Network Technology Group
Dan Ruder, Microsoft Developer Support Engineer

Created: January 13, 1993

Abstract

This article discusses how Microsoft Windows implements dynamic linking,
covering the following topics:

o  Types of dynamic linking

o  Writing dynamic-link library (DLL) functions, including SS!=DS issues

o  Explicit dynamic linking, using LoadLibrary, GetProcAddress, and
FreeLibrary

o  Implicit dynamic linking, including the use of the Microsoft
Segmented-Executable Linker (LINK) and the Microsoft Import Library Manager
(IMPLIB) to embed dynamic-link references in executable modules,
considerations for ordinal references, the number of exports a DLL can have,
implicit operations of the kernel loader, dependencies among DLLs, the
significance of link order, intercepting application programming interface
(API) calls, and exporting variables

The sample application included with this article---CODEPEND---illustrates
inter-DLL dependencies, load and termination sequencing, module usage counts,
and instance handles for applications and DLLs.

For more information on dynamic-link libraries, read these technical
articles on the Microsoft Developer Network CD:

o  Gunderson, Bob. "Loading, Initializing, and Terminating a DLL" (Technical
Articles, Windows Articles, Kernel Articles).

o  Gunderson, Bob. "Modules, Instances, and Tasks" (Technical Articles,
Windows Articles, Kernel Articles).

o  Long, David, and Dan Ruder. "Introduction to Microsoft Windows
Dynamic-Link Libraries" (Technical Articles, Windows Articles, Kernel
Articles).


=============================================================================

****
**** The DLLSTRT1 technical article can be downloaded from the
**** file 10-90.zip in the wintech directory
****

Designing DLLs for Multiple Client Applications, Part 1: Strategy

David Long
Microsoft Developer Network Technology Group

Created: April 21, 1993

Abstract

This article and its companion, "Designing DLLs for Multiple Client
Applications, Part 2: Implementation," discuss the issues faced by anyone who
writes Microsoft Windows dynamic-link libraries (DLLs) that provide services
to multiple tasks. A Windows device driver is a prime example of such a DLL,
as are database libraries, networking software, and
interprocess-communication libraries.

This article provides a variety of techniques and strategies for
implementing a client-server architecture in a DLL, beginning with the design
of the DLL's application programming interface (API) and covering issues of
memory allocation and ownership, resource cleanup, task initialization and
termination, TOOLHELP.DLL support, and installable drivers architecture.

The companion article discusses the Grocery Shopper sample application in
detail, showing an actual implementation of one of the strategies discussed
in this article.


=============================================================================

****
**** The DLLSTRT2 technical article can be downloaded from the
**** file 10-91.zip in the wintech directory
****

Designing DLLs for Multiple Client Applications, Part 2: Implementation

David Long
Microsoft Developer Network Technology Group

Created: April 21, 1993

Abstract

This is a companion article to "Designing DLLs for Multiple Client
Applications, Part 1: Strategy," also available on the Microsoft Developer
Network CD. That article discusses various strategies for allowing Microsoft
Windows dynamic-link libraries (DLLs) to provide services to multiple client
applications.

This article describes how the associated Grocery Shopper sample application
implements some of the client-server strategies described in Part 1. It
begins with an overview of the sample application's architecture, and then
proceeds to analyze how the application programming interface (API) is
implemented, how the DLL manages multiple clients, and how information hiding
is enforced. Among the features of the sample code are registration and
unregistration APIs, enumeration callbacks, delayed resource allocation, and
custom event-notification messages.


=============================================================================

****
**** The INSTDRVR technical article can be downloaded from the
**** file 10-92.zip in the wintech directory
****

Writing an Installable Driver

David Long
Microsoft Developer Network Technology Group

Created: May 1, 1993

Abstract

This article introduces installable drivers for Microsoft Windows version
3.1. It describes the advantages of using installable drivers over standard
dynamic-link libraries (DLLs), and corrects and enhances the documentation
provided in the Windows 3.1 Software Development Kit (SDK). This article
supplements the documentation listed at the end of this article.


=============================================================================

****
**** The MTI technical article can be downloaded from the
**** file 10-27.zip in the wintech directory
****

Modules, Instances, and Tasks

Bob Gunderson
Microsoft Developer Network Technology Group

Created: March 20, 1992

Abstract

This article discusses modules, instances, and tasks. It covers the
following topics:

o  Definitions of module, instance, and task handles

o  Microsoft Windows functions that deal with these handles

o  Exporting and the MakeProcInstance function

o  Task switching and yielding


=============================================================================

****
**** The TIMER2 technical article can be downloaded from the
**** file 10-42.zip in the wintech directory
****

Timers and Timing in Microsoft Windows

Bob Gunderson
Microsoft Developer Network Technology Group

Created: March 20, 1992

Abstract

This article covers the following aspects of timers and timing in the
Microsoft Windows graphical environment:

o  How Windows-based applications set up and use timers to perform an
operation periodically

o  Limitations of timers

o  Creating and destroying timers using the SetTimer and KillTimer functions

o  How timer events are detected, recorded, and dispatched internal to
Windows

o  How standard and enhanced modes affect timers and timing 

o  How TOOLHELP.DLL can be useful to timers

o  Description of the INT 2Fh interface to the virtual timer driver
(VTD.386)


=============================================================================

****
**** The TSR-SUPP technical article can be downloaded from the
**** file 10-45.zip in the wintech directory
****

TSR Support in Microsoft Windows Version 3.1

David Long
Microsoft Developer Network Technology Group

Created: October 7, 1992

Abstract

The Microsoft Windows version 3.1 operating system includes new features and
functions that support terminate-and-stay-resident programs (TSRs). This
article describes these new capabilities and provides guidelines for writing
Windows-aware TSRs and device drivers. It explains where TSR writers can find
information and describes Windows Interrupt 2Fh services and notifications
that are not documented elsewhere. Finally, the article provides suggestions
for writing Windows-compatible expanded memory specification (EMS) or
extended memory specification (XMS) client code.

This article assumes that you are familiar with Windows Interrupt 2Fh
services and notifications. See Appendix A for a list of documents that
provide information on Interrupt 2Fh, DOS protected-mode interface (DPMI),
MS-DOS version 5.0 task switcher interface, virtual direct memory access
(DMA) services, and TSR information. Global EMS/XMS client guidelines are
provided in Appendix B.


=============================================================================

****
**** The VDRIVERS technical article can be downloaded from the
**** file 10-93.zip in the wintech directory
****

Improving Windows 3.1 Display Drivers

Herman Rodent
Microsoft Developer Network Technology Group

Created: January 25, 1993

Abstract

Video device drivers have always been a major factor in controlling the
overall performance of a Microsoft Windows system. The increasing use of
color images, animation and, more recently, motion video in applications
means that the video driver in a system is now one of its most critical
components. This article discusses how display driver writers can get the
best performance possible from their video drivers. The following points are
covered:

o  Using device-independent bitmaps (DIBs) in applications

o  Supporting StretchDIBits

o  Optimizing for the 386 processor

o  Special-casing 1:1 palettes

o  Special-casing common raster operation (ROP) codes

o  Supporting the new 16- and 32-bit-per-pixel DIB formats


=============================================================================

****
**** The VXDLITE technical article can be downloaded from the
**** file 10-50.zip in the wintech directory
****

The VxD-Lite Mini-DDK

David Long
Microsoft Developer Network Technology Group

Created: August 4, 1992
Revised: January 11, 1993

Abstract

This article introduces the tools, development files, sample sources, and
online information for developing virtual devices using the Microsoft
Developer Network VxD-Lite Mini-DDK, which is a modified subset of the
Microsoft Windows version 3.1 Device Driver Kit (DDK).

"VxD-Lite: Everything you always wanted in a DDK. And less."


=============================================================================

****
**** The WEP technical article can be downloaded from the
**** file 10-51.zip in the wintech directory
****

Loading, Initializing, and Terminating a DLL

Bob Gunderson
Microsoft Developer Network Technology Group

Created: March 20, 1992

Abstract

This article discusses loading, initializing, and terminating Microsoft
Windows dynamic-link libraries (DLLs). It covers the following topics:

o  When is a library loaded?

o  What is a library entry point (LibMain function)?

o  How is the entry point function limited?

o  What is a window exit procedure (WEP) and how is it used?

o  What are some workarounds for current problems with WEPs?

o  How is a WEP defined?

o  How are WEPs changed in Windows version 3.1?


=============================================================================

****
**** The WINFLOAT technical article can be downloaded from the
**** file 10-53.zip in the wintech directory
****

Floating-Point in Microsoft Windows

David Long
Microsoft Developer Network Technology Group

Created: August 10, 1992

Abstract

This article discusses floating-point math operations in Microsoft Windows
version 3.1, using the Microsoft Windows version 3.1 Software Development Kit
(SDK). The article assumes you have a basic understanding of how
floating-point math works on the Intel architecture. Although it is not a
tutorial on floating-point math, it covers the following subjects:

o  Windows floating-point architecture, including the virtual math
coprocessor device (VMCPD), the Windows 80x87 emulator library (WIN87EM.DLL),
and operating-system support provided by the kernel

o  Compiler and linker choices for the Microsoft C compiler

o  Detecting and disabling the math coprocessor

o  C run-time library math functions

o  Performance considerations, such as understanding speed differences and
why they exist

o  Exception handling, especially DLL issues

o  Compiling and using the WinFloat sample applications

o  Glossary of terms

o  Suggestions for further reading

o  Supplemental documentation for WIN87EM functions


=============================================================================

****
**** The 1632DIBS technical article can be downloaded from the
**** file 10-82.zip in the wintech directory
****

16- and 32-Bit-Per-Pixel DIB Formats for Windows: The Color of Things to
Come

Herman Rodent
Microsoft Developer Network Technology Group

Created: January 14, 1993

Abstract

The current version of the Microsoft Windows operating system Software
Development Kit (SDK) defines a number of formats for device-independent
bitmaps (DIBs). These formats cover 1-, 4-, 8-, and 24-bit-per-pixel images.
Microsoft has published a set of proposals for extending the existing
definitions to accommodate 16- and 32-bit-per-pixel RGB images, as well as
some new custom formats.(On the Microsoft Developer Network CD, see Product
Documentation, Microsoft Video for Windows SDK, Chapter 5, "DIB Format
Extensions for Microsoft Windows.") The new custom formats cover various
types of image compression such as the Joint Picture Experts Group (JPEG)
format, and encoding formats such as YUV. With the advent of more 16-bit
video cards has come a requirement to define a new standard for
16-bit-per-pixel DIBs.

This article focuses on the new 16- and 32-bit-per-pixel formats, discussing
the following points:

o  The evolution of existing video device technology

o  New 16- and 32-bit-per-pixel formats

o  Why the 16-bit-per-pixel format is important

o  What application writers will have to consider in using these formats

o  What device driver writers will need to include support for


=============================================================================

****
**** The BIGBIT technical article can be downloaded from the
**** file 10-2.zip in the wintech directory
****

Using True Color Devices

Ron Gery
Microsoft Developer Technology Group

Created: March 20, 1992

Abstract

This article discusses the use of devices with high color resolution (more
than 8 bit). It provides information useful to both application and device
driver writers.


=============================================================================

****
**** The DIBPAL technical article can be downloaded from the
**** file 10-11.zip in the wintech directory
****

Using DIBs with Palettes

Ron Gery
Microsoft Developer Network Technology Group

Created: March 20, 1992

Abstract

This article discusses using palettes in conjunction with DIBs
(device-independent bitmaps). It does not delve into involved uses of the
Microsoft Windows Palette Manager.


=============================================================================

****
**** The DIBS2 technical article can be downloaded from the
**** file 10-12.zip in the wintech directory
****

DIBs and Their Use

Ron Gery
Microsoft Developer Network Technology Group

Created: March 20, 1992

Abstract

This article discusses the DIB (device-independent bitmap) concept from
definition and structure to the API that uses it. Included is a small sample
application that illustrates some of the most common methods of using DIBs to
display and manipulate digital images. Functions discussed are GetDIBits,
SetDIBits, CreateDIBitmap, SetDIBitsToDevice, StretchDIBits, and
CreateDIBPatternBrush. This article does not discuss using palettes with
DIBs.


=============================================================================

****
**** The EZPRINT technical article can be downloaded from the
**** file 10-94.zip in the wintech directory
****

EZPRINT: No-Frills Printing in Visual Basic and C

Dennis Crain
Microsoft Developer Network Technology Group

Created: April 19, 1993

Abstract

Printing from applications written for the Microsoft Windows version 3.1
operating system can be trying at times. This article describes a convenient
method for printing from applications using a dynamic-link library (DLL)
called EZPRINT.DLL. EZPRINT provides three exported
functions---StartDocument, PrintObject, and EndDocument---to start the
printing job, print various objects on the page, and end the printing job.
The sample DLL code and Visual Basic code that calls EZPRINT are included
with this article. You may use the DLL as is or modify it to meet your needs.
In its present form, EZPRINT prints text, rectangles, and lines with various
attributes.

This article was written for developers who have relatively little printing
experience and whose printing needs involve text placement and simple line
drawing only. Experienced developers can also use EZPRINT as a framework for
implementing more sophisticated printing capabilities.


=============================================================================

****
**** The FLICKER technical article can be downloaded from the
**** file 10-95.zip in the wintech directory
****

Flicker-Free Displays Using an Off-Screen DC

Herman Rodent
Microsoft Developer Network Technology Group

Created: April 5, 1993

Abstract

This article describes a technique for drawing to a window device context
(DC) in such a way that the screen does not flicker. The technique is very
simple and easy to implement.


=============================================================================

****
**** The FONTMAP technical article can be downloaded from the
**** file 10-16.zip in the wintech directory
****

Windows Font Mapping

Ron Gery
Microsoft Developer Network Technology Group

Created: June 8, 1992

Abstract

This article discusses the font mapper in the Microsoft Windows operating
system and how it controls the realization of fonts. In the process, the
article also looks at what it takes to effectively create a logical font so
that the font mapping is predictable and useful. Some of the information is
specific to Microsoft Windows version 3.1, but most of it applies to both
Windows versions 3.0 and 3.1.


=============================================================================

****
**** The GDIOVER2 technical article can be downloaded from the
**** file 10-17.zip in the wintech directory
****

GDI Overview

Ron Gery
Microsoft Developer Network Technology Group

Created: March 20, 1992

Abstract

This article provides a brief overview of the design and theory of the
graphical component of the Microsoft Windows graphical environment. No
details are covered.


=============================================================================

****
**** The GETGLYPH technical article can be downloaded from the
**** file 10-18.zip in the wintech directory
****

Advanced TrueType: GetGlyphOutline

Ron Gery
Microsoft Developer Network Technology Group

Created: July 10, 1992

Abstract

This article presents a usable explanation of the GetGlyphOutline function.
Rather than being a complete guide, it is intended to complement and complete
the definition found in the Microsoft Windows version 3.1 Software
Development Kit (SDK) Programmer's Reference, Volume 2: Functions. To follow
the discussion, the reader should be familiar with the information on
GetGlyphOutline in the SDK and the basic theory of the TrueType font engine.
Asample application, GLYPH, is included on the Microsoft Developer Network CD
to illustrate the basic concepts and mechanisms in this article.


=============================================================================

****
**** The MAPPING technical article can be downloaded from the
**** file 10-24.zip in the wintech directory
****

Coordinate Mapping

Ron Gery
Microsoft Developer Network Technology Group

Created: March 20, 1992

Abstract

This article discusses mapping modes in the Microsoft Windows graphical
environment---what they are, how they work, and what they really mean. Basic
use of the following mapping mode functions is included: SetMapMode,
SetWindowExt, SetViewportExt, SetWindowOrg, SetViewportOrg, LPtoDP, and
DPtoLP.


=============================================================================

****
**** The METAFILE technical article can be downloaded from the
**** file 10-25.zip in the wintech directory
****

Metafiles

Ron Gery
Microsoft Developer Network Technology Group

Created: March 20, 1992

Abstract

This article provides an overview of metafiles, their creation, and their
use. All metafile functions are discussed:

o  CloseMetaFile

o  CopyMetaFile

o  CreateMetaFile

o  DeleteMetaFile

o  EnumMetaFile

o  GetMetaFile

o  GetMetaFileBits

o  PlayMetaFile

o  PlayMetaFileRecord

o  SetMetaFileBits


=============================================================================

****
**** The OBJECTS technical article can be downloaded from the
**** file 10-28.zip in the wintech directory
****

GDI Objects

Ron Gery
Microsoft Developer Network Technology Group

Created: March 20, 1992

Abstract

This article discusses how to create, select, and delete graphics device
interface (GDI) objects such as pens, brushes, fonts, bitmaps, palettes, and
regions. Sprinkled throughout are general guidelines for using objects
efficiently and for making basic use decisions.


=============================================================================

****
**** The PALAWARE technical article can be downloaded from the
**** file 10-30.zip in the wintech directory
****

Palette Awareness

Ron Gery
Microsoft Developer Network Technology Group

Created: April 15, 1992

Abstract

This article discusses basic palette awareness---what it takes for an
application to use palettes correctly in the Microsoft Windows graphical
environment---by covering these areas:

o  Responding to palette-related messages

o  Managing palette-based bitmaps

o  Managing multiple palettes in one application

o  Using the Clipboard with palettes

The reader should be familiar with basic palette use for painting
operations. This article is not about the Palette Manager, and the level of
detail is limited to the very basics of the palette managing process. A
sample application, MULTIPAL, is included on the Microsoft Developer Network
CD to illustrate the use of multiple palettes in a single application.


=============================================================================

****
**** The PALETTE technical article can be downloaded from the
**** file 10-83.zip in the wintech directory
****

The Palette Manager: How and Why

Ron Gery
Microsoft Developer Network Technology Group

Created: March 23, 1992

Abstract

This article is intended as a full introduction to the Microsoft Windows
Palette Manager. Beyond simply describing the use of the palette interface,
this article attempts to explain its specific internal workings and gives
reasons for its chosen implementation. Due to the complexity of the Palette
Manager, this article gives some topics an initial explanation and then goes
into them in greater detail later in the article. Because the result is
rather long, it is recommended that you read it start to finish before using
it as a reference. For a less in-depth discussion on using palettes, check
out the "Palette Awareness" technical article on the Microsoft Developer
Network CD (Technical Articles, Windows Articles, GDI Articles).

Disclaimer     Any and all internal details discussed in this article are
subject to change without notice in future versions of Windows. Any reliance
on these details must be made version-dependent on Windows versions 3.0 and
3.1.


=============================================================================

****
**** The PRIMITIV technical article can be downloaded from the
**** file 10-32.zip in the wintech directory
****

Primitive Cool

Ron Gery
Microsoft Developer Network Technology Group

Created: March 17, 1992

Abstract

This article discusses the varying levels of simulations that the Microsoft
Windows graphics device interface (GDI) performs to provide a
device-independent output model for graphical primitives on raster devices.
The article covers general simulations for lines, rectangles, polygons,
curves, stretched blts, device-independent bitmap (DIB) operations, and
printer-specific support, as well as noting memory restrictions and error
conditions.


=============================================================================

****
**** The PRINT technical article can be downloaded from the
**** file 10-33.zip in the wintech directory
****

Printing

Ron Gery
Microsoft Developer Network Technology Group

Created: March 20, 1992
Revised: June 2, 1992

Abstract

This article discusses the basics of printing in the Microsoft Windows
graphical environment. It does not cover setting up a printer and its device
context (DC); it concentrates instead on operations needed to get output to
the printer after it is set up. The article discusses the use of the main
printing functions---StartDoc, EndDoc, StartPage, EndPage, AbortDoc, and
SetAbortProc---and the principles of banding.


=============================================================================

****
**** The SPRITES technical article can be downloaded from the
**** file 10-96.zip in the wintech directory
****

Animation in Windows

Herman Rodent
Starring:  Nell and Olivia, the Wonder Dog

Created: April 28, 1993

Abstract

This article is aimed at people who would like to create a Microsoft
Windows-based application that does some form of animation, or who would like
to understand how to improve the performance of an existing animated
application, or who are considering porting an MS-DOS--based application to
Windows. The main focus of the article is on using device-independent bitmaps
(DIBs) for the images and the DIB driver (DIB.DRV) for the off-screen image
buffer. The article is written around a sample application, Sprites, which is
included with the article. Some knowledge of animation techniques is assumed.
If you're looking for a "How to Do Animation" article, this isn't it. The
following points are covered:

o  Using DIBs

o  Using the DIB driver

o  Palettes

o  Measuring and improving performance

o  Lots of useful little tips and hints


=============================================================================

****
**** The T2API technical article can be downloaded from the
**** file 10-41.zip in the wintech directory
****

Using TrueType

Ron Gery
Microsoft Developer Network Technology Group

Created: March 20, 1992
Revised: April 21, 1992

Abstract

This article introduces using TrueType in an application with the Microsoft
Windows version 3.1 graphical environment. It discusses issues that the
introduction of TrueType raises and mechanisms for solving them. The article
also explains how to use TrueType to create more accurate and
device-independent output than was previously possible. New Windows version
3.1 functions covered are GetRasterizerCaps, EnumFontFamilies,
GetCharABCWidths, GetOutlineTextMetrics, GetGlyphOutline, GetFontData,
GetKerningPairs, and CreateScalableFontResource. This article is specific to
Windows version 3.1. None of the new structures or functions discussed are
available in earlier versions of Windows.


=============================================================================

****
**** The TRANSBLT technical article can be downloaded from the
**** file 10-43.zip in the wintech directory
****

Bitmaps with Transparency

Ron Gery
Microsoft Developer Network Technology Group

Created: June 1, 1992

Abstract

This article discusses several methods for performing transparency and
masking effects with bitmaps in the Microsoft Windows graphical environment,
both through simulations and by using special driver functionality. Included
is a small sample application, TRANSBLT, that demonstrates most of the
techniques discussed in this article.


=============================================================================

****
**** The TRUETYPE technical article can be downloaded from the
**** file 10-44.zip in the wintech directory
****

An Introduction to Digital Typography Using TrueType

George Moore

Created: April 2, 1992

Abstract

This article describes the use of TrueType fonts in the Microsoft Windows
version 3.1 graphical environment. It explains the concepts of digital
typography and discusses the steps for displaying a bitmapped character on a
target device, a process that is invisible to developers in the Microsoft
Windows environment.


=============================================================================

****
**** The TT technical article can be downloaded from the
**** file 10-46.zip in the wintech directory
****

TrueType and Microsoft Windows Version 3.1

David Weise and Dennis Adler

Created: April 4, 1992
Revised: August 13, 1992

Abstract

Applications designed for the Microsoft Windows graphical environment can
use four kinds of font technologies to display and print text: raster,
vector, device, and TrueType. Versions of Windows prior to 3.1 used raster
fonts and vector fonts; Windows version 3.1 introduces TrueType. TrueType
provides a number of advantages over raster and vector fonts:

o  TrueType is WYSIWYG (what you see is what you get). The appearance of a
font on the screen and on the printed page is exactly the same.

o  TrueType fonts are device independent; they print to any printer.

o  TrueType fonts are platform independent; they work with Windows and on
the Apple Macintosh.

o  TrueType fonts are simpler to implement and simpler to use. Install
Windows, and you are ready to use TrueType.


=============================================================================

****
**** The TTFONTS technical article can be downloaded from the
**** file 10-47.zip in the wintech directory
****

Linear and Nonlinear Scaling in Digital Typography

George Moore

Created: April 20, 1992

Abstract

This article outlines the problems inherent in the linear scaling of fonts
and how existing digital typographies have tried to solve them. Against this
background, the nonlinear scaling solution found in TrueType in Microsoft
Windows version 3.1 has clear advantages.


=============================================================================

****
**** The CLIENT technical article can be downloaded from the
**** file 10-3.zip in the wintech directory
****

OLE Client Implementation Guide Version 1.02

Kraig Brockschmidt

Created: May 22, 1992


=============================================================================

****
**** The DDEDLL technical article can be downloaded from the
**** file 10-6.zip in the wintech directory
****

Performing DDE from a Dynamic-Link Library

By Herman Rodent, a much-traveled, small, furry animal
Microsoft Developer Network Technology Group

Created: October 1, 1992

Abstract

Dynamic data exchange (DDE) is normally associated with applications. The
basic DDE mechanism uses WM_DDE... messages sent between application window
procedures. This article shows how DDE operations can be performed from a
dynamic-link library (DLL) using the dynamic data exchange management library
(DDEML) to do most of the work. Using DDEML instead of raw DDE messages makes
adding DDE functionality to a DLL a trivial exercise.

PMGRPAPI, the sample code for this article, implements a DLL with an
application programming interface (API) to the Microsoft Windows Program
Manager for controlling the creation and deletion of groups and items. The
application is of use in its own right as an aid to creating setup programs.


=============================================================================

****
**** The DDEEXEC technical article can be downloaded from the
**** file 10-84.zip in the wintech directory
****

DDE Execute Strings

Herman Rodent
Microsoft Developer Network Technology Group

Created: November 16, 1992

Abstract

The dynamic data exchange (DDE) protocol includes a feature designed to
allow a DDE client application to send commands to a DDE server. The syntax
of these execute requests and the way they should be handled by servers is
not well documented and, consequently, varies slightly with different
implementations. 

The current DDE protocol has no provision for returning result information
from an execute request, so a client application can only tell that the
request failed, not why it failed.

This article proposes a consistent way to handle DDE execute command
requests and a mechanism that allows result information to be returned. This
article covers the following points:

o  DDE execute command syntax

o  Special characters in command arguments

o  Unicode considerations for Microsoft Windows NT

o  The returning of result information


=============================================================================

****
**** The DDEHOTLK technical article can be downloaded from the
**** file 10-7.zip in the wintech directory
****

DDE Hot Links

Herman Rodent, staff burrower
Microsoft Developer Network Technology Group

Created: October 1, 1992

Abstract

Dynamic data exchange (DDE) is a powerful feature of the Microsoft Windows
operating environment. DDE provides a protocol through which applications can
exchange data of all sorts. DDE enables applications to form hot links with
DDE servers and obtain data in real time. A hot link is a direct data feed
from one application (a DDE server) to another (a DDE client). As the data
changes at the server, the server sends the new information to the client to
be processed.

This article shows a technique for browsing DDE servers that may be used in
adialog box to establish a hot link and discusses the process required to
reestablish a hot link when an application is restarted.

A sample application is included that demonstrates establishing a link and
reestablishing the link when the application is started again later.


=============================================================================

****
**** The DDEOLE technical article can be downloaded from the
**** file 10-8.zip in the wintech directory
****

Supporting the Clipboard, DDE, and OLE in Applications

Herman Rodent
Microsoft Developer Network Technology Group

Created: September 24, 1992

Abstract

Microsoft Windows provides many methods through which applications can
communicate with each other, including shared memory, shared files, the
Clipboard, dynamic data exchange (DDE), and object linking and embedding
(OLE).

Many applications would benefit from the ability to import data from other
applications or export it to them. The difficulty lies in determining which
of the mechanisms listed above are most appropriate to support.

This document reviews Clipboard support in applications and goes on to look
at why an application might be designed to support the Clipboard, DDE, or
OLE. It looks at a number of different types of applications and discusses
what support is appropriate for each of them.


=============================================================================

****
**** The DDESERV technical article can be downloaded from the
**** file 10-85.zip in the wintech directory
****

Quick and Easy DDE Server

Herman (Mr. DDE) Rodent
Microsoft Developer Network Technology Group

Created: November 30, 1992

Abstract

Adding dynamic data exchange (DDE) server support to an application has
never been easier. This article describes a code module you can include in
your own application that makes adding DDE server support trivial. The code
module makes use of the dynamic data exchange management library (DDEML) to
implement the DDE protocol and provides the following features:

o  {3 {5 \*SYMBOL 183 \f "Symbol"}5 {5 }5 }3 Full System topic support

o  {3 {5 \*SYMBOL 183 \f "Symbol"}5 {5 }5 }3 An application programming
interface (API) to dynamically add and remove topics and topic/item pairs

o  {3 {5 \*SYMBOL 183 \f "Symbol"}5 {5 }5 }3 An API to dynamically add and
remove DDE execute commands to a topic

o  {3 {5 \*SYMBOL 183 \f "Symbol"}5 {5 }5 }3 Automatic tracking of
conversations

o  {3 {5 \*SYMBOL 183 \f "Symbol"}5 {5 }5 }3 Built-in execute command parser

o  {3 {5 \*SYMBOL 183 \f "Symbol"}5 {5 }5 }3 Partial support for the Execute
Control 1 protocol, which allows a result string to be returned in response
to a DDE execute command request

This article requires considerable familiarity with DDE concepts---it's not
agood place to start learning about DDE. Please refer to the Microsoft
Windows version 3.1 Software Development Kit (SDK) Programmer's Reference,
Volume 1: Overview, Part 2: Extension Libraries for a general introduction to
DDE and DDEML. The following articles on the Microsoft Developer Network CD
(Technical Articles, Windows Articles, OLE and DDE Articles) provide more
detail on various DDE topics:

o  {3 {5 \*SYMBOL 183 \f "Symbol"}5 {5 }5 }3 "DDE Execute Strings"

o  {3 {5 \*SYMBOL 183 \f "Symbol"}5 {5 }5 }3 "DDE Hot Links"

o  {3 {5 \*SYMBOL 183 \f "Symbol"}5 {5 }5 }3 "Performing DDE from a
Dynamic-Link Library"

o  {3 {5 \*SYMBOL 183 \f "Symbol"}5 {5 }5 }3 "Raw DDE"

o  {3 {5 \*SYMBOL 183 \f "Symbol"}5 {5 }5 }3 "Supporting the Clipboard, DDE,
and OLE in Applications"

o  {3 {5 \*SYMBOL 183 \f "Symbol"}5 {5 }5 }3 "Supporting the DDE System
Topic"


=============================================================================

****
**** The DDESYSTP technical article can be downloaded from the
**** file 10-9.zip in the wintech directory
****

Supporting the DDE System Topic

Herman Rodent
Microsoft Developer Network Technology Group

Created: October 1, 1992

Abstract

Dynamic data exchange (DDE) is a powerful feature of the Microsoft Windows
operating environment. DDE provides a protocol through which applications can
exchange data of all sorts. In order for DDE client applications to
communicate effectively with DDE servers, those servers must support the
System topic consistently and correctly.

This article describes what supporting the System topic involves and
provides sample code that you can include in your own application.


=============================================================================

****
**** The JSCONCPT technical article can be downloaded from the
**** file 10-20.zip in the wintech directory
****

OLE: A Short Overview

Jon Singer

Created: May 2, 1992

Abstract

This article provides a general overview of object linking and embedding
(OLE). It explains what OLE is, discusses why it is important, and provides
suggestions for implementing OLE successfully in your applications.


=============================================================================

****
**** The RAWDDE technical article can be downloaded from the
**** file 10-34.zip in the wintech directory
****

Raw DDE

Sanford A. Staab
Created: March 20, 1992

Abstract

Dynamic data exchange (DDE) is one of the least understood capabilities of
the Microsoft Windows graphical environment. For the most part, this lack of
understanding results from the absence of a highly detailed explanation of
the correct protocol to use when performing DDE transactions. This article
describes each type of DDE transaction in a table format that outlines what
operations the client and server applications must perform to complete the
transaction properly.

The DDEML.DLL library in Windows version 3.1 removes the need for most
applications to deal with raw DDE transactions. However, understanding proper
DDE transaction protocol is a necessity when creating or communicating with
applications that do not use DDEML.


=============================================================================

****
**** The SERVER technical article can be downloaded from the
**** file 10-35.zip in the wintech directory
****

OLE Server Implementation Guide

Kraig Brockschmidt

Created: May 6, 1992

Abstract

The objective of this document is to help applications programmers add
object linking and embedding (OLE) server capabilities to new or existing
applications. This guide provides OLE technical background information,
suggestions for preparing an application to become an OLE server, and
step-by-step instructions on where to add code, what OLE functions to call,
and what specific actions to perform.


=============================================================================

****
**** The STREAMS technical article can be downloaded from the
**** file 10-38.zip in the wintech directory
****

OLE Object Streams

Kraig Brockschmidt

Created: March 23, 1992


=============================================================================

****
**** The OVERVPEN technical article can be downloaded from the
**** file 10-86.zip in the wintech directory
****

Overview of the Architecture of Windows Pen Drivers

Matt Squires
Software Design Engineer

Created: January 14, 1993

Abstract

This article is designed to give the reader a general introduction to the
functionality of the Windows for Pen Computing pen driver and virtual pen
driver, and helps to explain why the drivers function as they do. This
article is an overview that should be read in conjunction with the
"Understanding the Windows Virtual Pen Driver" technical article.


=============================================================================

****
**** The PENDRVR technical article can be downloaded from the
**** file 10-97.zip in the wintech directory
****

Understanding Pen Driver Functionality Under Windows

Matthew Squires
Microsoft Pen Win Development

Created: January 14, 1993
Modified: April 26, 1993

Abstract

This article is designed to give the reader a general introduction to the
functionality of the Microsoft Windows pen driver by explaining what the
source does and how it does it. It is assumed that the reader has a basic
understanding of pen driver functionality and is familiar with the Windows
Device Driver Kit (DDK).

The files that make up the pen driver can be found in the Windows for Pen
Computing OEM adaptation kit and in the Windows version 3.1 DDK directory.
The files of interest are: DISABLE.ASM, ENABLE.ASM, FILTER.ASM, INSTALL.ASM,
LOAD.ASM, MISC.ASM, PLAY.ASM, WACOM.ASM, and DIALOGS.C. It is important that
these source files be read in conjunction with this article.

For related information on this topic, see the article in the Microsoft
Knowledge Base titled "Understanding the Windows Virtual Pen Driver."

This article is divided into three sections. The first section provides some
background information about the pen driver, the second section introduces
the source files used to build the driver, and the third section describes
the pen driver source code in detail.


=============================================================================

****
**** The SYMBOLGR technical article can be downloaded from the
**** file 10-55.zip in the wintech directory
****

Using the Symbol Graph

Eric Berman

Created: July 1992

Abstract

bj0c


=============================================================================

****
**** The VPENDRV technical article can be downloaded from the
**** file 10-87.zip in the wintech directory
****

Understanding the Windows Virtual Pen Driver

David Flenniken, Pen Windows Test Engineer
Matt Squires, Software Design Engineer

Created: October 12, 1992

Abstract

This article gives the reader a general introduction to the functionality of
the Windows virtual pen driver by explaining what the source does and how it
does it. It is assumed that the reader has a basic understanding of Windows
driver functionality and is familiar with the Windows Device Driver Kit
(DDK).

The files that make up the virtual pen driver for enhanced-mode Windows can
be found in the Windows for Pens OEM adaptations kit and in the Windows 3.1
DDK directory. The files of interest are WACOM.ASM and VPEND.ASM. It is
important that these two source files be read in conjunction with this
article.


=============================================================================

****
**** The W4PRECOG technical article can be downloaded from the
**** file 10-56.zip in the wintech directory
****

Microsoft Windows for Pens Computing---Moderation of the Recognition Process

Stephen Liffick
Created: March 20, 1992

Abstract

This article discusses the primary data structures in Microsoft Windows for
Pen Computing and the methods used by application programmers to moderate the
recognition process with these structures. It provides a high-level overview
of the recognition process followed by detailed information on the methods of
modification and control over this process available to applications.


=============================================================================

****
**** The GRAPHX technical article can be downloaded from the
**** file 10-57.zip in the wintech directory
****

Graphics Design and Optimization

Matt Saettler
Microsoft Multimedia

Created: August 1992
Revision 1.01

Abstract


=============================================================================

****
**** The MEMORY technical article can be downloaded from the
**** file 10-58.zip in the wintech directory
****

Optimizing Memory Usage and Performance

Mark McCulley

Created: March 20, 1992

Abstract

This article discusses techniques for optimizing memory usage and
performance in applications designed for the Microsoft Windows graphical
environment. These techniques include:

o  Using global memory

o  Minimizing selector loads

o  Using processor-specific code

o  Using the script channel of a multimedia movie player (MMP) movie to play
sound


=============================================================================

****
**** The MMAWARE technical article can be downloaded from the
**** file 10-59.zip in the wintech directory
****

Creating Multimedia-Aware Applications

Nigel Thompson, Microsoft Developer Network Technology Group
Matt Saettler, Microsoft Multimedia

Created: March 20, 1992
Revised: October 1992
Revision 1.36

Abstract

This article reviews considerations for creating multimedia-dependent and
multimedia-aware applications in the Microsoft Windows operating system. If
your application is dedicated to the multimedia personal computer (MPC)
environment, you will find useful information in the "Coping with Resource
Availability" and "Yielding Resources to Other Applications" sections. If you
are writing an application for Windows version 3.1 or for the Win32
Application Programming Interface, this article points out some potential
hazards.

This article is meant for a developer working in C or a high-level language.
It covers three main areas of creating multimedia applications:

o  Applications that work with or without the multimedia API extensions to
Windows

o  Coping with unavailable resources

o  Yielding resources to other applications.


=============================================================================

****
**** The MSFTMM technical article can be downloaded from the
**** file 10-60.zip in the wintech directory
****

Microsoft Multimedia Document Overview

Matt Saettler
Microsoft Multimedia

Created: October 2, 1992
Revision 1.0.24

Abstract

The Microsoft Multimedia Overview presents the list of the current documents
available from the multimedia group at Microsoft. The reader should use this
list to ensure that he/she has the current version of the listed documents as
well as a guide to the documents that are available.


=============================================================================

****
**** The OPTCDROM technical article can be downloaded from the
**** file 10-61.zip in the wintech directory
****

CD-ROM Design and Optimization

Matt Saettler
Microsoft Multimedia

Created: October 1992
Revision 2.03

Abstract

This document details how to design and optimize an application for use and
delivery on CD-ROM using the Microsoft MS-DOS CD-ROM Extensions (MSCDEX).

For the purposes of this document, the references to High Sierra pertain
both to the High Sierra standard and the ISO 9660 standard except where
specifically noted.

This document contains information targeted to the following types of
readers:

o  Application developers (C or High-Level Tool)

o  Low-level application developers (assembler)

o  Multimedia producers


=============================================================================

****
**** The RIFFNEW technical article can be downloaded from the
**** file 10-62.zip in the wintech directory
****

New Multimedia Data Types and Data Techniques

January 12, 1993
Revision 1.0.108


=============================================================================

****
**** The SINGACD technical article can be downloaded from the
**** file 10-98.zip in the wintech directory
****

Using MCI to Synchronize a Windows-Based Application with CD Audio

Herman Rodent
Microsoft Developer Network Technology Group

Created: February 10, 1993

Abstract

This technical article describes a simple technique that uses the Media
Control Interface (MCI) to synchronize events in a Microsoft Windows-based
application with audio from a CD. The following topics are covered:

o  MCI message interface

o  Audio CD time formats 

o  Owner-draw graphical buttons

o  Extending the idea to other time sources

Four pieces of sample code included with this article create four
applications: PLAYACD, a simple CD controller; SINGACD, a sing-along
application that shows the lyrics to a CD as it plays; TIMEACD, an authoring
tool to create the lyric files used by the sing-along application; and
SINGAWAV, an application that demonstrates synchronizing to a waveform.


=============================================================================

****
**** The VIDEO technical article can be downloaded from the
**** file 10-64.zip in the wintech directory
****

Multimedia Video Techniques

Created: March 20, 1992

Abstract

This article describes some techniques that can help improve your
application's video performance:

o  Using an identity palette to speed the drawing of images

o  Dealing with differences in video adapters

o  Modifying device-independent bitmaps (DIBs) using the DIB driver

o  Using the DisplayDib application programming interface (API) to display
256-color images on a standard VGA adapter


=============================================================================

****
**** The CALLB technical article can be downloaded from the
**** file 11-1.zip in the ctech directory
****

Calling All Members: Member Functions as Callbacks

Dale Rogerson
Microsoft Developer Network Technology Group

Created: April 30, 1992

Abstract

Microsoft Windows version 3.1 has over 30 callback functions that
applications can use to enumerate objects, hook into the hardware, and
perform a variety of other activities. Due to the prevalence of callbacks, it
is only natural to want to handle callbacks with C++ member functions.
However, callbacks are prototyped as C functions and, therefore, do not
associate data with operations on that data, making the handling of callbacks
less straightforward when you use C++ than it initially might appear.

This article explains why normal member functions cannot be used as callback
functions, gives several techniques for handling callbacks, and illustrates
these techniques with code fragments. The code fragments are included as the
CALLB sample program on the Microsoft Developer Network CD.

The article and source code are targeted toward Microsoft C/C++ version 7.0,
but the ideas presented apply to all C++ compilers, including those by
Borland and Zortech.

The reader should be familiar with Windows callbacks and with C++. A
bibliography is supplied at the end of the article.


=============================================================================

****
**** The CBL_CAPP technical article can be downloaded from the
**** file 11-2.zip in the ctech directory
****

How to Pass Parameters Between COBOL and C

Michael Hendrick
Systems Support Engineer, Languages

Created: February 1992

Abstract

This article explains how Microsoft COBOL programs can pass parameters to
and receive parameters from Microsoft C programs. It assumes you have a basic
understanding of the COBOL and C languages.

Microsoft COBOL supports calls to routines written in Microsoft C, FORTRAN,
Pascal, and Assembler. This article describes the necessary syntax for
calling Microsoft C routines and contains a series of examples demonstrating
the interlanguage capabilities between COBOL and C. The sample programs apply
to the following Microsoft products:

o  Microsoft COBOL Professional Development System (PDS) versions 4.0 and
4.5 for MS-DOS and OS/2

o  Microsoft C Optimizing Compiler version 6.0 for MS-DOS and OS/2


=============================================================================

****
**** The CPPDLL technical article can be downloaded from the
**** file 11-3.zip in the ctech directory
****

Exporting with Class

Dale Rogerson
Microsoft Developer Network Technology Group

Created: October 22, 1992

Abstract

The Microsoft C/C++ version 7.0 compiler supports exporting an entire class
with the following syntax:

class __export CFoo{};

Information on the class export syntax is missing from the C/C++
documentation. This technical article explains how to export a complete class
using the class export syntax and provides a sample application called ClsExp
to demonstrate the syntax.

Note     The information in this article is subject to change, depending on
future versions of Microsoft C/C++ language products.


=============================================================================

****
**** The CSETUP technical article can be downloaded from the
**** file 11-64.zip in the ctech directory
****

Writing a Setup Application for Windows in C

Herman Rodent
Microsoft Developer Network Technology Group

Created: February 10, 1993

Abstract

This article describes how to create a Microsoft Windows-based setup utility
for a Windows-based application in C, rather than Microsoft Test TestBasic,
using the graphical user interface (GUI) setup tools and libraries shipped
with the Microsoft Windows version 3.1 Software Development Kit (SDK). The
sample code included with this technical article contains everything you need
to create a setup application in C. The following points are covered:

o  Creating a simple setup application

o  Adding support for functions not included in the sample code


=============================================================================

****
**** The DRAFT3 technical article can be downloaded from the
**** file 11-4.zip in the ctech directory
****

The Microsoft Overlay Virtual Environment (MOVE)

Created: March 20, 1992

Abstract

This article explains how the Microsoft overlay virtual environment (MOVE)
helps overcome memory limitations for programs that run in the MS-DOS
operating system. The article compares MOVE technology to conventional
overlays and to paged virtual memory systems, and explains the basics of the
technology.


=============================================================================

****
**** The DYNAMENU technical article can be downloaded from the
**** file 11-29.zip in the ctech directory
****

Creating Dynamic Menus with the Microsoft Foundation Classes

Dale E. Rogerson
Microsoft Developer Network Technology Group

Created: November 5, 1992

Abstract

Many applications allow users to dynamically add new items to menus.
Applications such as Microsoft Excel and Word for Windows provide this
capability through their built-in macro languages, and you can add menu items
to the File Manager at run time. 

This article explains how developers can use the Microsoft Foundation Class
(MFC) version 1.0 library to implement menus that can be changed at run time.
The DynaTest sample application demonstrates the key concepts discussed in
the article.


=============================================================================

****
**** The FANGLE technical article can be downloaded from the
**** file 11-5.zip in the ctech directory
****

Allocating Memory the Newfangled Way: The new Operator

Dale E. Rogerson
Microsoft Developer Network Technology Group

Created: August 6, 1992
Revised: January 21, 1993

Abstract

Many developers ask the question, "Do I need to overload the new operator
for Windows--based applications?" when they start programming in C++ with the
Microsoft C/C++ version 7.0 compiler. These developers want to conserve
selectors while allocating memory from the global heap. Fortunately, the
C/C++ version 7.0 run-time library allows developers to reduce selector
consumption without overloading the new operator.

This article examines the behavior of the new operator in a Windows-based
program. It provides an overview of new, discusses whether you should
overload new, examines the C++ ambient memory model, and discusses
large-model C++ programming and dynamic-link library (DLL) ownership issues.

Two sample applications, NewOpr and Owner, illustrate the concepts in this
technical article. A bibliography of suggested reading material is included
at the end of the article.


=============================================================================

****
**** The LARGEM4 technical article can be downloaded from the
**** file 10-21.zip in the ctech directory
****

Programming at Large

Dale Rogerson
Microsoft Developer Network Technology Group

Created: April 13, 1992

Abstract

Microsoft Windows version 3.1 signals the death of Windows real mode. With
the release of Windows version 3.1, only standard and enhanced modes are
supported. The end of real mode is the beginning of new programming freedoms,
such as writing large-model applications.

This article explains why the large model is valid for protected mode
applications and discusses the solutions for single instances and the Windows
version 3.0 page-locking bug, limitations of large-model applications.


=============================================================================

****
**** The MALLOC technical article can be downloaded from the
**** file 11-6.zip in the ctech directory
****

Allocating Memory the Old-Fashioned Way: _fmalloc and Applications for
Windows

Dale Rogerson
Microsoft Developer Network Technology Group

Created: July 10, 1992

Abstract

One of the most shocking things that a first-time programmer for Windows has
to learn is not to use malloc but to use special Microsoft Windows memory
allocation functions such as GlobalAlloc, GlobalReAlloc, GlobalLock,
GlobalUnlock, and GlobalFree. The reasons for requiring special memory
allocation functions have mostly gone away with the demise of real mode. In
fact, Microsoft C/C++ version 7.0 brings us almost full circle, because the
preferred method for memory allocation is the large-model version of malloc
or _fmalloc. Even the C startup code now uses malloc to allocate space for
the environment.

This article discusses the behavior of malloc supplied with Microsoft C/C++
version 7.0. The article focuses on programming for the protected
modes---standard and enhanced---of Microsoft Windows version 3.1. The
following topics are discussed:

o  _nmalloc: Why _fmalloc is not the same

o  History: Why _fmalloc was bad

o  Subsegment Allocation: Why _fmalloc is good

o  _ffree: Why _fmalloc is not perfect

o  DLLs: Why _fmalloc may not do what you want

o  Versatility: Why _fmalloc is not for everything

The information for this article was gleaned from the C/C++ version 7.0
compiler run-time library source code.

To interactively explore the behavior of _fmalloc, the Smart Alloc
(SMART.EXE) sample application is provided. Smart Alloc is best used in
conjunction with Heap Walker, which shows the exact state of the global
segments allocated. Segments allocated with GlobalAlloc (or _fmalloc) are
listed by Heap Walker as having a type designation of "Private." Smart Alloc
has a dynamic-link library (DLL) that intercepts all calls to GlobalAlloc,
GlobalFree, and GlobalReAlloc made by Smart Alloc or the C run-time library
and prints messages with OutputDebugString to the debugging console. It is
usually most convenient to use DBWIN.EXE to view these messages.


=============================================================================

****
**** The MFC-OLE technical article can be downloaded from the
**** file 11-30.zip in the ctech directory
****

Programming with MFC/OLE

Lon Fisher
Software Design Engineer, Applications Framework Group

Created: December 4, 1992

Abstract

This article describes what MFC/OLE is, how it works with the OLE API, and
how you can program with it. The article lists all of the steps required to
construct an OLE application and the various operations OLE applications must
support. The article walks through both a client and server example to help
illustrate how you can use MFC/OLE in your program. 




=============================================================================

****
**** The OBJMAPC technical article can be downloaded from the
**** file 11-7.zip in the ctech directory
****

Object Mapping in C++

Tom Germond
Jan Gray, Software Design Engineer, Microsoft C++ Development Group
Dale E. Rogerson, Microsoft Developer Network Technology Group

Created: March 20, 1992

Revised: February 8, 1993

Abstract

This article describes the algorithms and data structures that Microsoft
C/C++ version 7.0 and Visual C++ version 1.0 use to map objects into memory.
It concentrates heavily on virtual functions because they are so powerful and
inexpensive to use. Although the information in this article describes our
implementation, all C++ compilers must solve the same basic problems.


=============================================================================

****
**** The OPTIM technical article can be downloaded from the
**** file 11-8.zip in the ctech directory
****

Microsoft Windows and the C Compiler Options

Dale Rogerson
Microsoft Developer Network Technology Group

Created: May 5, 1992

Abstract

One of the key issues in the development and design of commercial
applications is optimization---how to make an application run quickly while
taking up as little memory as possible. Although optimization is a goal for
all applications, the Microsoft Windows graphical environment presents some
unique challenges. This article provides tips and techniques for using the
Microsoft C version 6.0 and C/C++ version 7.0 compilers to optimize
applications for Windows. It discusses the following optimization techniques:

o  Using compiler options

o  Optimizing the prolog and epilog code

o  Optimizing the calling convention

o  Aliasing (using the /Ow and /Oa options)


=============================================================================

****
**** The SS0288 technical article can be downloaded from the
**** file 11-9.zip in the ctech directory
****

Relocatable Object Module Format

Microsoft Product Support Services

Created: May 29, 1992

Applicable Products

This application note applies to all versions of the following Microsoft
language products:

Microsoft Basic

Microsoft C

Microsoft C++

Microsoft COBOL

Microsoft FORTRAN

Microsoft Macro Assembler (MASM)

Microsoft Pascal

Microsoft QuickBasic

Microsoft QuickC

Microsoft QuickC for Windows

Microsoft QuickPascal

Microsoft Visual Basic


=============================================================================

****
**** The SUBCLSS technical article can be downloaded from the
**** file 11-31.zip in the ctech directory
****

Subclassing Windows with the Microsoft Foundation Class Library

Dale E. Rogerson
Microsoft Developer Network Technology Group

Created: January 12, 1993

Abstract

This article explains how to subclass windows and controls with the
Microsoft Foundation Class Library. In most cases, the Foundation Class
Library does all of the work; however, in some cases the developer must
supply extra code to subclass a window. 

The NUMEDIT, NUMTEST2, and NUMTEST3 sample applications demonstrate three
subclassing techniques. The article also explains how the CTRLTEST and
SUBCLASS sample applications (both included on the Microsoft Developer
Network CD) work.

Note     The sample applications were built with Microsoft C/C++ version 7.0
and the Microsoft Foundation Class Library version 1.0. The samples will
compile from the command line with Visual C++ version 1.0 and the Microsoft
Foundation Class Library version 2.0. 


=============================================================================

****
**** The TN001 technical article can be downloaded from the
**** file 11-10.zip in the ctech directory
****

MFC TN001---WNDCLASSes and MFC

Created: April 15, 1992

Abstract

This technical note describes the MFC routines for registering special
window classes (WNDCLASS structures) that Windows needs. It discusses
specific WNDCLASS attributes that MFC and Windows use.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

****
**** The TN002 technical article can be downloaded from the
**** file 11-11.zip in the ctech directory
****

MFC TN002---Persistent Data Format

Created: April 15, 1992

Abstract

This technical note describes the MFC routines for supporting persistent C++
objects and the format of those objects in a persistent store.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

****
**** The TN003 technical article can be downloaded from the
**** file 11-12.zip in the ctech directory
****

MFC TN003---Handle Maps

Created: April 15, 1992

Abstract

This technical note describes the MFC routines that support mapping Windows
object handles to C++ objects.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

****
**** The TN004 technical article can be downloaded from the
**** file 11-13.zip in the ctech directory
****

MFC TN004---Template Classes

Created: April 15, 1992

Abstract

This technical note describes MFC template class issues and the MFC templdef
template expansion sample code.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

****
**** The TN005 technical article can be downloaded from the
**** file 11-14.zip in the ctech directory
****

MFC TN005---Multiple Document Interface (MDI)

Created: April 15, 1992

Abstract

This technical note describes the MFC routines for supporting the multiple
document interface (MDI) of Windows.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

****
**** The TN006 technical article can be downloaded from the
**** file 11-15.zip in the ctech directory
****

MFC TN006---Message Maps

Created: April 15, 1992

Abstract

This technical note describes the MFC message map facility.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

****
**** The TN007 technical article can be downloaded from the
**** file 11-16.zip in the ctech directory
****

MFC TN007---Windows Debugging and Trace Options

Created: April 15, 1992

Abstract

This technical note describes the MFC debugging and trace options for
Windows-based applications.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples.


=============================================================================

****
**** The TN008 technical article can be downloaded from the
**** file 11-17.zip in the ctech directory
****

MFC TN008---General OLE Overview

Created: April 15, 1992

Abstract

This technical note gives a general overview of object linking and embedding
(OLE) and the OLE support that the MFC library provides.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

****
**** The TN009 technical article can be downloaded from the
**** file 11-18.zip in the ctech directory
****

MFC TN009---Writing an OLE Client Application

Created: April 15, 1992

Abstract

This technical note describes the classes and steps involved in creating an
object linking and embedding (OLE) client application.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

****
**** The TN010 technical article can be downloaded from the
**** file 11-19.zip in the ctech directory
****

MFC TN010---Writing an OLE Server Application

Created: April 15, 1992

Abstract

This technical note describes the classes and steps involved in creating an
object linking and embedding (OLE) server application.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples.


=============================================================================

****
**** The TN011 technical article can be downloaded from the
**** file 11-20.zip in the ctech directory
****

MFC TN011---Using MFC as Part of a DLL

Created: April 15, 1992

Abstract

This article describes how you can use the Microsoft Foundation Class (MFC)
library as part of a Microsoft Windows dynamic-link library (DLL). It assumes
that you are familiar with Windows DLLs and know how to build them.

The MFC library provides a full-featured set of C++ object classes for the
Windows graphical environment. It includes classes that directly support
application development for Windows as well as general-purpose classes for
collections, files, persistent storage, exceptions, diagnostics, memory
management, strings, and time. Each MFC technical note describes a feature of
MFC using code fragments and examples. 


=============================================================================

****
**** The TN012 technical article can be downloaded from the
**** file 11-21.zip in the ctech directory
****

MFC TN012---Using MFC with Windows Version 3.1 Robustness Features

Created: March 25, 1992

Abstract

This technical note describes some new features found in Microsoft Windows
version 3.1 and describes their use within the Microsoft Foundation Class
(MFC) library.

The MFC library provides a full-featured set of C++ object classes for the
Microsoft Windows graphical environment. It includes classes that directly
support application development for Windows as well as general-purpose
classes for collections, files, persistent storage, exceptions, diagnostics,
memory management, strings, and time. Each MFC technical note describes a
feature of MFC using code fragments and examples.


=============================================================================

****
**** The TN013 technical article can be downloaded from the
**** file 11-22.zip in the ctech directory
****

MFC TN013---Using the Standard Dialog Classes

Created: March 25, 1992

Abstract

This technical note describes the use of the standard dialog classes
provided with MFC.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples.


=============================================================================

****
**** The TN014 technical article can be downloaded from the
**** file 11-23.zip in the ctech directory
****

MFC TN014---Custom Controls and Other Topics

Created: March 25, 1992

Abstract

This technical note describes the custom control support in MFC. It also
discusses self-drawn controls and the CBitmapButton class.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples.


=============================================================================

****
**** The TN015 technical article can be downloaded from the
**** file 11-24.zip in the ctech directory
****

MFC TN015---Windows for Pen Computing Interface to MFC

Created: March 25, 1992

Abstract

This technical note describes the extra interfaces in AFXPEN.H that provide
aC++ interface to the Windows for Pen Computing environment.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples.


=============================================================================

****
**** The TN016 technical article can be downloaded from the
**** file 11-25.zip in the ctech directory
****

MFC TN016---MFC and Multiple Inheritance

Created: March 25, 1992

Abstract

This technical note describes how to use multiple inheritance (MI) with the
Microsoft Foundation Classes.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples.


=============================================================================

****
**** The TRICKS technical article can be downloaded from the
**** file 11-26.zip in the ctech directory
****

The C/C++ Compiler Learns New Tricks

Dale Rogerson
Microsoft Developer Network Technology Group

Created: August 28, 1992

Revised: January 27, 1993. 
The section on simplified building was removed. (This method links all
programs with the /NOI option enabled, which causes problems.)

Abstract

WinMain, GlobalAlloc, and mixed-model programming---these are just some of
the conventions C programmers had to accept when they started programming for
the Microsoft Windows operating system. Microsoft C/C++ version 7.0 can now
hide these conventions so that programmers can use standard C practices;
applications thus become much easier to develop and port. This article
provides an overview of programming conventions that C/C++ programmers no
longer need and a discussion of the new programming practices in C/C++
version 7.0. A bibliography of suggested reading material is included at the
end of this article.

A sample application called Back (BACK.EXE) and its accompanying
dynamic-link library (DLL) called Trace (TRACE.DLL) demonstrate many of the
ideas in this article. See the "Notes on the Sample Application" section for
more information about Back and Trace.

Note     The information in this article is valid only for Microsoft Windows
version 3.x standard and enhanced modes.


=============================================================================

****
**** The WSTREAMS technical article can be downloaded from the
**** file 11-32.zip in the ctech directory
****

Windows Streams

Dale E. Rogerson
Microsoft Developer Network Technology Group

Created: October 27, 1992

Abstract

This article explores the issues pertaining to the use of C++ and
dynamic-link libraries (DLLs) in the development of wstreambuf, which is a
Microsoft Windows-compatible version of the iostream streambuf class.
Discussions include:

o  Using C++ and Microsoft Foundation Class Library version 1.0 in a DLL

o  Exporting C interfaces from a DLL

o  Wrapping C interfaces with C++ in an application

The sample application, Streamer, includes the wstreambuf class. wstreambuf
inherits from the streambuf class and provides the minimum code necessary for
iostream reading and writing to a window (for example: cout << "This is
written to an ostream." << endl).

Note     The sample applications were built with Microsoft C/C++ version 7.0
and the Microsoft Foundation Class Library version 1.0. The samples will
compile from the command line with Visual C++ version 1.0 and the Microsoft
Foundation Class Library version 2.0.


=============================================================================

****
**** The BUILDSWI technical article can be downloaded from the
**** file 11-27.zip in the ctech directory
****

Build Switches in Programmer's WorkBench (PWB)

Created: April 26, 1992

Abstract

The Microsoft Programmer's WorkBench (PWB) is a flexible, extensible
platform for program development. Using PWB, developers can build a final
project (executable) file from a collection of source files. This process
involves creating a make file based on a set of rules describing how the
project will be built. This article describes the build switches that define
these rules. It explains the advanced use of build switches and provides
examples of each switch.


=============================================================================

****
**** The DLL technical article can be downloaded from the
**** file 11-28.zip in the ctech directory
****

Creating DLLs Using Microsoft QuickC for Windows

Created: March 20, 1992

Abstract

Dynamic-link libraries (DLLs) are executable files for the Microsoft Windows
graphical environment that offer many advantages over both standard
executable files and static-link libraries. This article explains what DLLs
are, how you can benefit by using them, how they differ from standard
executable files, and how Microsoft QuickC for Windows simplifies the process
of creating them.


=============================================================================

****
**** The VCTN001 technical article can be downloaded from the
**** file 11-33.zip in the ctech directory
****

Technical Note 1: Window Class Registration

Created: February 9, 1993

Abstract

This note describes the Microsoft Foundation Class (MFC) routines that
register the special WNDCLASSes needed by Microsoft Windows. Specific
WNDCLASS attributes used by MFC and Windows are discussed.


=============================================================================

****
**** The VCTN002 technical article can be downloaded from the
**** file 11-34.zip in the ctech directory
****

Technical Note 2: Persistent Object Data Format

Created: February 9, 1993

Abstract

This note describes the Microsoft Foundation Class (MFC) routines that
support persistent C++ objects and the format of the object data when it is
stored in a file. This only applies to classes with the DECLARE_SERIAL and
IMPLEMENT_SERIAL macros.


=============================================================================

****
**** The VCTN003 technical article can be downloaded from the
**** file 11-35.zip in the ctech directory
****

Technical Note 3: Mapping of Windows Handles to Objects

Created: February 9, 1993

Abstract

This note describes the Microsoft Foundation Class (MFC) routines that
support mapping Microsoft Windows object handles to C++ objects.


=============================================================================

****
**** The VCTN004 technical article can be downloaded from the
**** file 11-36.zip in the ctech directory
****

Technical Note 4: C++ Template Tool

Created: February 9, 1993

Abstract

This note describes Microsoft Foundation Class (MFC) template-class issues
and the MFC TEMPLDEF template expansion tool.


=============================================================================

****
**** The VCTN006 technical article can be downloaded from the
**** file 11-37.zip in the ctech directory
****

Technical Note 6: Message Maps

Created: February 9, 1993

Abstract

This note describes the Microsoft Foundation Class (MFC) message map
facility.


=============================================================================

****
**** The VCTN007 technical article can be downloaded from the
**** file 11-38.zip in the ctech directory
****

Technical Note 7: Debugging Trace Options

Created: February 10, 1993

Abstract

This note describes the Microsoft Foundation Class (MFC) TRACE output
mechanism.


=============================================================================

****
**** The VCTN008 technical article can be downloaded from the
**** file 11-39.zip in the ctech directory
****

Technical Note 8: MFC OLE Support

Created: February 10, 1993

Abstract

This note gives additional details about the Object Linking and Embedding
(OLE) support provided by the Microsoft Foundation Class (MFC) library. You
should read the OLE overview documentation in Chapter 18 of the Class Library
Users Guide as well as the Class Library Reference for the OLE classes.

If you are trying to upgrade an MFC 1.0 application that uses OLE to the
current version of MFC, please refer to Technical Note 18.

The first section gives an overview of terminology and describes how the
MFC/OLE classes provide an interface to the system level OLE libraries. The
second section gives additional information for building MFC/OLE client
applications. The third section gives additional information for building MFC
server applications.


=============================================================================

****
**** The VCTN011 technical article can be downloaded from the
**** file 11-40.zip in the ctech directory
****

Technical Note 11: Using MFC as Part of a DLL

Created: February 10, 1993

Abstract

This note describes how you can use the Microsoft Foundation Class (MFC)
library as part of a Microsoft Windows dynamic-link library (DLL). It assumes
you are familiar with Windows DLLs and how to build them.


=============================================================================

****
**** The VCTN012 technical article can be downloaded from the
**** file 11-41.zip in the ctech directory
****

Technical Note 12: Using MFC with Windows 3.1 Robustness Features

Created: February 10, 1993

Abstract

Microsoft Windows version 3.1 is a major improvement over Windows version
3.0 in the area of robust application development. Windows 3.1 includes a
number of new features that enhance the reliability of a Windows-based
application. This technical note describes the use of these features within
the MFC library.

These features include the debug kernel, STRICT type checking, diagnostics
and memory management, and the WINDOWSX.H enhancements. The Professional
Edition file \MSVC\WINDOWS.TXT includes additional information on these
features.


=============================================================================

****
**** The VCTN014 technical article can be downloaded from the
**** file 11-42.zip in the ctech directory
****

Technical Note 14: Custom Controls

Created: February 9, 1993

Abstract

This note describes the Microsoft Foundation Class (MFC) support for custom
and self-drawing controls. Dynamic subclassing is also described. General
advice on ownership of CWnd objects vs. HWNDs is presented.

The MFC sample application CTRLTEST illustrates many of these features.
Please refer to the source code for that sample (in
\MSVC\MFC\SAMPLES\CTRLTEST) and online help. 


=============================================================================

****
**** The VCTN015 technical article can be downloaded from the
**** file 11-43.zip in the ctech directory
****

Technical Note 15: Windows for Pen

Created: February 10, 1993

Abstract

This note describes the extra interfaces in AFXPEN.H that provide a C++
interface to the Microsoft Windows for Pen environment.

This note applies to Visual C++ Professional Edition only. Visual C++
Standard Edition does not contain the Windows for Pen SDK components.


=============================================================================

****
**** The VCTN016 technical article can be downloaded from the
**** file 11-44.zip in the ctech directory
****

Technical Note 16: Using C++ Multiple Inheritance with MFC

Created: February 10, 1993

Abstract

This note describes how to use Multiple Inheritance (MI) with the Microsoft
Foundation Classes.


=============================================================================

****
**** The VCTN017 technical article can be downloaded from the
**** file 11-45.zip in the ctech directory
****

Technical Note 17: Destroying Window Objects

Created: February 10, 1993

Abstract

This note describes the use of the CWnd::PostNcDestroy member function. Use
this function if you wish to do customized allocation of CWnd-derived
objects.

This note also explains some of the reasons for the cardinal rule: To
destroy a C++ Windows object, use DestroyWindow, not "delete".

This is important. If you follow the guidelines below, you will have few
cleanup problems (such as forgetting to delete/free C++ memory, forgetting to
free system resources like HWNDs, or freeing objects too many times).


=============================================================================

****
**** The VCTN018 technical article can be downloaded from the
**** file 11-46.zip in the ctech directory
****

Technical Note 18: Migrating OLE Applications from MFC 1.0 to MFC 2.0

Created: February 10, 1993

Abstract

This note provides guidelines for migrating Microsoft Foundation Class (MFC)
version 1.0 applications that use MFC/OLE to MFC version 2.0. MFC 2.0, like
its predecessor, supports OLE 1.

The changes in the class interfaces made between versions 1.0 and 2.0 for
most of the Microsoft Foundation classes are relatively minor. For details on
how to migrate the non-OLE portions of your application or a non-OLE MFC
version 1.0 application, please refer to Technical Note 19.

The OLE classes have been significantly changed to make it easier to write
new MFC/OLE applications. The changes add many new services. You have the
option, however, to preserve most of your MFC 1.0 OLE code.

The last section of this note anticipates future versions of OLE (OLE 2).

The changes to the MFC/OLE classes for MFC version 2.0 include:

o  Printed overview and reference documentation.

o  Improved samples.

o  Bug fixes.

o  Integration with the MFC 2.0 document and view architecture.

o  Standard implementations of more UI commands.

o  Some of the more complex details moved out of public interface into
implementation details.

o  Easier to write full-servers using COleTemplateServer.

o  OLE now supported in DLL versions. OLE is now available in both the
_USRDLL and _AFXDLL packaging options. See Technical Note 11 and Technical
Note 33 for more details on the DLL versions of MFC.

Please refer to the OLE overview documentation in Chapter 18 of the Class
Library User's Guide as well as the Class Library Reference for the OLE
classes.


=============================================================================

****
**** The VCTN019 technical article can be downloaded from the
**** file 11-47.zip in the ctech directory
****

Technical Note 19: Migrating MFC 1.0 Applications to MFC 2.0

Created: February 10, 1993

Abstract

This note provides guidelines for migrating Microsoft Foundation Class (MFC)
version 1.0 applications to the MFC version 2.0 libraries and tools.

IMPORTANT: To understand and evaluate the two approaches presented in this
technote, you must be familiar with MFC 2.0 concepts, such as the Document
and View architecture, and the tools. We suggest you at least work through
the SCRIBBLE tutorial in the Class Library User's Guide before beginning any
migration of existing code.

There are two basic approaches to migrating existing applications from
Microsoft Foundation Class (MFC) version 1.0, released with Microsoft C7, to
MFC version 2.


=============================================================================

****
**** The VCTN020 technical article can be downloaded from the
**** file 11-48.zip in the ctech directory
****

Technical Note 20: ID Naming and Numbering Conventions

Created: February 10, 1993

Abstract

This note describes the ID naming and numbering conventions used by
Microsoft Foundation Class (MFC) version 2.0 for resources, commands,
strings, controls, and child windows.


=============================================================================

****
**** The VCTN021 technical article can be downloaded from the
**** file 11-49.zip in the ctech directory
****

Technical Note 21: Command and Message Routing

Created: February 11, 1993

Abstract

This note describes the command routing and dispatch architecture as well as
advanced topics in general window message routing.

Please refer to the Class Library User's Guide for general details on the
architectures described here, especially the distinction between Microsoft
Windows messages, control notifications, and commands. This note assumes you
are very familiar with the issues described in the printed documentation and
only addresses very advanced topics.


=============================================================================

****
**** The VCTN022 technical article can be downloaded from the
**** file 11-50.zip in the ctech directory
****

Technical Note 22: Standard Commands Implementation

Created: February 11, 1993

Abstract

This note describes the standard command implementations provided by
Microsoft Foundation Class (MFC) version 2.0. Please be sure to read
Technical Note 21 first since that describes the mechanisms used to implement
many of the standard commands.

This description assumes knowledge of the MFC architectures, APIs, and
common programming practice. Documented as well as undocumented
"implementation only" APIs are described. This is not a place to start to
learn about the features of or how to program in MFC. Please refer to the
Class Library User's Guide for more general information and the Class Library
Reference for details of documented APIs.


=============================================================================

****
**** The VCTN023 technical article can be downloaded from the
**** file 11-51.zip in the ctech directory
****

Technical Note 23: Standard MFC Resources

Created: February 11, 1993

Abstract

This note describes the standard resources provided with and needed by the
Microsoft Foundation Class (MFC) library.


=============================================================================

****
**** The VCTN024 technical article can be downloaded from the
**** file 11-52.zip in the ctech directory
****

Technical Note 24: MFC-Defined Messages and Resources

Created: February 11, 1993

Abstract

This note describes the internal Microsoft Windows messages and resource
formats used by Microsoft Foundation Classes (MFC). This information explains
the implementation of the framework, and will assist you in debugging your
application. For the adventurous, even though all this information is
officially unsupported, you may use some of this information for advanced
implementations.

This note contains MFC private implementation details; all the contents are
subject to change in the future. MFC private Windows messages have meaning in
the scope of one application only but will change in the future to contain
system-wide messages.


=============================================================================

****
**** The VCTN025 technical article can be downloaded from the
**** file 11-53.zip in the ctech directory
****

Technical Note 25: Document, View, and Frame Creation

Created: February 11, 1993

Abstract

This note describes the creation and ownership issues for WinApps,
DocTemplates, Documents, Frames, and Views. You can find most of this
information, and other interesting creation and ownership issues, in Chapter
2of the Class Library Reference.


=============================================================================

****
**** The VCTN026 technical article can be downloaded from the
**** file 11-54.zip in the ctech directory
****

Technical Note 26: DDX and DDV Routines

Created: February 11, 1993

Abstract

This note describes the dialog data exchange (DDX) and dialog data
validation (DDV) architecture. It also describes how you write a DDX_ or DDV_
procedure and how you can extend ClassWizard to use your routines.


=============================================================================

****
**** The VCTN027 technical article can be downloaded from the
**** file 11-55.zip in the ctech directory
****

Technical Note 27: Emulation Support for Visual Basic Custom Controls

Created: February 11, 1993

Abstract

This technical note is an important supplement to the printed documentation
on Microsoft Foundation Class (MFC) support for VBX controls. Read chapter 17
of the Class Library User's Guide for an introduction to MFC support for VBX
controls. Refer to class CVBControl in the Class Library Reference for
details about this class that encapsulates VBX control support. Refer to the
following subsections of this note for additional information:

o  "Reporting Problems with VBX Controls" advises that if you have problems
using a specific VBX control, you should contact the developer of that VBX
control.

o  "Standard VBX Events" describes each of the standard VBX events that a
given VBX control might send, and how to interpret each type of event in an
MFC application.

o  "Standard VBX Properties" describes each of the standard VBX properties
that a given VBX control might have, and how to access each type of property
in an MFC application.

o  "Grid Control" provides a complete description of the VBX Grid control.
The GRID.VBX is included in the VC++ product. You may redistribute it with
your application. The VBX Grid control is illustrated in the VBCHART sample
application.

o  "CVBControl::m_nError Values" describes the error values that are stored
in CVBControl::m_nError when a property access function such as
CVBControl:SetNumProperty generates an error.

o  "VBX Event-Handling Function Parameters" describes how to interpret the
parameters that are sent to a VBX event-handling function by some VBX
controls.

o  "How to Manage VBX Picture Properties in MFC" describes how to place a
bitmap, metafile, or icon into a VBX control picture property, or retrieve
the picture from the VBX control.

o  "Differences Between Visual Basic VBX Support and MFC VBX Support"
describes in detail how MFC does not exactly emulate Visual Basic's handling
of VBX controls. Typically, you can use a VBX control without running into
problems related to the differences between the MFC and Visual Basic run-time
environments. Still, it's a good idea to become familiar with the differences
to avoid potential problems. It will be necessary for you to understand the
differences only if you need help in diagnosing unexpected VBX control
behavior or run-time errors. Developers of VBX controls should definitely
understand the differences between the MFC and Visual Basic run-time
environments.


=============================================================================

****
**** The VCTN028 technical article can be downloaded from the
**** file 11-56.zip in the ctech directory
****

Technical Note 28: Context-Sensitive Help Support

Created: February 11, 1993

Abstract

This note describes the rules for assigning Help contexts IDs (that is,
topic numbers) and other help issues in Microsoft Foundation Class (MFC) 2.0.
Context-sensitive Help support requires the help compiler, which is available
in Visual C++ Professional.


=============================================================================

****
**** The VCTN029 technical article can be downloaded from the
**** file 11-57.zip in the ctech directory
****

Technical Note 29: Splitter Windows

Created: February 12, 1993

Abstract

This note describes the AFX CSplitterWnd class, which is used to provide
window splits and to manage the resizing of other pane windows.

Note     Please be sure to read Technical Note 20 regarding the use of IDs
and valid ID ranges.


=============================================================================

****
**** The VCTN030 technical article can be downloaded from the
**** file 11-58.zip in the ctech directory
****

Technical Note 30: Customizing Printing and Print Preview

Created: February 12, 1993

Abstract

This note describes the process of customizing printing and print preview
and describes the purposes of the callback routines used in CView and the
callback routines and member functions of CPreviewView.


=============================================================================

****
**** The VCTN031 technical article can be downloaded from the
**** file 11-59.zip in the ctech directory
****

Technical Note 31: Control Bars

Created: February 12, 1993

Abstract

This note describes the control bar classes in Microsoft Foundation Class
(MFC): the general CControlBar, CStatusBar, CToolBar, and CDialogBar.


=============================================================================

****
**** The VCTN032 technical article can be downloaded from the
**** file 11-60.zip in the ctech directory
****

Technical Note 32: MFC Exception Mechanism

Created: February 12, 1993

Abstract

This note briefly describes the implementation of the Microsoft Foundation
Class (MFC) exception-handling mechanism as well as some of the more advanced
features.

Please refer to the Class Library User's Guide for more details on
exceptions.

Please refer to the Class Library Reference for details on the class
CException and derived classes. You should also refer to
CWinApp::ProcessWndProcException for details on the processing of unhandled
exceptions in Microsoft Windows-based applications.


=============================================================================

****
**** The VCTN033 technical article can be downloaded from the
**** file 11-61.zip in the ctech directory
****

Technical Note 33: DLL Version of MFC

Created: February 12, 1993

Abstract

This note describes how you can use the MFC200.DLL and MFC200D.DLL shared
dynamic-link libraries with Microsoft Foundation Class (MFC) applications.

This technical note covers three aspects of DLLs:

o  How you build an MFC application that uses the DLL version of MFC.

And for the more advanced users:

o  How you build an MFC Extension DLL.

o  How the MFC shared dynamic-link libraries are implemented.

If you are interested in building a DLL using MFC that can be used with
non-MFC applications (this is called the _USRDLL version), please refer to
Technical Note 11. 


=============================================================================

****
**** The VCTN034 technical article can be downloaded from the
**** file 11-62.zip in the ctech directory
****

Technical Note 34: Writing a Windows 3.0-Compatible MFC Application

Created: February 12, 1993

Abstract

This technical note describes how you can adapt your Microsoft Foundation
Class (MFC) application to run well under Microsoft Windows version 3.0.


=============================================================================

****
**** The VCTN035 technical article can be downloaded from the
**** file 11-63.zip in the ctech directory
****

Technical Note 35: Using Multiple Resource Files and Header Files with App
Studio

Created: February 12, 1993

Abstract

o  When might you want to split a project into multiple resource files
and/or header files, and how do you do it?

o  How do you share a common header .H file between two .RC files?

o  How do you divide project resources into multiple .RC files?

o  How do you (and the tools) manage build dependencies between .RC, .CPP,
and .H files?

This note assumes that you have read Chapter 2, "Working With Files and
Symbols", of the App Studio User's Guide. 

This note is structured to answer the above questions as follows: 

"Overview of How App Studio Manages Resource Files and Header Files"
provides an overview of how the File Set Includes command in App Studio lets
you use multiple resource files and header files in the same project.

"Analysis of AppWizard-created .RC and .H Files" looks at the multiple
resource and header files that are used by an AppWizard-created application.
These files serve as a good model for additional resource files and header
files you might want to add to your project.

"Including Additional Header Files" describes where you might want to
include multiple header files, and provides details how to do so.

"Sharing a Header File Between Two .RC Files" shows how you can share one
header file between multiple .RC files in different projects, or perhaps in
the same project.

"Using Multiple Resource Files in the Same Project" describes where you
might want to break up your project into multiple .RC files, and provides
details how to do so.

"Enforcement of Non-Editable App Studio Files" describes how you can make
sure App Studio does not edit and unintentionally reformat a custom resource.

"Managing Symbols Shared by Multiple App Studio-Edited .RC Files" describes
how to share the same symbols across multiple .RC files and how to avoid
assigning duplicate ID numeric values.

"Managing Dependencies Between .RC, .CPP, and .H Files" describes how App
Studio and Visual C++ avoid unnecessary recompiling of .CPP files that are
dependent on resource symbol files.

"How App Studio Manages Set Includes Information" provides technical details
about how App Studio keeps track of multiple (nested) .RC files and multiple
header files that are #include'd by an .RC file.


=============================================================================

****
**** The MSDN1 technical article can be downloaded from the
**** file 12-2.zip in the nettech directory
****

Writing Efficient Client-Server Applications Using Microsoft LAN Manager

Danny Glasser

Created: March 20, 1992

Abstract

This article discusses named pipes and their implementation in Microsoft LAN
Manager. It provides guidelines for improving the performance of a
client-server application. These guidelines include reducing the network
traffic, avoiding polling operations, and minimizing second-class mailslot
message traffic.


=============================================================================

****
**** The TCPTECHB technical article can be downloaded from the
**** file 12-9.zip in the nettech directory
****

Interfaces to the Microsoft LAN Manager TCP/IP Protocol

Margaret K. Johnson

Thanks to Mike Gunning (Hewlett-Packard); and Shirish Koti and Dan Perry
(Microsoft).

Abstract

This technical article will discuss the socket and RFC NetBIOS interfaces to
the Microsoft LAN Manager TCP/IP protocol stack (referred to as LM TCP/IP).
It is the second in a series of three technical articles covering LM TCP/IP.
The first technical article, "Implementation Details of the Microsoft LAN
Manager TCP/IP Protocol," discusses the internals of LM TCP/IP. The third
technical article, "Optimizing the Microsoft LAN Manager TCP/IP Protocol,"
covers MS-DOS memory management and performance issues as they relate to LM
TCP/IP. The objective of all three is to discuss concepts that you need to
understand to efficiently implement LM TCP/IP.

Parameters related to sockets are located in TCPUTILS.INI. Parameters
related to RFC NetBIOS are located in PROTOCOL.INI. Parameters contained in
either of these files will be in italics. Commands that can be typed at a
workstation are in bold.

If you do not have a strong background in programming to sockets, there are
many excellent references. Two popular references include Douglas Comer's
Internetworking with TCP/IP, Volume 1, and W. Richard Stevens' UNIX Network
Programming. 

If you are unfamiliar with the NetBIOS interface, two often-recommended
references are J. Scott Haugdahl's Inside NetBIOS and W. David Schwaderer's C
Programmer's Guide to NetBIOS. You might also want to obtain the Request For
Comment (RFC) documents relating to NetBIOS. These are RFC 1001 and RFC 1002.
Because RFC NetBIOS is based on NetBIOS 1.0, it might be useful to obtain the
IBM Technical Reference, PC Network 6322916, from IBM. This document defines
the NetBIOS 1.0 interface.


=============================================================================

****
**** The TCPTECHC technical article can be downloaded from the
**** file 12-10.zip in the nettech directory
****

Optimizing the Microsoft LAN Manager TCP/IP Protocol

Margaret K. Johnson

Thanks to Mike Gunning (Hewlett-Packard) and Mahesh Keni (Microsoft).

Abstract

This technical article is the third in a three-part series of articles that
discuss the Microsoft LAN Manager TCP/IP protocol stack (LM TCP/IP). It will
focus on issues to consider for maximizing conventional memory use on MS-DOS
clients and also cover performance issues. The first article, "Implementation
Details of the Microsoft LAN Manager TCP/IP Protocol," focuses on the
internals of the LM TCP/IP implementation. The second article, "Interfaces to
the Microsoft LAN Manager TCP/IP Protocol," addresses the sockets and NetBIOS
interfaces to LM TCP/IP.

Parameters that affect TCP/IP optimization are located in PROTOCOL.INI. When
mentioned, they will be in italics. Commands that can be typed at a
workstation are in bold.

It is assumed that the reader is familiar with MS-DOS memory management
schemes and understands the terms conventional memory, expanded memory, upper
memory, upper memory blocks, and extended memory.


=============================================================================

****
**** The CONCUR technical article can be downloaded from the
**** file 12-4.zip in the nettech directory
****

Maximizing Database Concurrency and Consistency with Microsoft SQL Server

Rick Vicik

Created: March 20, 1992

Abstract

Multiuser database applications encounter concurrency and consistency
problems when multiple users try to access and/or update the same information
at the same time. This article discusses the tradeoffs that must be made
between concurrency and consistency when designing such applications, and
explains how Microsoft SQL Server (the Sybase database server for PC
networks) addresses these issues.


=============================================================================

****
**** The CURSORS technical article can be downloaded from the
**** file 12-5.zip in the nettech directory
****

New for SQL Server Version 4.2: DB-Library Cursors

Rick Vicik

Created: March 20, 1992

Abstract

A key new feature in Microsoft SQL Server version 4.2 is the implementation
of cursors. This article gives an overview of cursors and how they are
implemented using DB-Library. The new DB-Library functions are listed and
discussed.


=============================================================================

****
**** The NTDBLIB technical article can be downloaded from the
**** file 12-12.zip in the nettech directory
****

Developing 32-Bit SQL Server Applications for the Microsoft Windows NT
Operating System

Christopher Moffatt
Microsoft Technical Resources Group

Abstract

The Microsoft Windows NT operating system is an ideal platform for building
robust, feature-rich applications for Microsoft SQL Server. The SQL Server
Programmer's Toolkit for Windows NT contains a 32-bit (Win32 API) version of
DB-Library, making it possible to develop DB-Library client applications for
Microsoft SQL Server on the Windows NT operating system.

The purpose of this technical article is to introduce DB-Library developers
to the Microsoft Windows NT platform, address issues involved in porting
existing DB-Library applications for the Windows version 3.x and OS/2
operating systems to the Windows NT operating system, and outline some of the
ways in which DB-Library applications can take advantage of the Win32
application programming interface (API).

This technical article assumes that you are familiar with the DB-Library
API, C programming, and the following documentation:

o  Microsoft SQL Server Programmer's Reference for C

o  Microsoft Win32 API Programmer's Reference, Volumes 1 & 2

o  Converting OS/2 Applications to Windows


=============================================================================

****
**** The NTODS technical article can be downloaded from the
**** file 12-13.zip in the nettech directory
****

Developing 32-Bit Open Data Services Applications for the Microsoft Windows
NT Operating System

Christopher Moffatt
Microsoft Technical Resource Group

Abstract

The Microsoft Windows NT operating system is an ideal platform for
building robust, feature-rich applications for Microsoft Open Data Services
and Microsoft SQL Server. The SQL Server Programmer's Toolkit for Windows NT
contains a 32-bit, Win32-based version of Open Data Services, making it
possible to develop Open Data Services-based server applications for the
Windows NT platform.
The purpose of this technical article is to introduce Open Data Services
developers to the Windows NT platform, address issues involved in porting
existing Open Data Services applications for the OS/2 operating system to
the Windows NT operating system, and outline some ways in which Open Data
Services applications can take advantage of the Win32 application programming
interface (API).
This technical note assumes that you are familiar with the Open Data
Services API, C programming in a multithreaded environment, and the following
documentation:

Microsoft Open Data Services Programmer's Reference
Microsoft Open Data Services Application Source Book
Microsoft Win32 API Programmer's Reference, Volumes 1 & 2
Converting OS/2 Applications to Windows



=============================================================================

****
**** The OPENDATA technical article can be downloaded from the
**** file 12-14.zip in the nettech directory
****

Microsoft Open Data Services: Application Sourcebook

Abstract

Microsoft Open Data Services, a key feature of Microsoft SQL Server version
4.2, opens up extensive possibilities for new client-server applications.
Simple applications written on top of Open Data Services can extend a SQL
Server application to the outside computing environment---to fetch data
values from another system, for example, or to notify a user on the
local-area network (LAN) of changes in the SQL Server database. A security
layer built with Open Data Services can verify login information with the
network operating system or maintain an audit log of client transactions.
Other applications for Open Data Services might not involve a SQL Server
database at all: Open Data Services can be used to build applications that
"look like" a SQL Server to a client on the LAN. These applications might do
something very simple, such as responding to a predetermined procedure call,
or they might perform more complex tasks, such as providing a general-purpose
gateway to another vendor's relational database.

Just as the client application programming interface (API) in SQL Server
allows corporate developers and independent software vendors (ISVs) to
produce unique and powerful client applications that share a common database
server, Open Data Services provides the foundation for a variety of server
applications that share a common client interface. By building applications
on top of Open Data Services, developers can take advantage of the work
Microsoft has done to design, build, test, support, and promote the
client-server protocol in SQL Server. The resulting applications can truly
enable client-server computing in the real world of established applications,
disparate networks, multiple vendors, and limited resources.

An earlier version of Open Data Services was sold separately as the
Microsoft SQL Server Gateway Development Kit. Including this server toolkit
in Microsoft SQL Server version 4.2 adds significant value and encourages you
to investigate its potential for powerful new applications.

This technical article gives an overview of how to build applications using
Open Data Services. It also suggests several useful applications, some of
which are very simple to implement. This discussion is not intended to limit
your creativity; instead, it is intended to stimulate creative thinking about
ways you can use Open Data Services.


=============================================================================

****
**** The SHOWPLAN technical article can be downloaded from the
**** file 12-15.zip in the nettech directory
****

Understanding Microsoft SQL Server's Query Optimizer (SHOWPLAN) Output

Gary Schroeder
SQL Server Escalation Engineer
Microsoft Corporate Support

Microsoft SQL Server includes a very intelligent cost-based query optimizer
which, given an ad-hoc query, can quickly determine the best access method
for retrieving the data, including the order in which to join tables and
whether or not to use indexes that may be on those tables. By using a
cost-based query optimizer, the System Administrator or end user is released
from having to determine the most efficient way of structuring the query to
get optimal performanceinstead, the optimizer looks at all possible join
orders, and the cost of using each index, and picks the plan with the least
cost in terms of page I/Os.

Detailed information on the final access method that the optimizer chooses
can be displayed for the user by executing the Transact-SQL "SET SHOWPLAN
ON" command. This command will show each step that the optimizer uses in
joining tables and which, if any, indexes it chooses to be the least-cost
method of accessing the data. This can be extremely beneficial when analyzing
certain queries to determine if the indexes that have been defined on a table
are actually being considered by the optimizer as useful in getting to the
data. This document will define and explain each of the output messages from
SHOWPLAN, and give example queries and the output from SHOWPLAN to illustrate
the point. The format will be consistent throughout: a heading that
corresponds to the exact text of a SHOWPLAN statement, followed by a
description of what it means, a sample query that generates that particular
message, and the full output from executing the query with the SHOWPLAN
option on. Wherever possible, the queries will use the existing tables and
indexes, unaltered, from the SQL Server "Pubs" sample database.

=============================================================================

****
**** The SQLAPPS technical article can be downloaded from the
**** file 12-6.zip in the nettech directory
****

Tips for Creating Well-Behaved SQL Server Front-Ends

Rick Vicik and Todd Needham

Created: March 20, 1992

Abstract

This article discusses suggested conventions to use when creating a
front-end tool for SQL Server. Because many front-end tools can access a
single SQL Server at any one time, using conventions may prevent contention
among the front-ends accessing the server.


=============================================================================

****
**** The WINDBASE technical article can be downloaded from the
**** file 12-16.zip in the nettech directory
****

Developing Microsoft Windows-Based Applications for Microsoft SQL Server

Abstract

The Microsoft SQL Server family of products is ideally suited to the
development of client-server applications and solutions. On the server side,
the powerful relational database management system (RDBMS) supports the
development of industrial-strength, mission-critical applications. On the
client side, Microsoft has promoted and supported an open-ended architecture
that has resulted in over 125 front-ends for SQL Server.

Most client applications that work with SQL Server can be developed using
powerful off-the-shelf application development tools provided by independent
software vendors (ISVs). These fourth-generation tools, and some custom
applications, are developed with a third-generation language (3GL), most
commonly C or C++, using a call-level interface (CLI). You must consider two
CLIs when developing 3GL-based client applications for SQL Server: the SQL
Server native DB-Library and Microsoft Open Database Connectivity (ODBC).

The success of the Microsoft Windows graphical environment on the desktop
has resulted in its becoming the premier platform on which to deliver client
applications for client-server solutions. The Windows environment in general,
and its cooperative multitasking nature in particular, demands that you use
special care to write applications that are "well-behaved" and that coexist
peacefully with other applications a user might run.

This technical article focuses on DB-Library programming techniques for
Windows-based SQL Server client applications. DB-Library, a set of C
functions and macros, allows your applications to interact with SQL Server.
It includes functions that send Transact-SQL statements to SQL Server and
functions that process the results of those statements. Other functions
handle errors, convert data, and provide a variety of information about the
interaction with SQL Server.

DB-Library is well-suited for the development of Windows-based applications,
and this article highlights areas of DB-Library development that are unique
to the Windows environment and often not well understood. This article
assumes that you are familiar with the DB-Library application programming
interface (API) and with Windows-based programming. For detailed information
about DB-Library, see the DB-Library Programmer's Reference.


=============================================================================

****
**** The BROWSE technical article can be downloaded from the
**** file 12-17.zip in the nettech directory
****

Browsing for Network Servers in C and Visual Basic

Dale E. Rogerson
Microsoft Developer Network Technology Group

Created: April 16, 1993

Abstract

Some of the network functions in Microsoft Windows for Workgroups are not
exported by USER.EXE, but are implemented by the network driver instead. As a
result, these functions cannot be called directly from a Visual Basic or C
program. This article describes how you can access these driver-implemented
functions from Visual Basic and C using a dynamic-link library (DLL) written
in C.

This article is intended for C or Visual Basic programmers who are familiar
with writing C DLLs. The network functions discussed on these pages are
included only in Windows for Workgroups version 3.1.

Two Visual Basic sample applications, VBDest and VBSource, accompany this
article. VBDest establishes a Network Dynamic Data Exchange (Network DDE)
conversation with VBSource by calling the WNetServerBrowseDialog function to
get the name of the server on which VBSource resides. Net Gomuku is a more
sophisticated sample application; it also demonstrates the use of
WNetServerBrowseDialog.


=============================================================================

****
**** The NETDDE technical article can be downloaded from the
**** file 12-18.zip in the nettech directory
****

Reach Out and Exchange: A Network DDE Overview

Dale E. Rogerson
Microsoft Developer Network Technology Group

Created: February 15, 1993

Abstract

This article provides an overview of the Network Dynamic Data Exchange
(Network DDE) mechanism in Microsoft Windows for Workgroups version 3.1. All
DDE programmers who want to learn about Network DDE---whether they program in
C/C++, WordBasic, or Visual Basic---will find this information useful. The
reader should be familiar with the general concepts of DDE programming. The
article also discusses the Network DDE Share Manager (DDESHARE.EXE), which is
included in the Windows for Workgroups Resource Kit and on the Microsoft
Developer Network CD (look under Product Documentation in the Source index).

The article includes a step-by-step example of building simple Network DDE
applications with Visual Basic. For more sophisticated networking features,
readers are encouraged to take a look at the NetGo sample application
included with this technical article.


=============================================================================

****
**** The NETSOUND technical article can be downloaded from the
**** file 12-19.zip in the nettech directory
****

Network DDE and Multimedia Combine to Let You Talk to Your Peers

Herman Rodent
Microsoft Developer Network Technology Group

Created: April 5, 1993

Abstract

This article describes a dynamic data exchange (DDE) server that plays
sounds in response to a set of DDE commands. The server can play a WAVE file,
WAVE data sent from a DDE client, or one of a set of built-in sounds. Two
sample applications accompany this article: SoundSrv, a Visual Basic
application, demonstrates the internal sounds of the server, and SoundCli, a
DDE client application, enables a WAVE file or live sound to be sent over a
network via DDE to a remote machine running the sound server.

To play with the samples, you will need two machines equipped with sound
cards running Microsoft Windows for Workgroups and connected to a network. 


=============================================================================

****
**** The VBSHARE technical article can be downloaded from the
**** file 12-21.zip in the nettech directory
****

Learning to Share: Network DDE Shares and Visual Basic

Dale E. Rogerson
Microsoft Developer Network Technology Group

Created: April 15, 1993

Abstract

This article explains how you can add Network Dynamic Data Exchange (Network
DDE) shares to a system from Visual Basic. It discusses the NDdeShareAdd and
NDdeShareDel functions exported from the NDDEAPI.DLL library, which is a
component of the Microsoft Windows for Workgroups version 3.1 operating
system.

The techniques presented in this article are demonstrated in two basic
applications: VBSource and VBDest. The Net Gomuku game is a more elaborate
application (that is, it actually does something); see the Net Gomuku help
file for information on running this sample.


=============================================================================

****
**** The XTALKDDE technical article can be downloaded from the
**** file 13-7.zip in the wbtech directory
****

DDE Programming in Crosstalk for Windows

Julianne Sharer

Created: March 20, 1992

Abstract

Crosstalk for Windows is a communications program designed for the Microsoft
Windows graphical environment that supports dynamic data exchange (DDE)
protocols. Crosstalk can interact with other applications as a client or as a
server through the use of scripts. This article describes the Crosstalk
programming language and provides sample scripts that illustrate Crosstalk's
implementation of DDE.


=============================================================================

****
**** The PRAT1 technical article can be downloaded from the
**** file 13-3.zip in the wbtech directory
****

DDE Success Stories---Data Management with Microsoft Word for Windows and
Polaris PackRat

Timothy-James Lee

Created: April 25, 1992

Abstract

Polaris PackRat is an information management tool that runs in the Microsoft
Windows graphical environment. This tool lets users store different types of
personal data, such as phone logs, names, addresses, index cards,
appointments, and to-do lists. PackRat can provide information to other
Windows-based applications through dynamic data exchange (DDE) protocols.
PackRat acts as a DDE server and responds to information requests from client
applications. This article gives an overview of the PackRat DDE
implementation and describes how PackRat can be integrated with Microsoft
Word for Windows to facilitate data management tasks.


=============================================================================

****
**** The DYNACOMM technical article can be downloaded from the
**** file 13-1.zip in the wbtech directory
****

Developing DDE Applications in DynaComm

Julianne Sharer

Created: March 30, 1992

Abstract

DynaComm is a communications package that allows you to build dynamic data
exchange (DDE) applications. An application developed in DynaComm can be a
DDE client or a DDE server, or can act as both client and server
simultaneously. This article describes the DynaComm programming environment
and explains how to create DDE client and server scripts. It also discusses
the limitations of DynaComm's DDE implementation, explains workarounds for
problems, and includes a summary of DynaComm's DDE commands and functions.


=============================================================================

****
**** The QPLUSE technical article can be downloaded from the
**** file 13-4.zip in the wbtech directory
****

Dynamic Data Exchange with Q+E

Julianne Sharer

Created: March 20, 1992

Abstract

WexTech Systems, Inc., has developed several mission-critical applications
for its clients with Pioneer Software's Q+E database editor serving as a data
engine. The Q+E interface is easy to learn and use. It provides all the
functionality required to create, index, update, view, and print the contents
of files in a variety of data formats, but it contains no scripting language
of its own.

The language you use to automate these routines is the macro language in
your favorite Microsoft Windows or OS/2 package, and dynamic data exchange
(DDE). All the commands that you can perform from Q+E's interface can also be
performed with DDE execute strings. Pioneer's DDE command set includes
several additional commands not available from the interface that are useful
during DDE conversations.

Developers experienced in DDE applications will find it easy to learn Q+E's
ropes; the commands are clearly documented and in almost all cases work as
advertised. This article provides pointers for using Q+E's DDE commands. It
is not intended to replace the Q+E User's Guide but can be used as a "guide
to the guide." 


=============================================================================

****
**** The REALTIPS technical article can be downloaded from the
**** file 13-5.zip in the wbtech directory
****

EchoOff for WordBasic Macros

Based on materials originally presented by Steven S. Wexler

Created: March 20, 1992

Abstract

Have you ever wanted to stop screen updates when running a Microsoft Word
for Windows macro? This article describes two subroutines, EchoOff and
EchoOn, that use Windows dynamic-link library (DLL) calls to duplicate the
behavior of Microsoft Excel's ECHO macro function for the active Word window.
Because the EchoOff subroutine inhibits all redrawing of a window until you
call EchoOn or restart Word for Windows, we advise caution and good debugging
when using these subroutines.


=============================================================================

****
**** The TJTIPS technical article can be downloaded from the
**** file 13-6.zip in the wbtech directory
****

Using Private Initialization Files with WordBasic

Timothy-James Lee

Created: April 26, 1992

Abstract

This article discusses the use of initialization files to store and access
information in WordBasic. It covers two types of initialization files: the
WIN.INI file used by the Microsoft Windows graphical environment and private
initialization files used by applications that run under Windows. The article
discusses the advantages and disadvantages of both types of files and focuses
on the implementation and use of private initialization files, which provide
the safest and cleanest method for storing variable values for all macros to
access and use.

The private initialization file macros and techniques described in this
article were designed for Microsoft Word for Windows version 2.0 and later.
We do not recommend their use in Word for Windows version 1.x.


=============================================================================

****
**** The NEW20 technical article can be downloaded from the
**** file 13-2.zip in the wbtech directory
****

What's New in Microsoft Word for Windows Version 2.0?{ Parts of this article
were written by Guy J. Gallo, Julianne Sharer, and Steve Wexler and have
appeared previously in the Proceedings of the Word Developers' Tools
Conference, 1991.} 

Created: April 25, 1992

Abstract

This article discusses the new macro language features in Microsoft Word for
Windows version 2.0. It explains how to use push buttons in user dialog
boxes, create user dialog boxes with the Dialog Editor, pass parameters
between macros, encrypt macros, and use other new commands. It illustrates
the explanations with sample code and includes a sample application for
moving macros between templates.


=============================================================================

****
**** The DEBUG technical article can be downloaded from the
**** file 14-6.zip in the 32tech directory
****

The Win32 Debugging Application Programming Interface

Randy Kath
Microsoft Developer Network Technology Group

Created: November 5, 1992

Abstract

This article demonstrates how the debugging support in the Microsoft Win32
Application Programming Interface (API) can be used by developers to create
custom debugging applications that behave exactly the way they want,
including any specific features they desire. Specifically, this article
discusses the following topics:

o  {3 {5 \*SYMBOL 183 \f "Symbol" \s 10 \h}5 {5 }5 }3 Exploring the built-in
debugging support of Win32, including Win32 debug events and Win32 debug
functions

o  {3 {5 \*SYMBOL 183 \f "Symbol" \s 10 \h}5 {5 }5 }3 Looking at the
relationship between a debugger and the process being debugged

o  {3 {5 \*SYMBOL 183 \f "Symbol" \s 10 \h}5 {5 }5 }3 Representing
information about a process being debugged

o  {3 {5 \*SYMBOL 183 \f "Symbol" \s 10 \h}5 {5 }5 }3 Using event objects
for communicating between debugger threads

o  {3 {5 \*SYMBOL 183 \f "Symbol" \s 10 \h}5 {5 }5 }3 Managing the
debugger's graphical user interface (GUI)

o  {3 {5 \*SYMBOL 183 \f "Symbol" \s 10 \h}5 {5 }5 }3 Responding to user
commands in debug threads

o  {3 {5 \*SYMBOL 183 \f "Symbol" \s 10 \h}5 {5 }5 }3 Controlling the
threads of a process being debugged

o  {3 {5 \*SYMBOL 183 \f "Symbol" \s 10 \h}5 {5 }5 }3 Accessing thread
context information from threads of a process being debugged

o  {3 {5 \*SYMBOL 183 \f "Symbol" \s 10 \h}5 {5 }5 }3 Terminating and
exiting a process being debugged

o  {3 {5 \*SYMBOL 183 \f "Symbol" \s 10 \h}5 {5 }5 }3 Calling debug
functions from a process being debugged

o  {3 {5 \*SYMBOL 183 \f "Symbol" \s 10 \h}5 {5 }5 }3 Expanding on this
debugger model

Each of the key concepts presented is supported with code segments extracted
from a sample debugging application called DEBUGAPP.EXE, whose source is
included with this article. The sample application stands on its own as a
multiprocess debugging application, or its source code can be used as the
framework for a more elaborate custom debugger.


=============================================================================

****
**** The HEAPMM technical article can be downloaded from the
**** file 14-7.zip in the 32tech directory
****

Managing Heap Memory in Win32

Randy Kath
Microsoft Developer Network Technology Group

Created: April 3, 1993

Abstract

Determining which function or set of functions to use for managing memory in
your Win32 application is difficult without a solid understanding of how each
group of functions works and the overall impact they each have on the
Microsoft Windows NT operating system. In an effort to simplify these
decisions, this technical article focuses on the use of heaps in Win32: the
functions that are available, the way they are used, and the impact their use
has on operating system resources. The following topics are discussed:

o  The purpose of heaps in Win32

o  General heap behavior

o  Two types of heaps in Win32

o  Global and local memory functions

o  Win32 heap memory functions

o  Overhead on heap memory allocations

o  Summary and recommendations

In addition to this technical article, a sample application called
ProcessWalker is included on the Microsoft Developer Network CD. This sample
application explores the behavior of heap memory functions in a process, and
it provides several useful implementation examples.


=============================================================================

****
**** The MMFILE technical article can be downloaded from the
**** file 14-3.zip in the 32tech directory
****

Managing Memory-Mapped Files in Win32

Randy Kath
Microsoft Developer Network Technology Group

Created: February 9, 1993

Abstract

Determining which function or set of functions to use for managing memory in
your Win32 application is difficult without a solid understanding of how each
group of functions works and the overall impact they each have on the
Microsoft Windows NT operating system. In an effort to simplify these
decisions, this technical article focuses on the use of the memory-mapped
file functions in Win32: the functions that are available, the way they are
used, and the impact their use has on operating system resources. The
following topics are discussed in this article:

o  Introduction to managing memory in Windows operating systems

o  What are memory-mapped files?

o  How are memory-mapped files implemented?

o  Sharing memory with memory-mapped files

o  Using memory-mapped file functions

In addition to this technical article, a sample application called
ProcessWalker is included on the Microsoft Developer Network CD. This sample
application is useful for exploring the behavior of memory-mapped files in a
process, and it provides several useful implementation examples.


=============================================================================

****
**** The NTVMM technical article can be downloaded from the
**** file 14-5.zip in the 32tech directory
****

The Virtual-Memory Manager in Windows NT

Randy Kath
Microsoft Developer Network Technology Group

Created: December 21, 1992

Abstract

This article provides an in-depth survey of the memory management system in
Windows NT. Specifically, these topics are explored in detail:

This article does not discuss the Win32 memory management application
programming interface (API). Instead, several other technical articles on the
Microsoft Developer Network CD should be referenced for issues related to
understanding how to manage memory with the Win32 API. Those articles provide
both insight into the system and understanding of the functions themselves.
While this article primarily deals with Windows NT-specific memory management
issues, it does refer to some of the memory objects in the Win32 subsystem
(like memory-mapped files and dynamic heaps) in an attempt to shed some light
on the age-old dilemma of performance vs. resource usage as it applies to
applications written for the Win32 subsystem in Windows NT. 

As the size of applications and the operating systems that run them grow
larger and larger, so do their demands on memory. Consequently, all modern
operating systems provide a form of virtual memory to applications. Being the
newest of the operating systems to hit the main stream, Windows NT will
likely have applications ported to it that will evolve into larger
monstrosities that require even more memory than they did on the last
operating system on which they ran. Even applications being written
exclusively for Windows NT will be written with the future in mind and will
no doubt take advantage of all the memory that is available to them.

Fortunately, Windows NT does, in fact, offer virtual memory to its
applications (or processes) and subsystems. Windows NT provides a page-based
virtual memory management scheme that allows applications to realize a 32-bit
linear address space for 4 gigabytes (GB) of memory. As a result, each
application has its own private address space from which it can use the lower
2GB---the system reserves the upper 2 GB of every process's address space for
its own use.

If only we had PCs with similar memory capacities. . . . Actually, a
computer doesn't really need 4 GB of physical memory for Windows NT to
operate effectively---though the general rule of virtual memory systems is
the more physical memory, the better the performance. Windows NT's memory
management system virtualizes memory such that to each application it appears
as though there is 2 GB of memory available, regardless of how much physical
memory actually exists. In order to do this, Windows NT must manage memory in
the background without regard to the instantaneous requests that each
application makes. In fact, the memory manager in Windows NT is a completely
independent process consisting of several threads that constantly manage
available resources.

Windows version 3.x has realizable limitations to the maximum amount of
memory available to it and all of its applications; these are often barriers
to large applications for this environment. Windows NT's limits are far more
theoretical. Windows NT employs the PC's hard disk as the memory-backing
store and, as such, has a practical limit imposed only by available disk
space. So, it is reasonable to assume that a Windows NT system could have an
extremely large hard disk or array of disks amounting to 2 GB or more of
physical memory and provide that much virtual memory to each of its
applications (minus the portions used by the system, occupied by the file
system, and allocated by files stored within the file system). In short,
Windows NT provides a seemingly endless supply of memory to all of the
applications running on it. 


=============================================================================

****
**** The PORTING technical article can be downloaded from the
**** file 14-2.zip in the 32tech directory
****

Porting 16-Bit Windows-Based Applications to Win32

Randy Kath
Microsoft Developer Network Technology Group

Created: July 15, 1992

Abstract

Porting an application from one operating system to another is a chore that
many software engineers find they must repeatedly perform to keep up with the
rapidly changing software industry. Fortunately for developers of
applications for the Microsoft Windows operating system, the Win32
Application Programming Interface (API) specification was designed to
eliminate this frustration. In fact, the Win32 API so resembles the Windows
version 3.1 Software Development Kit (SDK) that many applications need only
minor adjustments and a recompile for a complete port. Yet other
applications, those that take advantage of operating system or
hardware-specific features, require more time to rework incompatibilities.

Several measures, however, can significantly reduce the amount of time
required to complete this process. This article focuses on measures that
reduce the porting effort and introduces a porting tool that further assists
in porting 16-bit Windows-based applications to the Win32 environment.


=============================================================================

****
**** The VIRTMM technical article can be downloaded from the
**** file 14-4.zip in the 32tech directory
****

Managing Virtual Memory in Win32

Randy Kath
Microsoft Developer Network Technology Group

Created: January 20, 1993

Abstract

Determining which function or set of functions to use for managing memory in
your Win32 application is difficult without a solid understanding of how each
group of functions works and the overall impact they each have on the
Microsoft Windows NT operating system. In an effort to simplify these
decisions, this technical article focuses on the Win32 virtual memory
management functions: which ones are available, how they are used, and how
their use affects the operating system. The following topics are discussed in
this article:

o  Reserving, committing, and freeing virtual memory

o  Changing protection on pages of virtual memory

o  Locking pages of virtual memory

o  Querying a process's virtual memory

A sample application called ProcessWalker accompanies this technical article
on the Microsoft Developer Network CD. This sample application is useful for
exploring the virtual address space of a process. It also employs the use of
virtual memory functions for implementing a linked list structure.

The first version of the Microsoft Windows operating system introduced a
method of managing dynamic memory based on a single global heap, which all
applications and the system share, and multiple, private local heaps, one for
each application. Local and global memory management functions were also
provided, offering extended features for this new memory management system.
More recently, the Microsoft C run-time (CRT) libraries were modified to
include capabilities for managing these heaps in Windows using native CRT
functions such as malloc and free. Consequently, developers are now left with
achoice---learn the new application programming interface (API) provided as
part of Windows version 3.1 or stick to the portable, and typically familiar,
CRT functions for managing memory in applications written for Windows 3.1.

With the addition of the Win32 API, the number of choices increases. Win32
offers three additional groups of functions for managing memory in
applications: memory-mapped file functions, heap memory functions, and
virtual memory functions. These new functions do not replace the existing
memory management functions found in Windows 3.1; rather, they provide new
features that generally make life easier for developers when writing the
memory management portions of their applications for Win32.

In all, six sets of memory management functions exist in Win32, as shown in
Figure 1, all of which were designed to be used independently of one another.
So, which set of functions should you use? The answer to this question
depends greatly on two things: the type of memory management you want and how
the functions relevant to it are implemented in the operating system. In
other words, are you building a large database application where you plan to
manipulate subsets of a large memory structure? Or maybe you're planning some
simple dynamic memory structures, such as linked lists or binary trees? In
both cases, you need to know which functions offer the features best suited
to your intention and exactly how much of a resource hit occurs when using
each function.


=============================================================================

****
**** The WIN32DLL technical article can be downloaded from the
**** file 14-1.zip in the 32tech directory
****

DLLs in Win32

Randy Kath
Microsoft Developer Network Technology Group

Created: September 15, 1992

Abstract

The ability of an application to load and execute code from an external
source at run time is one of the most useful features in software technology
today. The Win32 Application Programming Interface (API) provides this
functionality through dynamic-link libraries (DLLs). They are implemented as
separate source modules that are compiled and linked into libraries,
independent of the application that uses them. Also, DLLs are reentrant code,
allowing multiple threads of execution to use the same DLL simultaneously.
DLLs have been a part of the Microsoft Windows operating system for some
time, remaining pretty much the same through Windows version 3.1. In Win32,
however, DLLs have been changed to take advantage of new, Win32
memory-management features and to improve the interface between applications
and DLLs.

This article explores DLLs in their Win32 form. It describes how DLLs exist
in memory when loaded, how to build a DLL, how to use a DLL for sharing
memory between processes, and how to dynamically load and execute code in a
DLL.

The code examples in this article were extracted from the source code
written for the PortTool program. The only exception is the example on using
function tables to call functions in a DLL.


=============================================================================
