Category : Information about the Internet from the early 1990's
Archive   : MSDN0394.ZIP
Filename : MSDN-IDX
Output of file : MSDN-IDX contained in archive : MSDN0394.ZIP
**** The BACK sample can be downloaded from the
**** file 3-1.zip in library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 ISO sample can be downloaded from the
**** file 3-72.zip in library section number 3
****
ISO: Uses MM_ANISOTROPIC with CScrollView
ISO is a companion sample application for the "Scrolling
with MM_ANISOTROPIC"msdn_scroll technical article on the
Microsoft Developer Network CD.
The CScrollView class does not directly support using the
MM_ISOTROPIC and MM_ANISOTROPIC mapping modes. The ISO
sample application demonstrates how to use these mapping
modes with the CScrollView class. The basic strategy is to
tell CScrollView to use MM_TEXT, but to set the mapping
mode to MM_ISOTROPIC or MM_ANISOTROPIC in the OnPrepareDC
member function.
ISO.EXE uses the Microsoft(R) Foundation Class Library and
was built with Microsoft Visual C++(TM) version 1.0. It
was compiled and tested under Microsoft Windows(TM)
version 3.1.
KEYWORDS: CD5; CScrollView; ISO; MM_ANISOTROPIC;
MM_ISOTROPIC; MM_TEXT; mapping modes; non-constrained
mapping modes; scaling; Tangram
=============================================================================
=============================================================================
****
**** The NEWOPR sample can be downloaded from the
**** file 3-4.zip in library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 PICTEST sample can be downloaded from the
**** file 3-73.zip in library section number 3
****
PICTEST: Demonstrates Picture Edit Controls
PICTEST demonstrates the Microsoft(R) ITG Picture Edit
Controls, which provide mask editing for data fields such
as a phone number, part number, or zip code. They allow a
user to merely enter the data characters, leaving the
formatting to the control.
As soon as the user starts to enter data, the cursor jumps
to the correct position and validates the user's
keystrokes against the edit mask.
The user only has to enter the raw numbers and not the
formatting characters. Similarly, the programmer can
request just the data from the control and it will provide
only the raw numbers, removing the mask characters. When
loading the control, the programmer can also set the data
in the control by providing only the raw data. Since most
databases store phone numbers and other formatted data
without formatting characters, this is extremely useful.
If the programmer has a list of phone numbers for a
particular customer, there is a Picture Edit combo box.
This is very powerful because it combines a list of data
with a place to edit each member of the list in one
control.
When the user opens the combo box by clicking the down
arrow on the right side of the edit box, he or she then
sees the list of data items in the control. This differs
from a standard combo box in that the user edits only what
is in the list and cannot type a new item into the edit
portion of the combo box. As the user enters data into the
edit portion, the item in the list is updated.
The programmer can set or get the raw data from any item
in the combo box and perform most other combo box
functions, such as setting the current selection, deleting
an item, adding a new mask, or inserting a mask. The
control can work with a sorted or nonsorted combo box. A
detailed explanation of features can be found in the
"Microsoft Picture Edit Controls 1.0 for MFC"msdn_picmsdn
technical article by David Stearns on the Microsoft
Development Library.
The Microsoft ITG Picture Edit Control Libraries 1.0 are
designed and built using the Microsoft Foundation Classes
2.0 (MFC). They are designed to work in MFC executables
and DLLs. They were written in C++ and employ many of the
MFC classes. The Microsoft ITG Picture Edit Control
Libraries 1.0 cannot be used with non-MFC applications.
KEYWORDS: CD6; CCNSPhoneCombo; ClearCombo; CNS;
CNSAddressCombo; CPhoneCombo; CPicCombo; CPicEdit;
DeleteMask; FindIndex; GetAreaCode; GetCurSelID;
GetExtension; GetLocal; SetAreaCode; SetCurSelID;
SetExtension; SetLocal; SubclassCombo; AFX; _AFXDLL;
_USRDLL
=============================================================================
=============================================================================
****
**** The RULER sample can be downloaded from the
**** file 3-74.zip in library section number 3
****
RULER: Demonstrates Creation of Frame Window
This sample application shows how Microsoft(R) Visual
C++(TM) with the Microsoft Foundation Class Library can be
used to create an application that does not use the
document/view architecture generated by the AppWizard in
Visual C++.
RULER uses the frame window to do all its work. The window
is created without a frame or caption. The mouse can be
used to drag the window around the screen. Double-clicking
the left mouse button rotates the ruler 90 degrees and
redraws it in the new orientation. The right mouse button
brings up a floating menu that can be used to show the
application's About box or cause the application to exit.
Build and run-time information:
> Target system: Windows NT(TM) or Windows(TM) 3.1 with
Win32s(TM)
> Development system: Windows NT
> Development tools: Microsoft Visual C++ with Microsoft
Foundation Class Library version 2.0
> Development time: Three days
> Tested on: Windows NT (80486), Windows NT (MIPS),
Windows 3.1 with Win32s installed
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The SMART sample can be downloaded from the
**** file 3-6.zip in library section number 3
****
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 library section number 3
****
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 TANGRAM sample can be downloaded from the
**** file 3-75.zip in library section number 3
****
TANGRAM: A Fun Puzzle and Sample Application
TANGRAM is a companion sample application for the
"Scrolling with MM_ANISOTROPIC"msdn_scroll, "Tangram:
Tricks of the Trade"msdn_tangram, "Multiple Views for a
Single Document"msdn_2vw1doc, and "Painting the MDI Client
Area"msdn_mymdi technical articles on the Microsoft
Developer Network CD.
TANGRAM is a computerized version of the popular tangram
puzzle. This graphical sample shows a variety of
techniques for using the power and features of the
Microsoft(R) Foundation Class Library. Some of the
techniques demonstrated include:
> Writing your own scrolling class to replace
CScrollView. CTangramScrollView scrolls in logical units
instead of device units. It also uses the MM_ANISOTROPIC
mapping mode.
> Multiple view classes for a single document class.
CTangramView displays a graphical representation of the
data in CTangramDoc, while CBugView displays a text dump
of the data.
> Painting the client area of your view class by handling
the WM_ERASEBKGND message.
> Painting the MDI (multiple document interface) client
area by subclassing the MDICLIENT window.
> Dynamically updating the status bar.
> Creating metafiles.
> Copying metafiles to the Clipboard.
> Using a dedicated hinting class.
> Avoiding mouse button double-clicks.
> Using multiple-pane windows.
> Scaling output in a view.
TANGRAM.EXE uses the Microsoft Foundation Class Library
and was built with Microsoft Visual C++(TM) version 1.0.
It was compiled and tested under Microsoft Windows(TM)
version 3.1.
KEYWORDS: CD5; CScrollView; hinting; ISO; mapping modes;
MDICLIENT; MM_ANISOTROPIC; MM_ISOTROPIC; MM_TEXT; non-
constrained mapping modes; OnEraseBkgnd; OnIconEraseBkgnd;
OnUpdate; scaling; SetMapMode; SetViewportExt;
SetViewportOrg; SetWindowExt; SetWindowOrg; status bar;
subclassing; Tangram; UpdateAllViews; WM_ERASEBKGND
=============================================================================
=============================================================================
****
**** The ZUSAMMEN sample can be downloaded from the
**** file 3-7.zip in library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 EMFDCODE sample can be downloaded from the
**** file 3-76.zip in library section number 3
****
EMFDCODE: Decodes Enhanced Windows, Placeable, and .CLP
Metafiles
EMFDCODE accompanies the "EMFDCODE.EXE: An Enhanced
Metafile Decoding Utility"msdn_emfdcode technical article
on the Microsoft Developer Network CD. EMFDCODE is a
Win32(TM) application that was ported from the WMFDCODE
sample in the Microsoft(R) Windows(TM) version 3.1
Software Development Kit (SDK). It decodes four types of
metafiles: enhanced, Windows, and "placeable" metafiles,
and metafiles that are saved in the Clipboard as .CLP
files. EMFDCODE enumerates and plays all or a specified
range of records in a metafile.
Choose the File Open command from the EMFDCODE main window
to read in a metafile. Select BIRD32.EMF, BIRD.WMF,
BALLON32.CLP, or BALLON.CLP, which are provided as
examples. The File Save As command permits conversion
between enhanced metafiles and Windows metafiles.
The View Headers command displays information on the
enhanced metafile header, Windows metafile header, the
METAFILEPICT data structure, and the placeable WMF header.
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.
EMFDCODE was built and tested under Microsoft Windows
NT(TM) version 3.1.
KEYWORDS: CD5; CheckMenuItem; CopyEnhMetaFileBits;
CopyMetaFileBitsEx; CreateDialog; DeleteDC;
DeleteEnhMetaFile; DestroyWindow; DialogBox;
EnableMenuItem; EnableWindow; Escape;
GetEnhMetaFileDescription; GetEnhMetaFileHeader;
GetEnhMetaFilePaletteEntries; GetMetaFile;
GetMetaFileBitsEx; GetWinMetaFileBits; GlobalAlloc;
GlobalFree; GlobalUnlock; LoadCursor; MessageBox;
PlayEnhMetaFile; PlayEnhMetaFileRecord; PlayMetaFile;
PlayMetaFileRecord; SendDlgItemMessage; SetCursor;
SetMapMode; SetMetaFileBitsEx; SetViewportExt;
SetViewportOrg; SetWinMetaFileBits; lstrcat; wsprintf
=============================================================================
=============================================================================
****
**** The EZPRINT sample can be downloaded from the
**** file 3-59.zip in library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 ECP sample can be downloaded from the
**** file 3-77.zip in library section number 3
****
ECP: Tests the Extended Capabilities Port
The Extended Capabilities Port (ECP) compliance test is
used to verify that a given ECP ISA port functions
properly. The test, of course, cannot possibly test all
possible combinations of problems. It is useful, however,
to verify many of the known ECP hardware design functions.
The ECP compliance test must pass on all IBM(R)-compatible
386 PCs in order for an ECP port to be in compliance with
the Microsoft ECP Specification.
ECP is a companion application for the "Extended
Capabilities Port Protocol and ISA Interface Standard"
specification and was built with Microsoft(R) Visual
C++(TM). Any errors encountered during the build process
indicate a development environment different from the
standard installation environment setup.
KEYWORDS: CD6; IEEE P1284
=============================================================================
=============================================================================
****
**** The ISOLATE sample can be downloaded from the
**** file 3-78.zip in library section number 3
****
ISOLATE: Checks Plug-and-Play Cards
ISOLATE is used to isolate and assign a CSN (card select
number) for each plug-and-play card in either a
Microsoft(R) Windows(TM) or MS-DOS(R) environment. It has
not been run under Windows NT(TM), and it will likely
cause some form of protection violation based on the way
I/O is performed (for example, directly to the ports).
After the cards have been isolated, their configuration
information is queried and parsed for display in a useful
format. This process subsequently provides a way to check
a card's actual program contents against its desired
contents.
ISOLATE runs from the command line, with two possible
options. Adding -v to the command line runs the program in
verbose mode, which displays the values read off the card
and how they are processed. Program data on misprogrammed
cards can be read by running in unquestionable mode (-u),
thereby causing the query to continue if a zero-length tag
is hit. Any other option will cause the proper command
syntax to be displayed.
ISOLATE can only read ~58K of data per card; after 32K it
will presume that the card is not programmed and ask the
user if they'd like to continue. ISOLATE will proceed to
the next card if aborted after 32K or terminate if allowed
to run out of memory. As per the spec, all information
preceding a Start DF tag is required for each function and
is only displayed once.
ISOLATE is a companion application for the "Plug-and-Play
ISA Specification" and was built with Microsoft Visual
C++(TM). Any errors encountered during the build process
indicate a development environment different from the
standard installation environment setup.
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The TRIPS sample can be downloaded from the
**** file 3-63.zip in library section number 3
****
TRIPS.DBF and CUSTOMER.DBF: Sample FoxPro Databases
TRIPS.DBF and CUSTOMER.DBF are companion databases for
the "Exploring the FoxPro 2.5 Power Tools" technical
article by Steven D. Murch on the Microsoft Developer
Network CD (under Technical Articles, FoxPro Articles).
> CUSTOMER.DBF contains customer information (one record
per customer).
> TRIPS.DBF contains a listing of all trips taken by
customers (one record per customer trip).
KEYWORDS: CD4
Click to open or copy the TRIPS.DBF and CUSTOMER.DBF
databases.
1311
tech\fox\trips
=============================================================================
=============================================================================
****
**** The W16APP sample can be downloaded from the
**** file 3-51.zip in library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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
> PlayResource
where
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.
> 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 library section number 3
****
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 DRAGON sample can be downloaded from the
**** file 3-79.zip in library section number 3
****
DRAGON: An OLE Application with Drag and Drop
This sample application accompanies the "OLE for Idiots: D
Is for Dragon"msdn_ole2d technical article on the
Microsoft(R) Development Library and was developed from
the BUCKET sample application. The DRAGON sample is a
primitive object linking and embedding (OLE) container
that allows objects to be dropped from other OLE
applications. It also allows its own objects to be dragged
away to unknown destinations for use by the evil empire.
The sample application is written in C and was built using
Microsoft C 7.0. It requires the OLE 2.0 Software
Development Kit (SDK) libraries. Note that this means you
must already have the OLE 2.0 SDK installed before you
attempt to build this application. In addition to the
standard OLE 2.0 files, it also requires the OLE2UI
headers, library, and run-time dynamic-link library (DLL).
The headers and library for OLE2UI can be found in
\OLE2\SAMP\REL (if you used the default installation for
the OLE 2.0 SDK). The run-time DLL is actually called
OUTLUI.DLL and can be found in \OLE2\SAMP\OLE2UI. OLE2UI
is not a regular part of the OLE 2.0 SDK. It was shipped
as a sample DLL so that you could modify the text for
international use. The name was intended to be unique to
each application. The sample (OUTLUI) belongs to the
OUTLINE sample application but is generally useful in
testing sample applications.
When you set up your environment variables for the OLE 2.0
SDK, be sure to use the DEBUG versions of the DLLs to get
the best testing of your application. If you let the SDK
install in the default \OLE2 directory, your environment
should contain:
PATH= ...;\ole2\samp\rel;\ole2\rel\debug;\ole2\rel;...
INCLUDE= ...;\ole2\rel;\ole2\samp\rel;...
LIB= ...;\ole2\rel;\ole2\samp\rel;...
NOTE: The path shown here is NOT the same as that
recommended in the OLE 2.0 SDK setup.
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The PATRON sample can be downloaded from the
**** file 3-29.zip in library section number 3
****
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 library section number 3
****
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 TBSS sample can be downloaded from the
**** file 3-80.zip in library section number 3
****
TBSS: Uses OLE's Structured Storage
TBSS accompanies the "OLE for Idiots: B is for
Beginning"msdn_ole2b technical article on the Microsoft
Developer Network CD and is based on the TEXTBOX sample
application. TBSS shows how you can use OLE 2.0's
structured storage in place of regular MS-DOS(R) file I/O
in an application. The sample application can read and
write structured storage files as well as files written by
the older TEXTBOX application.
TBSS is written in C and was built using Microsoft(R) C
7.0. It requires the OLE 2.0 Software Development Kit
(SDK) libraries. Note that this means you must already
have the OLE 2.0 SDK installed before you attempt to build
this application.
KEYWORDS: CD5
=============================================================================
=============================================================================
****
**** The TEXTBOX sample can be downloaded from the
**** file 3-81.zip in library section number 3
****
TEXTBOX: An Application Ready for OLE Enhancements
TEXTBOX accompanies the "OLE for Idiots: A is for
Attitude"msdn_ole2a technical article on the Microsoft
Developer Network CD and forms the framework of an
application that is developed into an OLE container
application in subsequent articles. The application allows
the creation of simple text objects in the client area of
the main window. The objects can be dragged around and
copied to and from the Clipboard. A file format is defined
to store the set of displayed objects so a scene may be
saved and reopened at a later time.
TEXTBOX is written in C and was built using Microsoft (R)
C 7.0. It requires the OLE 2.0 Software Development Kit
libraries.
KEYWORDS: CD5
=============================================================================
=============================================================================
****
**** The MSGBLAST sample can be downloaded from the
**** file 3-64.zip in library section number 3
****
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-65.zip in library section number 3
****
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-66.zip in library section number 3
****
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-67.zip in library section number 3
****
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-68.zip in library section number 3
****
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-69.zip in library section number 3
****
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-70.zip in library section number 3
****
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 library section number 3
****
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 EXEVIEW sample can be downloaded from the
**** file 4-50.zip in library section number 3
****
EXEVIEW: Lets You View Executable File Formats
EXEVIEW accompanies "The Portable Executable File Format
from Top to Bottom"msdn_pefile technical article on the
Microsoft Developer Network CD and is intended to
illustrate some of the concepts covered therein.
Specifically, this application allows the user to view
parts of a file using the portable executable (PE) file
format in order to gain a better understanding of how this
format is organized and how it can be used.
EXEVIEW was built and tested using the Microsoft(R)
Windows NT(TM) version 3.1 operating system.
KEYWORDS: CD5
=============================================================================
=============================================================================
****
**** The FROGFLY sample can be downloaded from the
**** file 3-82.zip in library section number 3
****
FROGFLY: Simulates an Ecosystem with Life Objects
FROGFLY is a Microsoft(R) Windows NT(TM) application that
implements a small ecosystem. It is intended to
demonstrate the simulation of life objects by combining
C++ code with multithreading.
FROGFLY uses process threads with critical sections to
simulate an environment in which a frog feeds on flies
that, in turn, feed on food spills. Using the mouse, the
user can control the number of flies and place food spills
around the "room.". Because critical sections are used to
synchronize access to environment variables, all of the
life object threads must belong to the same process.
The application initially displays an empty screen with a
cheeseburger as a cursor. The user starts the simulation
by clicking the Simulation.Start Simulation menu item. A
frog appears and moves over the screen, controlled by the
user via the arrow keys. The main window's title bar
displays a constantly descending number of calories,
indicating how much energy the frog has. When the count
hits 0, the frog dies.
The user can generate flies that move over the screen by
selecting the Options.Add Fly menu item. When the frog
hits a fly, the fly dies and the frog's calorie count
increases. Flies can also die of starvation if they do not
get food, but they will multiply automatically once they
reach a predefined energy level.
For additional information on this sample application, see
the "Using Multithreading and C++ to Generate Life
Objects"msdn_frogfly1 technical article on the Microsoft
Developer Network CD or the README.TXT project file.
FROGFLY is written in C++ and was built with the Windows
NT Software Development Kit (SDK).
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The HOOKS32 sample can be downloaded from the
**** file 3-83.zip in library section number 3
****
HOOKS32: Uses SetWindowsHookEx to Install System Hooks
HOOKS32 uses the SetWindowsHookEx function to install the
following system hooks: WH_CALLWNDPROC, WH_CBT, WH_DEBUG,
WH_GETMESSAGE, WH_JOURNALPLAYBACK, WH_JOURNALRECORD,
WH_KEYBOARD, WH_MOUSE, WH_MSGFILTER, and WH_SYSMSGFILTER.
The SetWindowsHookEx function allows message processing
inside a dialog box or a message box function.
When you select the System Hook command, HOOKS32 installs
the system hook and displays information on the messages
hooked.
HOOKS32 was built and tested under Microsoft(R) Windows
NT(TM) version 3.1.
KEYWORDS: CD5; CallNextHookEx; UnhookWindowsHookEx
=============================================================================
=============================================================================
****
**** The PEFILE sample can be downloaded from the
**** file 3-84.zip in library section number 3
****
PEFILE: Lets You View the Portable Executable File Format
with Programming Tools
PEFILE accompanies "The Portable Executable File Format
from Top to Bottom"msdn_pefile technical article on the
Microsoft Developer Network CD and was built into a
dynamic-link library (DLL) for use with the EXEVIEW
application included on the CD. The library contains the
macro and function definitions necessary for extracting
information from executable file formats.
PEFILE was built and tested using the Microsoft(R) Windows
NT(TM) version 3.1 operating system.
KEYWORDS: CD5
=============================================================================
=============================================================================
****
**** The REGMPAD sample can be downloaded from the
**** file 3-85.zip in library section number 3
****
REGMPAD: Demonstrates Windows NT 3.1 Profile and
Configuration Facility
Microsoft(R) Windows NT(TM) 3.1 introduces a new profile
and configuration facility known as the registry, a
hierarchical database of keys and values. A key is an
object that may contain a collection of named values as
well as other named keys. Keys are similar to the
directory objects in a file subsystem, and values are
similar to files.
The values in the registry are binary data, which gives
you more flexibility in how you keep configuration
information for your application. You no longer have to
convert between your internal representations and a
textual image as you do when you're saving information in
an .INI file.
To identify the kind of binary data tied to a value name,
you supply a type tag when you store the data in the
registry. Some tag values are predefined (REG_SZ, which
denotes a null-terminated string; REG_DWORD, which denotes
a 32-bit double word value; and so on). If one of those
tag types accurately describes your data, you should use
it. But if not, you can use the REG_BINARY tag, which
indicates raw binary data, or construct a new tag type
that your application(s) will understand.
The registry environment gives a great deal of flexibility
to how and where you store configuration and profile
information. Since the registry is shared by all
applications and the Windows NT system itself, all
registry clients must be self-disciplined and avoid
damaging each other's data.
The sample source code for this article constructs the
REGMPAD application. REGMPAD is a variation on the
MULTIPAD application, which illustrates how to construct a
multiple document interface (MDI) application. We've added
additional code to save profile information in the
registry. You may wish to add other capabilities to the
sample to explore the impact of the registry on your
application.
Most applications have several releases that add more
features and often require changes to their profile
information. That's why our key names include the version
number of the application. That allows you to have
multiple versions of our application running, each with
its own profile data. However, when you release a new
version that requires new and different profile data, you
must also be able to read old profile data and store an
upgraded version of the data in your new format.
You can copy the sample source code into your own
application as appropriate. Most of the relevant and
useful code for the registry is contained in the REGDB.H
and REGDB.C files.
For additional information on this sample application, see
the "How to Use the Windows NT Registry in Your
Application"msdn_regmpad technical article by Ron Murray
on the Microsoft Development Library.
REGMPAD was built and tested under Microsoft Windows NT
version 3.1 and Microsoft Visual C++(TM) version 1.0 (32-
bit).
KEYWORDS: CD6; HKEY_CLASSES_ROOT; HKEY_CURRENT_USER;
HKEY_LOCAL_MACHINE; HKEY_USERS; KEY_READ; CreateAppKeys;
hkeySoftware; hkPerUser; mutexes; RegOpenKeyEx
=============================================================================
=============================================================================
****
**** The STYLES32 sample can be downloaded from the
**** file 3-86.zip in library section number 3
****
STYLES32: Demonstrates How Style Bits Affect a Window
The STYLES32 sample application creates a window using
user-selected dialog box options. STYLES32 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 "Win32 Window Hierarchy and
Styles"msdn_styles32 technical article on the Microsoft
Development Library.
STYLES32 was built and tested under Microsoft Windows
NT(TM) version 3.1.
KEYWORDS: CreateWindow; CreateWindowEx; ShowWindow
=============================================================================
=============================================================================
****
**** The TANGRMNT sample can be downloaded from the
**** file 3-87.zip in library section number 3
****
TANGRAM NT: A Fun Puzzle Program for Windows NT
TANGRAM NT is a Microsoft(R) Windows NT(TM)-based version
of the fun and popular TANGRAM sample application. It is a
companion sample application for the "More Bits, More
Bits: MFC Moves to 32 Bits"msdn_tannt technical article on
the Microsoft Development Library. A version for MIPS(R)
processors can be built using the TANGRAM.MAK file for
MIPS. Search for TANGRAM MIPS.
TANGRAM is a computerized version of the popular tangram
puzzle. This graphical sample shows a variety of
techniques for using the power and features of the
Microsoft Foundation Class Library. Some of the techniques
demonstrated include:
> Writing your own scrolling class to replace
CScrollView. CTangramScrollView scrolls in logical units
instead of device units. It also uses the MM_ANISOTROPIC
mapping mode.
> Multiple view classes for a single document class.
CTangramView displays a graphical representation of the
data in CTangramDoc, while CBugView displays a text dump
of the data.
> Painting the client area of your view class by handling
the WM_ERASEBKGND message.
> Painting the MDI (multiple document interface) client
area by subclassing the MDICLIENT window.
> Dynamically updating the status bar.
> Creating metafiles.
> Copying metafiles to the Clipboard.
> Using a dedicated hinting class.
> Avoiding mouse button double-clicks.
> Using multiple-pane windows.
> Scaling output in a view.
TANGRAM.EXE uses the Microsoft Foundation Class Library
and was built with Microsoft Visual C++(TM) for Windows NT
version 1.0. It was compiled and tested under Microsoft
Windows NT version 3.1.
KEYWORDS: CD6; CScrollView; hinting; ISO; mapping modes;
MDICLIENT; MM_ANISOTROPIC; MM_ISOTROPIC; MM_TEXT; non-
constrained mapping modes; NT; OnEraseBkgnd;
OnIconEraseBkgnd; OnUpdate; porting; scaling; SetMapMode;
SetViewportExt; SetViewportOrg; SetWindowExt;
SetWindowOrg; status bar; subclassing; Tangram;
UpdateAllViews; Windows NT; WM_ERASEBKGND
=============================================================================
=============================================================================
****
**** The THRD32 sample can be downloaded from the
**** file 3-88.zip in library section number 3
****
THRD32: Demonstrates Processor Sharing in Windows NT
Microsoft(R) Windows NT(TM) is a robust operating system
that does not allow applications to completely shut down
the system by hogging all the CPU time. However,
unresponsive applications can undermine overall system
performance and cause other applications to appear halted.
THRD32 shows how to avoid these problems.
THRD32 was built and tested under Microsoft Windows NT
version 3.1.
KEYWORDS: PeekMessage; CreateThread, Sleep
=============================================================================
=============================================================================
****
**** The TNGRMMIP sample can be downloaded from the
**** file 3-89.zip in library section number 3
****
TANGRAM MIPS: Fast Fun on a MIPS computer
TANGRAM MIPS consists of a make file (TANGRAM.MAK) that
builds a MIPS(R) version of the fun and popular TANGRAM
sample application. It is a companion sample application
for the "More Bits, More Bits: MFC Moves to 32
Bits"msdn_tannt technical article on the Microsoft(R)
Development Library. The make file is used with the files
associated with the TANGRAM NT application, which builds
TANGRAM for Intel(R) processors. Copy the TANGRAM NT files
to a MIPS box and replace the make file with the TANGRAM
MIPS make file.
TANGRAM is a computerized version of the popular tangram
puzzle. This graphical sample shows a variety of
techniques for using the power and features of the
Microsoft Foundation Class Library. Some of the techniques
demonstrated include:
> Writing your own scrolling class to replace
CScrollView. CTangramScrollView scrolls in logical units
instead of device units. It also uses the MM_ANISOTROPIC
mapping mode.
> Multiple view classes for a single document class.
CTangramView displays a graphical representation of the
data in CTangramDoc, while CBugView displays a text dump
of the data.
> Painting the client area of your view class by handling
the WM_ERASEBKGND message.
> Painting the MDI (multiple document interface) client
area by subclassing the MDICLIENT window.
> Dynamically updating the status bar.
> Creating metafiles.
> Copying metafiles to the Clipboard.
> Using a dedicated hinting class.
> Avoiding mouse button double-clicks.
> Using multiple-pane windows.
> Scaling output in a view.
TANGRAM.EXE uses the Microsoft Foundation Class Library
and was built with Microsoft Visual C++(TM) for Windows
NT(TM) version 1.0. It was compiled and tested under
Microsoft Windows NT version 3.1.
KEYWORDS: CD6; CScrollView; hinting; ISO; mapping modes;
MDICLIENT; MIP; MM_ANISOTROPIC; MM_ISOTROPIC; MM_TEXT; non-
constrained mapping modes; OnEraseBkgnd; OnIconEraseBkgnd;
OnUpdate; porting; scaling; SetMapMode; SetViewportExt;
SetViewportOrg; SetWindowExt; SetWindowOrg; status bar;
subclassing; Tangram; UpdateAllViews; Windows NT;
WM_ERASEBKGND
=============================================================================
=============================================================================
****
**** The W32PEN sample can be downloaded from the
**** file 3-90.zip in library section number 3
****
W32PEN: Experiments with Cosmetic and Geometric Pens
W32PEN is a Microsoft(R) Win32(R) application that lets
the user experiment with cosmetic and geometric pens. The
style, end cap, miter, color, and width of the pens may be
manipulated also. Given a pen, the application draws a
polyline that consists of 10 randomly generated points
within a clipping region. Multiple pens and lines can be
drawn. Information about each pen and line is stored in a
structure that acts as a node in a doubly linked list. The
list is traversed in response to paint messages. The
application also demonstrates the use of enhanced
metafiles, clipping regions, hit-testing within a region,
and use of custom cursors over a region.
W32PEN accompanies the "Pens in Win32"msdn_w32pens
technical article on the Microsoft Development Library.
W32PEN was built using Microsoft Visual C++(TM) version
1.0 and was tested under Microsoft Windows NT(TM) version
3.1.
KEYWORDS: CD6; CreateEnhMetaFile; CreateRctRgnIndirect;
DeleteEnhMetaFile; ExtCreatePen; InvalidateRect; Polyline;
SelectClipRgn; SetGraphicsMode; SetWorldTransform
=============================================================================
=============================================================================
****
**** The DDLIST sample can be downloaded from the
**** file 3-56.zip in library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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-71.zip in library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 3
****
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 library section number 4
****
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 SECURE sample can be downloaded from the
**** file 4-73.zip in library section number 4
****
Security Wizard: Adds Permissions to a Database File
Security Wizard is a tool that lets you add permissions to
a file so it cannot be modified.
To load Security Wizard:
1. Copy the SECUREIT.MDA file to your ACCESS directory.
2. Using Microsoft(R) Windows(TM) Notepad or other text
editor, open MSACCESS.INI (in your WINDOWS directory), and
add the following line under [Libraries]:
secureit.mda=
3. At the end of the file, add a [Menu Add-ins] section.
Then add the following line under [Menu Add-ins]:
&Security Wizard==securit()
4. Save the file.
5. Make a backup copy of your SYSTEM.MDA file (usually
located in you ACCESS directory).
6. Start Microsoft Access(R), open any database, and,
from the Security menu, choose Change Password. This
dialog box is self-explanatory.
7. From the Users option under the Security menu, add a
new user to the system, and then add that user to the
Admins group.
8. Exit Microsoft Access, and log on as the user you just
added to the system.
9. Open any database, choose Users from the Security menu
again, and this time remove the Admins user from the
system.
10. Exit Microsoft Access, and log on again as the new
user.
11. After logging on, create a new database.
There should now be an option under the Help menu to start
the wizard.
NOTE: Whenever implementing security, it is always a good
idea to make backups of your SYSTEM.MDA file and your
database.
KEYWORDS: CD5
=============================================================================
=============================================================================
****
**** The SYSTEM sample can be downloaded from the
**** file 4-74.zip in library section number 4
****
SYSTEM: Stores the Location and Description of SYSTEM.MDA
Files
SYSTEM stores the location and description of multiple
SYSTEM.MDA files in Microsoft Access(R). This tool helps
developers manage the location of various SYSTEM.MDA
files. SYSTEM was designed to run with Microsoft
Windows(R) for Workgroups 3.1.
To install SYSTEM:
1. Copy the files to a floppy disk or to an install
directory.
2. In Program Manager, choose File from the main menu,
and then choose Run.
3. Type either a:\setup or b:\setup, whichever is
applicable. If you're using an install directory, type the
drive letter and path of the directory, and then type
setup (for example, c:\install\setup).
4. Click the OK button.
To run SYSTEM:
1. Open the Workgroup group from within Windows and
double-click the Access Workgroup icon.
2. From the main window in the application, click the
Find New Workgroups button. A dialog box will help you
locate the SYSTEM.MDA files.
3. Select the file you want, and click the OK button.
4. You will be prompted for a description for the .MDA
file. Enter a description (for example, Security for John
Doe). This description will be stored in the list box.
5. To remove an option from the list box, select the
description and click the Remove Workgroup button from the
main window.
6. To select a new SYSTEM.MDA, click the down arrow of
the list box and select the desired description and
SYSTEM.MDA. Then click the Select Workgroup button.
KEYWORDS: CD5; security; workgroups
=============================================================================
=============================================================================
****
**** The WZSECURE sample can be downloaded from the
**** file 4-75.zip in library section number 4
****
WZSECURE: Demonstrates a Security Wizard
To install the Security Wizard, copy WZSECURE.MDA into
your Microsoft Access(R) 1.1 program directory. Add the
following line to the [Libraries] section of your
MSACCESS.INI file:
wzsecure=ro
If it doesn't already exist, add a [Menu Add-Ins] section
in your MSACCESS.INI FILE and add the following line to
it:
Security &Wizard==swz_SecureDB()
The next time you start Microsoft Access, the Security
Wizard command will appear on the Help menu. To start the
Wizard, select this command.
The Security Wizard will run only on Microsoft Access 1.1,
but it will work with databases in Microsoft Access 1.0 or
1.1 format. Attempting to use the Security Wizard with
Microsoft Access 1.0 will result in an "Out-of-data
database format" message, followed by "Some library
modules could not be loaded" when you start Microsoft
Access.
The Security Wizard can take quite a while to run. For
instance, securing NWIND.MDB on a 486/50 takes
approximately 13 minutes.
The Security Wizard takes the following steps to secure a
database:
1. Creates a new, encrypted database with a name you
specify.
2. Prompts you for the object types you want to secure.
Objects are secured by revoking the permissions of the
Users and Guests groups on the objects.
3. Exports all the objects to the new database. This
includes recreating attached tables and table
relationships.
4. Secures the object types selected in step 2.
5. Updates several internal data structures in the
database to ensure security.
The original database is not changed in any way! All
objects in the current database are exported to the new
one. This includes recreating table relationships and
attachments to tables in other databases. If you have
attached tables, the native table (in the format for
Microsoft Access, Paradox, SQL Server, and so on) must be
accessible.
The new database is completely secured. The new database
will be in Microsoft Access 1.1 format, regardless of the
format of the current database. If you must have your
database in Microsoft Access 1.0 format, you can use
COMPACT to convert it back.
The current user is the owner of the new database and all
objects in it. The Admins group of the current SystemDB
has full permissions on the database and all objects in
it.
Object types selected in step 2 are completely secured
from other users by revoking permissions on the Users and
Guests groups. Object types not selected in step 2 are
copied to the new database, but the Users and Guests
groups still have permissions on them, leaving the object
types unsecured.
NOTE: Permissions on objects in the current database are
not copied to the new database.
=============================================================================
=============================================================================
****
**** The CROSSTAB sample can be downloaded from the
**** file 4-64.zip in library section number 4
****
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-65.zip in library section number 4
****
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-66.zip in library section number 4
****
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-67.zip in library section number 4
****
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-68.zip in library section number 4
****
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-69.zip in library section number 4
****
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-70.zip in library section number 4
****
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 library section number 4
****
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-71.zip in library section number 4
****
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 CDDEML sample can be downloaded from the
**** file 4-56.zip in library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 PMDDEML sample can be downloaded from the
**** file 4-76.zip in library section number 4
****
PMDDEML: Uses the Program Manager DDE Command-String
Interface
The Microsoft(R) Windows(TM) Program Manager supports a
dynamic data exchange (DDE) command-string interface that
allows other applications to create, display, delete, and
reload groups; add, replace, and delete items from groups;
and close Program Manager. PMDDEML demonstrates how to use
this Program Manager DDE command-string interface using
the dynamic data exchange management library (DDEML).
PMDDEML demonstrates only a small subset of the command
strings supported by the Program Manager. The commands
demonstrated by PMDDEML include CreateGroup, ShowGroup,
and DeleteGroup. Other command strings supported by
Program Manager can be implemented in a manner similar to
those demonstrated by PMDDEML. Once a sample group is
created, it can be minimized, restored, or deleted by
selecting the appropriate menu item in PMDDEML.
PMDDEML was built with Microsoft Visual C++(TM) and tested
under Microsoft Windows version 3.1. Any errors
encountered during the build process indicate a
development environment different from the standard
installation environment setup.
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The BMUTIL sample can be downloaded from the
**** file 4-9.zip in library section number 4
****
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-72.zip in library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 PATPOLY sample can be downloaded from the
**** file 4-77.zip in library section number 4
****
PATPOLY: Draws a Polygon and Uses Dithered Color
PATPOLY uses a pattern brush to draw a polygon so that the
entire polygon, including the border, can be filled with a
dithered color. The PatPolygon function first creates a
monochrome mask of the polygon in a memory DC (device
context), and then uses a pattern brush to blit the mask
transparently to the screen. Using the ZOOMIN tool from
the Microsoft(R) Windows(TM) version 3.1 Software
Development Kit (SDK) allows the user to better observe
the polygon's fill pattern and size in relation to the
vertices.
Note that this result is not possible with a simple call
to Polygon because of problems associated with producing a
polygon's border with a dithered color. For example, a
NULL pen cannot be used because the interior and border
won't be completely filled. Pens with a width of 1 can
have only solid colors and subsequently are not
applicable. Wider pens can have a dithered color, but
since the pen is centered on the polygon border, as
defined by the vertex points, the resulting polygon will
be larger than defined by the vertices. Finally, the
PS_INSIDEFRAME pen style does not have any effect when
used with Polygon.
PATPOLY was built with Microsoft Visual C++(TM) and tested
under Microsoft Windows version 3.1. Any errors
encountered during the build process indicate a
development environment different from the standard
installation environment setup.
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The PRNCDLG sample can be downloaded from the
**** file 4-59.zip in library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 ALPHSORT sample can be downloaded from the
**** file 4-78.zip in library section number 4
****
ALPHSORT: Compares Sort Orders for Language Drivers
ALPHSORT demonstrates the sort orders obtained from the
Microsoft(R) Windows(TM) lstrcmp and lstrcmpi functions
and a language driver, if one is installed. Special
consideration is given to sorts that involve accented
characters and primary and secondary values.
ALPHSORT displays the results of the lstrcmp and lstrcmpi
routines in two list boxes. One list box contains the
characters 32-255 with an option to display the characters
in either ANSI order or sorted order. The other list box
contains various strings displayed under the LBS_SORT
style; changing the language driver through the
International Control Panel applet illustrates the effect
it has on the sort routine.
ALPHSORT was built with Microsoft Visual C++(TM) and
tested under Microsoft Windows version 3.1. Any errors
encountered during the build process indicate a
development environment different from the standard
installation environment setup.
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The BACKGRND sample can be downloaded from the
**** file 4-18.zip in library section number 4
****
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 FOXREST sample can be downloaded from the
**** file 4-79.zip in library section number 4
****
FOXRES: Demonstrates a Complete Restaurant Reservation
System
The requirements for running the Restaurant Reservation
demonstration are:
> FoxPro(R) 2.5 for Microsoft(R) Windows(TM)
> Microsoft Word for Windows version 2.0c
> Microsoft Mail
> Microsoft Video for Windows
> Sound card
> VGA 640x480, 256 color (640x480 is a must; 256 color is
good for OLE section)
You can demonstrate much of the application with just
FoxPro for Windows. Microsoft Word lets you see a DDE
demonstration. Microsoft Video for Windows and the sound
card let you see OLE support. Microsoft Mail lets you see
DLL and MAPI support.
The application illustrates these features:
> Real-world business scenario (restaurant reservation
system)
> Support for object linking and embedding (OLE)
> Support for dynamic data exchange (DDE)
> Support for Microsoft's Messaging Application
Programming Interface (MAPI) and dynamic-link libraries
(DLLs)
> Graph Wizard integrated into an application
> Fonts, bitmaps, colors, all Windows controls such as
radio buttons, spinners, invisible buttons
> Integrated Browse window
> Custom menus
> Reports complete with bitmaps
> Complete control over the FoxPro application through
code
> Cool "Schedule+"-like calendar written in FoxPro
> Use of power tools to build applications
Be sure to check out the Tools menu when you're running
this application!
KEYWORDS: CD5
=============================================================================
=============================================================================
****
**** The MAKEAPP sample can be downloaded from the
**** file 4-19.zip in library section number 4
****
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 NSETUP sample can be downloaded from the
**** file 4-80.zip in library section number 4
****
NSETUP: Rebooting Mechanism for Setup Routines
The MSSetup Toolkit does not provide a way for the user to
arbitrarily and cleanly reboot the PC without having the
RestartListEmpty function return a zero. NSETUP, a
workaround for this situation, provides a mechanism for
the user to communicate with the MSSetup dynamic-link
libraries (DLLs) to cleanly reboot the machine without
having a system file on the RestartList.
NSETUP was built with Microsoft(R) Visual C++(TM) and
tested under Microsoft Windows version 3.1. Any errors
encountered during the build process indicate a
development environment different from the standard
installation environment setup.
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The PMU sample can be downloaded from the
**** file 4-81.zip in library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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=
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 HEAPINFO sample can be downloaded from the
**** file 4-82.zip in library section number 4
****
HEAPINFO: Displays Global Heap Information
HEAPINFO is a useful tool that allows the user to view
information about the portion of the global heap below 1
MB. You can use it to track down low conventional memory
problems in Microsoft(R) Windows(TM) version 3.0 or 3.1.
HEAPINFO is written in C and was built with Microsoft
Visual C++(TM). Any errors encountered during the build
process indicate a development environment different from
the standard installation environment setup.
WARNINGS: Two warnings (C4705) are reported during the
build process. These warnings do not affect the build
process and only alert the user to statements in
HEAPINFO.C that do not do anything; their presence is
intended to clarify that the WinMain function does not use
the associated variables.
KEYWORDS: CD5
=============================================================================
=============================================================================
****
**** The ISHANDLE sample can be downloaded from the
**** file 4-28.zip in library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 UNLOADER sample can be downloaded from the
**** file 4-83.zip in library section number 4
****
UNLOADER: Removes Unused DLLs from Memory
UNLOADER is a useful tool that assists the developer in
testing a dynamic-link library (DLL) at various stages of
the development process.
During development, DLLs are sometimes left in memory with
no applications using them. To remove them so updated
versions of the DLL can be used, developers have to exit
and then restart Microsoft(R) Windows(TM)--a very
inconvenient chore. UNLOADER is a sample Windows-based
application that lets developers select a DLL and show
information about it or unload it from the system, thereby
eliminating the need to restart Windows.
UNLOADER is written in C and was built with Microsoft
Visual C++(TM). Any errors encountered during the build
process indicate a development environment different from
the standard installation environment setup.
KEYWORDS: CD5
=============================================================================
=============================================================================
****
**** The MIDIKEYB sample can be downloaded from the
**** file 4-31.zip in library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 TRAINEM sample can be downloaded from the
**** file 4-84.zip in library section number 4
****
TRAINEM: Trains the Windows for Pen Computing Default
Recognizer
TRAINEM demonstrates how to use the TrainInk application
programming interface (API) to train the default
recognizer included with Microsoft(R) Windows(TM) for Pen
Computing.
Given a set of pen strokes that represent a single
character, TRAINEM presents the user with the recognizer's
interpretation of the input and the option of editing it
and retraining the recognizer on the subsequent user-
defined version. If the user elects to retrain the
recognizer, all future recognition tasks use the new
interpretation.
TRAINEM was built with Microsoft Visual C++(TM) and tested
under Microsoft Windows for Pen Computing version 1.0.
TRAINEM will also run on any Windows version 3.1 or
Windows for Workgroups machine that has the Pen Extensions
installed, either from the Microsoft Windows 3.1 Software
Development Kit or the Visual C++ Software Development
Kit, but with some loss of functionality. This limitation
does not allow use of the virtual keyboard if the virtual
keyboard executable is not present, as is likely under non-
Windows for Pen Computing systems.
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The VIEW sample can be downloaded from the
**** file 4-42.zip in library section number 4
****
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-85.zip in library section number 4
****
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-86.zip in library section number 4
****
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-87.zip in library section number 4
****
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-88.zip in library section number 4
****
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 HEALTH sample can be downloaded from the
**** file 4-43.zip in library section number 4
****
HEALTH: Visual Basic(TM) 3.0 Pen Healthcare Application
HEALTH contains seven forms for admitting and diagnosing a
patient in a healthcare facility. This program is fairly
large and unoptimized, so load times are significant. Tap
firmly on the buttons for Next Page, Previous Page, and so
on, and then wait as HEALTH loads each form.
> The first form is a Patient Identification form. To
complete this form, enter numbers in the bedit field, tap
the button, then tap the appropriate Gender radio button.
Do not tap the Enable Entry Checking check box in the
lower part of the screen--this option opens a smart form
that won't let you move to the next screen until all
fields are filled out.
> The second form is fairly straightforward. Note that if
you tap the icon, it will reformat and lock that field.
For example, after entering the date, tap the icon next to
it to format the date and lock that field.
> The third form, In Case of Emergency Notify, contains
an hedit field for medical diagnosis. You can write
anything you want in this field, but print neatly. The
application will try to recognize whatever you write.
> The fourth form, Physical, contains diagrams of the
body. You can draw on these diagrams to diagnose or
highlight any problems. This screen takes some time to
load, so tap the Next Page icon quickly. The ink display
rate is good; hold the pen down on the screen for a
second, and then write as quickly as you like. You can tap
the Lock icon once to lock the ink, and a second time to
clear the screen.
> The fifth form, Clinical Assessment, contains multiple
forms that you can fill out to note allergies, hearing and
eyesight limitations, and so on. To view all forms at
once, choose Arrange from the top part of the screen.
However, having many screens on display can intimidate a
new user, so we suggest that you fill out only the first
form. For example:
1. Tap Hearing.
2. Tap Normal Left.
3. Tap Impaired Right.
4. Tap Vision.
5. Tap Impaired.
6. Tap Glasses.
7. Tap Far-sighted.
8. Tap Next Page to move to the next form. Next Page
appears as text (not as a button) in the upper-right
corner of the screen.
> The sixth form is a diagnosis screen. Use the scroll
bars to scroll through the potential diagnoses (some of
them are rather humorous), and select the most appropriate
one. This is the last form, so tap the Exit button
(represented by an open door) at the bottom of the screen
to close the application.
> The seventh form is brought up every time you tap the
open door icon. The menus allow you to save your work,
view the different screens that you have entered, or exit
the application.
You move from form to form using the Next Page or Previous
Page buttons at the bottom of the screen. You can close
the application or skip pages at any point by tapping the
half-open door icon at the bottom of the screen.
HEALTH was built and tested under Microsoft(R) Windows(TM)
version 3.1 and Visual Basic version 3.0. 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; VB
=============================================================================
=============================================================================
****
**** The INSURE2 sample can be downloaded from the
**** file 4-44.zip in library section number 4
****
INSURE2: Microsoft Visual Basic(TM) for Windows(TM),
version 3.0 Pen Insurance Application
INSURE2 is a Visual Basic pen program that displays an
insurance policy application for insurance agents to fill
out.
INSURE2 demonstrates the functionality of Visual Basic
controls for Microsoft(R) Windows(TM) for Pen Computing.
It uses bedit fields, hedit fields (with DelayRecog on and
off), and an array of "point-and-shoot" fields (check
boxes, option buttons, and so on). INSURE2 is very
flexible; you can go back and forth between edit screens
to update information.
On the main form, the Current Occupation input area is
ink, so you can write in cursive. To access the list
boxes, just tap the associated buttons.
The Load and Save Form buttons are not functional, but
tapping these does not cause any error messages. Cick the
action buttons at the bottom of each form to move back and
forth between forms. To exit the application, tap the
Report button and select the Exit application button at
the bottom of the screen.
INSURE2 was built and tested under Microsoft Windows
version 3.1 and Visual Basic version 3.0. 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; VB
=============================================================================
=============================================================================
****
**** The JIGSAW sample can be downloaded from the
**** file 4-89.zip in library section number 4
****
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-90.zip in library section number 4
****
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 LOANAPP sample can be downloaded from the
**** file 4-45.zip in library section number 4
****
LOANAPP: Visual Basic(TM) 1.0 Pen Loan Application
LOANAPP is a Microsoft(R) Windows(TM) for Pen Computing
application that was developed using Microsoft(TM) Visual
Basic(TM). LOANAPP lets you fill out a loan application
using bedit fields, hedit fields, and check boxes.
To input information, double-click a field to bring up
that section's input screen and fill in the requested
information. To change or reenter information in an input
field, double-click the input field. To move from screen
to screen, select the buttons at the top of the screen.
Select Save from the File menu to save data to a demo file.
Select Load from the File menu to load in a demo file that
you saved earlier.
There is some really good editing going on in LOANAPP. For
example, no matter where you write in the bedit fields,
your entry appears left justified in the final form. The
application converts the State field entry to uppercase,
regardless of how you entered it.
LOANAPP was developed for the mobile environment, which
requires large input fields and a clear indication of
where the user should enter information. In LOANAPP, input
fields appear on separate screens, background colors are
blue/black, and input fields are white.
On the last screen, double click the Date field at the
bottom of the screen to display the current date. LOANAPP
reads the time setting from your pentop. Use the buttons
at the top of each form to delete either all fields in the
current screen or all fields in all screens. Double-click
the Erase Signature buttons to clear Signature boxes. To
exit the application, choose Exit from the File menu.
LOANAPP was built and tested under Microsoft Windows
version 3.1 and Visual Basic version 3.0. 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; VB
=============================================================================
=============================================================================
****
**** The MKEGROUP sample can be downloaded from the
**** file 4-91.zip in library section number 4
****
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-92.zip in library section number 4
****
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-93.zip in library section number 4
****
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-94.zip in library section number 4
****
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 DOSIOCTL sample can be downloaded from the
**** file 4-95.zip in library section number 4
****
DOSIOCTL: Simulates MS-DOS Functions Under Windows NT
DOSIOCTL demonstrates the simulation of MS-DOS(R) function
calls under Microsoft(R) Windows NT(TM). Specifically, it
shows how an MS-DOS driver and VDD (virtual device driver)
can translate MS-DOS OPEN, CLOSE, and IOCTL calls to the
Win32(R) CreateFile, CloseHandle, and DeviceIoControl
calls.
The four modules that make up this sample are the MS-DOS-
based application, DOSAPP; the MS-DOS device driver,
DOSDRVR; the Windows NT virtual device driver, VDD; and
the Windows NT kernel device driver, KRNLDRVR. These four
modules work together to illustrate the basic
communication mechanisms that exist for each component.
When these components are properly installed, running the
MS-DOS-based application causes the following chain of
events to occur:
1. DOSAPP issues an IOCTL Read.
2. DOSDRVR passes the call and buffer pointer to the VDD
with the DispatchCall function.
3. VDD passes the buffer pointer from DOSDRVR to KRNLDRVR
with the Win32 DeviceIoControl function.
4. KRNLDRVR responds to the IOCTL with static
information.
5. The chain returns, and DOSAPP displays the
information.
When the MS-DOS-based application is run, it produces the
following line:
IOCTL Read returns: 12345678
This output is significant because the hexadecimal value
'12345678' is defined only in the Windows NT kernel
driver. The sole purpose of the other components is to
deliver this single piece of data from the Windows NT
driver to the MS-DOS-based application.
DOSIOCTL was built and tested under Microsoft Windows NT
3.1.
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The GUIGREP sample can be downloaded from the
**** file 4-96.zip in library section number 4
****
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-97.zip in library section number 4
****
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-98.zip in library section number 4
****
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-99.zip in library section number 4
****
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-100.zip in library section number 4
****
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-101.zip in library section number 4
****
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-102.zip in library section number 4
****
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 CHLDMNU sample can be downloaded from the
**** file 4-103.zip in library section number 4
****
CHLDMNU: Creates Child Windows with Menus
CHLDMNU demonstrates how to simulate a child window with
menus. Because child windows do not have menus by design,
CHLDMNU embeds a pop-up window with menus in a child
window to achieve the desired effect.
CHLDMNU addresses several aesthetic concerns that are
crucial for seamless operation, including moving,
resizing, creating, and activating a child window with
menus.
CHLDMNU was built with Microsoft(R) Visual C++(TM) and
tested under Microsoft Windows(TM) version 3.1. Any errors
encountered during the build process indicate a
development environment different from the standard
installation environment setup.
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The COOLCOLR sample can be downloaded from the
**** file 4-48.zip in library section number 4
****
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 COOLSIZE sample can be downloaded from the
**** file 4-104.zip in library section number 4
****
COOLSIZE: Controls a Window's Size
COOLSIZE is a 16-bit Microsoft(R) Windows(TM) application
that demonstrates how to limit a window's size to certain
increments.
COOLSIZE tracks the user's mouse movements during a window
resize and "snaps" the window outline to a size that
allows it to completely show a predefined set of blocks.
This requires that the program determine if a region of
the current resized rectangle has minimally sufficient
area to display the window's blocks; if it does, COOLSIZE
snaps the window outline to this area.
COOLSIZE is written in C and was built using Microsoft
Visual C++(TM). Any errors encountered during the build
process indicate an environment different from the
standard installation setup.
WARNINGS: During the build process, two warnings are
reported (both are RW4002). While this warning can be
troublesome for dynamic-link libraries (DLLs), it is a
benign warning for applications. Any other warnings or
errors are abnormal and indicate a development environment
different from the standard installation setup.
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The CREATDLG sample can be downloaded from the
**** file 4-105.zip in library section number 4
****
CREATDLG: Shows How to Use Edit Menu Commands with Dialog
Box Controls
CREATDLG demonstrates how to use Edit menu commands on an
edit control in a dialog box. When the main window
receives a command from its Edit menu, it sends the
command to the appropriate edit control.
CREATDLG shows how to handle the following issues:
> Where does the input focus go when the editing
operation is complete?
> What happens if the user chooses Cut, Copy, or Clear
without selecting any text?
> If more than one edit control is visible, which control
should be affected by the command?
See the code for comments and the README.TXT file for a
discussion of coding issues.
CREATDLG is included in the Microsoft(R) 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.
CREATDLG was built and tested under Microsoft Windows(TM)
versions 3.0 and 3.1, and Microsoft C/C++ version 7.0.
KEYWORDS: CD4; S12127; Q38170
=============================================================================
=============================================================================
****
**** The DATAVAL sample can be downloaded from the
**** file 4-106.zip in library section number 4
****
DATAVAL: Validates Edit Controls
DATAVAL demonstrates how to validate the contents of edit
controls within a dialog box without subclassing the
controls.
DATAVAL processes the EN_KILLFOCUS message, which the
dialog box receives after an edit control has lost the
input focus. When the dialog box receives an EN_KILLFOCUS
message, it calls a validation function to determine if
the contents of the control that has lost the input focus
are valid. If they are not, the dialog box posts a user-
defined "not valid" message to itself. When the dialog box
processes the "not valid" message, it displays a message
box alerting the user of the error, and then sets focus
back to the control that has invalid contents. A Cancel
button in the dialog box allows the user to exit the
dialog box without performing validation.
An application is in an unstable state when it receives an
EN_KILLFOCUS message because Microsoft(R) Windows(TM) is
in the process of switching focus between windows.
Therefore, the application must use PostMessage to provide
the "not valid" message; otherwise, it may enter an
infinite loop.
DATAVAL 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.
DATAVAL was built and tested under Microsoft Windows
versions 3.0 and 3.1, and Microsoft C/C++ version 7.0.
KEYWORDS: CD4; S13369; Q82076
=============================================================================
=============================================================================
****
**** The DBMENU sample can be downloaded from the
**** file 4-107.zip in library section number 4
****
DBMENU: Adds Menus to a Dialog Box
DBMENU demonstrates how to add menus to a dialog box.
Placing a menu in a dialog box is not part of the Common
User Access (CUA) standard, but is supported by
Microsoft(R) Windows(TM).
An application must adopt specific dialog-box styles and
avoid others to use menus in a dialog box properly:
> The dialog box must have both the WS_CAPTION and
WS_SYSMENU styles so the user can traverse a dialog-box
menu using the LEFT ARROW and RIGHT ARROW keys. The
WS_SYSMENU style adds a System menu to the dialog box.
> The application must process the WM_COMMAND message in
the dialog-box procedure to enable the user to close the
dialog box by choosing Close from the System menu. If the
user closes the dialog box in this manner, wParam is set
to IDCANCEL.
> The dialog box must not use the DS_MODALFRAME style
because the menu is not painted properly when this style
is specified.
> You can use the WS_BORDER style to place a thin black
border around the dialog box.
> Do not use the WS_CHILD style in any dialog box.
> Include the WS_VISIBLE style to ensure that the dialog
box is drawn on the screen.
You can use accelerator keys only on modeless dialog boxes
created by one of the CreateDialog functions. An
application processes accelerator keys by calling the
TranslateAccelerator function in its main message loop.
Because modal dialog boxes have a "private" message loop,
an application cannot insert the necessary call to
TranslateAccelerator.
An application can use a modeless dialog box to simulate a
modal dialog box by calling EnableWindow to disable the
application's main window once the dialog box is
displayed. The application must call EnableWindow to
enable the main window before destroying the modeless
dialog box.
DBMENU 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.
Do not use the following key combinations as accelerators:
CTRL+H, CTRL+I, and CTRL+M. For more information, query
the Knowledge Base section of the Developer Network CD for
the following terms:
prod(winsdk) and ctrl and accelerator and conflict
DBMENU was built and tested under Microsoft Windows
versions 3.0 and 3.1, and Microsoft C/C++ version 7.0.
KEYWORDS: CD4; S13408; Q84129
=============================================================================
=============================================================================
****
**** The DLGTAB sample can be downloaded from the
**** file 4-108.zip in library section number 4
****
DLGTAB: Navigates Button Lists of Parent and Child Windows
with Keyboard Commands
DLGTAB addresses the problems inherent in using the arrow
or tab keys to move through a window's button list when
the window is the parent of an open child window.
Without taking special precautions to circumvent this
problem, an application will enter an infinite loop when
the user attempts to use the keyboard to move from the
last button in the parent window.
DLGTAB was built with Microsoft(R) Visual C++(TM) and
tested under Microsoft Windows version 3.1. Any errors
encountered during the build process indicate a
development environment different from the standard
installation environment setup.
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The DYNDLG sample can be downloaded from the
**** file 4-49.zip in library section number 4
****
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 library section number 4
****
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 EXPAND sample can be downloaded from the
**** file 4-109.zip in library section number 4
****
EXPAND: Expands the Size of a Dialog Box
EXPAND shows how to create a dialog box that expands to
provide additional controls when the user clicks a button.
To use an expanding dialog box in an application, you must
first perform two tasks:
1. Design the entire dialog box and determine which
controls will not be initially visible.
2. Disable these hidden controls in the dialog-box
template by including the WS_DISABLED style bit. This
prevents the TAB key or the mnemonic key from giving the
focus to one of the hidden controls.
When the user clicks the Expand button, follow these
steps:
1. Disable the Expand button using EnableWindow(hWnd,
FALSE).
2. Enable the previously hidden controls using
EnableWindow(hWnd, TRUE).
3. Use SetFocus to place the focus on the appropriate
control.
4. Use the following function to retrieve the current
position and size of the dialog box:
GetWindowRect(hWndDlg, (LPRECT)&r);
5. Use the following function to expand the dialog box to
its new size:
MoveWindow(hWndDlg, r.left, r.top, r.right - r.left,
(r.bottom - r.top) + change, TRUE);
where "change" is the difference between the small size
and the large size. You can use the MoveWindow function to
expand a window in any direction you wish.
EXPAND 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.
EXPAND was built and tested under Microsoft(R) Windows(TM)
versions 3.0 and 3.1, and Microsoft C/C++ version 7.0.
KEYWORDS: CD4; S12027; Q35499
=============================================================================
=============================================================================
****
**** The FLSHEDIT sample can be downloaded from the
**** file 4-110.zip in library section number 4
****
FLSHEDIT: Shows How to Flash an Edit Control
FLSHEDIT demonstrates how to make an edit control flash to
indicate that the control has the input focus.
If an application window or dialog box has a number of
edit controls, the user can lose track of the control that
has the input focus. FLSHEDIT uses a technique that is
similar to calling the FlashWindow function. (FlashWindow
flashes the caption bar on a window to gain the user's
attention.) See the README.TXT file for information on the
components of the FLSHEDIT sample.
The FLSHEDIT sample displays a dialog box with four edit
controls. The application uses a timer to flash whichever
edit control has the focus. Whenever an edit control
receives the input focus (an EN_SETFOCUS message), the
application sets the timer. When the edit control loses
the input focus (an EN_KILLFOCUS message) or when the
context of the edit control changes (an EN_CHANGE
message), the application destroys the timer.
When the specified time elapses and the application
receives a WM_TIMER message, the application invalidates
the contents of the edit control and specifies the new
text and background colors. Microsoft(R) Windows(TM)
redraws the control using the new colors.
Thus, a control stops flashing when either:
> The user takes the input focus away from the control;
or
> The user changes the text contents of the control.
FLSHEDIT provides options to stop flashing or to change
the background color of the flashing.
FLSHEDIT also flashes the selected background color in an
edit control to indicate that the control has the input
focus. When the focus moves to another control, the edit
control text changes from "I HAVE the focus" to "I DON'T
have the focus." However, if the user changes the contents
of an edit control, these default strings are not
displayed. If the user changes the text to an empty
string, the edit control redisplays the default strings.
Windows version 3.0 does not change the background color
of a single-line edit control properly. This problem has
been corrected in Windows version 3.1.
FLSHEDIT 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.
FLSHEDIT was built and tested under Microsoft Windows
version 3.1 and Microsoft C/C++ version 7.0.
KEYWORDS: CD4; S13376; Q83364
=============================================================================
=============================================================================
****
**** The GLBEDIT sample can be downloaded from the
**** file 4-111.zip in library section number 4
****
GLBEDIT: Raises Text Size Limit for Edit Controls
GLBEDIT demonstrates how an edit control can have its own
data segment and thus increase its text size. By default,
the buffer for an edit control is allocated from the
application's data segment. Space is a scarce resource in
the data segment because the segment also stores
information for other controls.
Normally, the edit controls in a dialog box use one common
global data segment per dialog box. If the dialog box has
the DS_LOCALEDIT style, the edit controls use the data
segment that hInstance (used to create the dialog box)
points to. Edit controls created with CreateWindow also
use the data segment that hInstance points to.
The GLBEDIT sample shows how to change hInstance to point
to a new global object. Multiple controls of any type can
use the same memory object. Search for WM_CREATE in the
MainWndProc code for an example.
GLBEDIT is included in the Microsoft(R) 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.
GLBEDIT was built and tested under Microsoft Windows(TM)
versions 3.0 and 3.1, and Microsoft C/C++ version 7.0.
KEYWORDS: CD4; S13200; Q77287
=============================================================================
=============================================================================
****
**** The HITTEST sample can be downloaded from the
**** file 4-51.zip in library section number 4
****
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 library section number 4
****
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 library section number 4
****
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 MOVECC sample can be downloaded from the
**** file 4-112.zip in library section number 4
****
MOVECC: Simulates the Drag-and-Drop Interface for Custom
Controls
MOVECC uses the MoveWindow function to simulate the drag-
and-drop interface for custom controls. The sample allows
you to click a control and drag it to a new location.
MOVECC also shows how to manipulate the child window Z-
order to prevent windows from disappearing behind other
child windows and child windows appearing over other child
windows.
MOVECC is included in the Microsoft(R) 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.
MOVECC was built and tested under Microsoft Windows(TM)
versions 3.0 and 3.1, and Microsoft C/C++ version 7.0.
KEYWORDS: CD4; S12913;Q69080
=============================================================================
=============================================================================
****
**** The MSGCOLOR sample can be downloaded from the
**** file 4-113.zip in library section number 4
****
MSGCOLOR: Changes Message Box Colors
MSGCOLOR demonstrates how to change the background and
text color of a message box by subclassing the message
box.
To create a message box whose background and text color
can be changed, MSGCOLOR uses the ColorMessageBox function
to subclass the message box so that WM_CTLCOLOR messages
can be intercepted and processed. Subclassing the message
box, however, requires access to the window handle of the
message box; this is accomplished by using a WH_CBT hook
to provide access to the window handle when the message
box is created.
MSGCOLOR was built with Microsoft(R) Visual C++(TM) and
tested under Microsoft Windows version 3.1. Any errors
encountered during the build process indicate a
development environment different from the standard
installation environment setup.
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The MULTIDLG sample can be downloaded from the
**** file 4-114.zip in library section number 4
****
MULTIDLG: Creates Dynamic Dialog Boxes
MULTIDLG demonstrates one method of creating dynamic child
dialog boxes that implement a list box on the left that
controls the set of controls to display on the right.
MULTIDLG accomplishes this by parsing dialog resource
templates, just as Microsoft(R) Windows(TM) would on a
call to the DialogBox or CreateDialog function.
MULTIDLG was built with Microsoft Visual C++(TM) and
tested under Microsoft Windows version 3.1. Any errors
encountered during the build process indicate a
development environment different from the standard
installation environment setup.
KEYWORDS: CD6
=============================================================================
=============================================================================
****
**** The RIGHTJUS sample can be downloaded from the
**** file 4-115.zip in library section number 4
****
RIGHTJUS: Right-Justifies Numbers in a List Box
RIGHTJUS shows how to use tabs to align columns in a list
box. The sample application displays a list box containing
text and numbers.
Before Microsoft(R) Windows(TM) version 3.0, it was
possible to align columns of information in a Windows list
box with spaces because all characters in the system font
had the same width. In Windows versions 3.0 and 3.1, the
system font is proportionally spaced with letters of
differing widths, which prevents this technique from being
usable.
Instead, you can use tabs to align columns in a list box.
To do this, specify the LBS_USETABSTOPS style when you
create the list box. Set a tab to correspond to the
position of each digit in each numeric column. The tabs
must be specified in dialog units. A dialog unit is one-
fourth of a character width. For example, a three-digit
field that should align 12 characters from the left edge
of the dialog box can be implemented by setting tabs at
positions 40, 44, and 48, as illustrated below:
+------------+
|text xxx|
|longer xx|
^^^
|||
||+-- position 48
|+--- position 44
+---- position 40
After determining the text to insert in the list box,
convert the spaces to the appropriate number of tabs as
follows:
sprintf(szNumBuffer, "%3d", Number);
for (i = 0; i < 3; i++)
if (szNumBuffer[i] == ' ')
szNumBuffer[i] = '\t';
This code uses the three tabs set above.
RIGHTJUS 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.
RIGHTJUS was built and tested under Microsoft Windows
versions 3.0 and 3.1, and Microsoft C/C++ version 7.0.
KEYWORDS: CD4; S12663; Q64078
=============================================================================
=============================================================================
****
**** The SIGNON sample can be downloaded from the
**** file 4-54.zip in library section number 4
****
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 SUPERCLS sample can be downloaded from the
**** file 4-116.zip in library section number 4
****
SUPERCLS: Superclasses Control Windows
SUPERCLS shows how to superclass control windows.
Superclassing provides the same capabilities as
subclassing (that is, it allows controls to inherit the
control window's styles and features), but is more
convenient to use and produces smaller code if multiple
controls receive the same superclass.
To superclass, create a new class that uses the control
window procedure instead of the default window procedure.
This enables the application to process the appropriate
messages and to pass other messages along to the default
procedure where they will be processed correctly, based on
the control type.
To implement superclassing, create a window of the
superclass type. Query all available information about the
control and use this information when the new window is
created, substituting a new class name and a new window
procedure for the old. When the new window procedure is
called, process the desired messages and pass the others
to the standard control procedure (determined in the
query).
By registering a new class, the application can create
superclassed controls using the application resource (.RC)
file or the CreateWindow function without any further
work, thus eliminating a number of SetWindowLong calls if
multiple controls are modified in the same manner.
In the SUPERCLS example, the application creates a new
control class called "SuperEdit", which is identical to a
regular edit control but refuses to accept the "b"
character. Look for the string "SuperEdit" in the .C, .RC,
and .DEF files to see the relevant areas of the code.
Normally, each edit control created using DialogBox,
CreateDialog, or through an .RC file has its own data
segment. When the application changes the class name, the
code within Windows that handles edit controls is not
activated. Instead, the control uses the application's
data segment. When the code for the superclassed edit
control calls LocalAlloc, it consumes space in the
application's local heap, but this should not cause
problems in most cases.
SUPERCLS is included in the Microsoft(R) 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.
SUPERCLS was built and tested under Microsoft Windows(TM)
versions 3.0 and 3.1, and Microsoft C/C++ version 7.0.
KEYWORDS: CD4; S12007; Q32167
=============================================================================
=============================================================================
****
**** The SYSPARAM sample can be downloaded from the
**** file 4-55.zip in library section number 4
****
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 TWINS sample can be downloaded from the
**** file 4-117.zip in library section number 4
****
TWINS: Demonstrates Communications with
RegisterWindowMessage
TWINS demonstrates how to use the RegisterWindowMessage
function to implement communications between two
applications: APP1 and APP2. This method is an alternative
to using dynamic data exchange (DDE) for communications;
it is particularly useful if the information to be passed
between applications can be contained in the wParam and/or
lParam parameters of the message.
The RegisterWindowMessage function associates a unique
message number with a given message name, thus creating a
new message. This message number is guaranteed to be
unique throughout the system, but may change between
Microsoft(R) Windows(TM) sessions. The new message is
typically used for communications between two cooperating
applications.
TWINS 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.
TWINS was built and tested under Microsoft Windows version
3.1 and Microsoft C/C++ version 7.0.
KEYWORDS: CD4; S12833;Q66246
=============================================================================
****
**** The EATPAGES sample can be downloaded from the
**** file 7-1.zip in library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 library section number 7
****
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 TOOLS sample can be downloaded from the
**** file 7-5.zip in library section number 4
****
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 library section number 4
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 library section number 5
****
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 CROSSREF technical article can be downloaded from the
**** file 8-1.zip in library section number 8
****
Related Articles
Created: April 19, 1993
=============================================================================
=============================================================================
****
**** The MIXED technical article can be downloaded from the
**** file 8-2.zip in library section number 8
****
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 library section number 8
****
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 library section number 8
****
Visual Basic Programming Conventions from Microsoft Consulting Services
=============================================================================
=============================================================================
****
**** The VBDLL technical article can be downloaded from the
**** file 8-5.zip in library section number 8
****
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 library section number 9
****
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 library section number 9
****
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 library section number 9
****
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 CLASSY technical article can be downloaded from the
**** file 10-99.zip in library section number 10
****
Classy Windows
Kyle Marsh
Microsoft Developer Network Technology Group
Created: June 23, 1993
Abstract
Most developers consider window classes a necessary evil. They grab the
RegisterClass function from GENERIC or from another starter application,
fiddle with the values a little, and then move on. In this article, we will
explore the features of window classes and explain how they can benefit an
application.
Specifically, we will discuss:
o What window classes are.
o What differences exist between system global, application global, and
application local classes.
o What information a class stores.
o How this information affects the window's behavior.
o What an application can do with window classes.
=============================================================================
=============================================================================
****
**** The COMPAT technical article can be downloaded from the
**** file 10-71.zip in library section number 10
****
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 library section number 10
****
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 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 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.
Revised: June 1993
Added CTL3DS.LIB versions of library.
Revised: August 1993
Fixed documentation error: CTL3D does subclass static controls with
SS_NOPREFIX.
Fixed documentation error: Ctl3dUnRegister should be Ctl3dUnregister.
Added CTL3DD.OBJ versions of library.
Added to section on how to install CTL3D and use static-link versions.
Fixed disabled text color selection.
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 library.
=============================================================================
=============================================================================
****
**** The CTLDLGED technical article can be downloaded from the
**** file 10-5.zip in library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 CSETUP technical article can be downloaded from the
**** file 11-64.zip in library section number 10
****
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 DEVENV technical article can be downloaded from the
**** file 10-10.zip in library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 ANATOMY technical article can be downloaded from the
**** file 10-100.zip in library section number 10
****
DLL Anatomy---What's a DLL Made Of?
Dan Ruder
Microsoft Developer Support Group
Created: May 24, 1993
Abstract
This article explains the major elements of dynamic-link libraries (DLLs)
for Microsoft Windows versions 3.0 and 3.1: LibEntry, LibMain, WEP, and
programmer-defined functions. It describes each element in terms of its
purpose, function, and usage, and discusses the run-time libraries for DLLs
supplied with the Microsoft C and C++ compilers.
=============================================================================
=============================================================================
****
**** The APPEXEC technical article can be downloaded from the
**** file 10-1.zip in library section number 10
****
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 BIMODAL technical article can be downloaded from the
**** file 10-101.zip in library section number 10
****
Bimodal Interrupt Handlers
Ruediger Asche, Microsoft Developer Network Technology Group
David Long, Microsoft Developer Network Technology Group
Created: October 4, 1993
Abstract
This article discusses bimodal interrupt handlers (BIHs) in the Microsoft
Windows version 3.1 operating system. A BIH is a 16-bit interrupt service
routine (ISR) that the system can call directly from either the 32-bit
virtual machine manager (VMM) environment or the 16-bit Windows environment.
That is, a BIH lives in ring 3 as part of a Windows dynamic-link library
(DLL), but can execute either in ring 3 (where all Windows-based applications
and DLLs live) or in ring 0 (where virtual devices and the VMM live). By
executing in ring 0, a BIH incurs less interrupt latency than a
protected-mode interrupt handler.
The challenge you face in writing a BIH is that your code has to fend for
itself completely---it must be able to operate correctly in both ring 0 and
ring 3, in any virtual machine (VM) running on a USE32 stack. These
requirements complicate matters considerably.
Before you dive into this article, we would like to make the following
recommendation: Avoid writing enhanced-mode BIHs. If you need the speed,
write a VxD. If you don't need the speed, leave your ISR in a regular 16-bit
DLL so it can benefit from the system support Windows provides automatically
for ISRs in all configurations (real mode, standard mode, enhanced mode, and
future versions of Windows).
=============================================================================
=============================================================================
****
**** The DLLINTRO technical article can be downloaded from the
**** file 10-13.zip in library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 ISR technical article can be downloaded from the
**** file 10-102.zip in library section number 10
****
Writing Interrupt Service Routines
David Long
Microsoft Developer Network Technology Group
Created: July 6, 1993
Abstract
This article discusses the issues involved in writing interrupt service
routines (ISRs) for the Microsoft Windows version 3.1 operating system.
Although the article's focus is not on virtual devices (VxDs), it discusses
the advantages and disadvantages of writing a VxD instead of a dynamic-link
library (DLL). The article discusses the following topics:
=============================================================================
=============================================================================
****
**** The MTI technical article can be downloaded from the
**** file 10-27.zip in library section number 10
****
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 TAOINT technical article can be downloaded from the
**** file 10-103.zip in library section number 10
****
The Tao of Interrupts
David Long
Microsoft Developer Network Technology Group
Created: October 4, 1993
Abstract
=============================================================================
=============================================================================
****
**** The TIMER2 technical article can be downloaded from the
**** file 10-42.zip in library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 Full System topic support
o An application programming interface (API) to dynamically add and remove
topics and topic/item pairs
o An API to dynamically add and remove DDE execute commands to a topic
o Automatic tracking of conversations
o Built-in execute command parser
o 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 "DDE Execute Strings"
o "DDE Hot Links"
o "Performing DDE from a Dynamic-Link Library"
o "Raw DDE"
o "Supporting the Clipboard, DDE, and OLE in Applications"
o "Supporting the DDE System Topic"
=============================================================================
=============================================================================
****
**** The DDESYSTP technical article can be downloaded from the
**** file 10-9.zip in library section number 10
****
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 library section number 10
****
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 OLE2-A technical article can be downloaded from the
**** file 10-104.zip in library section number 10
****
OLE for Idiots: A Is for Attitude
Herman Rodent
Microsoft Developer Network Technology Group
Created: June 22, 1993
Abstract
Does the pile of documents on your desk about Object Linking and Embedding
(OLE) version 2.0 scare you? Do you hate the idea of having to learn C++? Is
your manager getting a little pushy about progress on the OLE implementation
you haven't started yet? When I first looked at OLE 2.0, it seemed very
complicated and overwheIming, and I thought that maybe the time had come for
me to take up woodworking for a living. If that's how you feel, read on.
This is the first in a series of articles on implementing OLE 2.0 in your
applications and covers some basic requirements that must be understood
before any OLE work can take place. The remaining articles in the series will
cover:
o Using structured storage.
o Creating a minimal container application.
o Adding in-place activation to a container application.
=============================================================================
=============================================================================
****
**** The OLE2-B technical article can be downloaded from the
**** file 10-105.zip in library section number 10
****
OLE for Idiots: B Is for Beginning
Herman Rodent
Microsoft Developer Network Technology Group
Created: June 22, 1993
Abstract
This article is one of a series of articles that discuss implementing Object
Linking and Embedding (OLE) version 2.0 in Microsoft Windows-based
applications. This article looks at the structured storage facility in OLE
and shows how an application can be simply converted from using MS-DOS files
for its storage to OLE's structured storage system. Using structured storage
is the first step towards creating an OLE container application.
=============================================================================
=============================================================================
****
**** The OLE2-C technical article can be downloaded from the
**** file 10-106.zip in library section number 10
****
OLE for Idiots: C Is for Container
Herman Rodent
Microsoft Developer Network Technology Group
Created: August 6, 1993
Abstract
This article is the third in the "OLE for Idiots" series and describes the
implementation of the simplest form of OLE (object linking and embedding)
container application. This is what it's all about---sticking other people's
objects in your application---but you can't start here. You need to read "OLE
for Idiots: A Is for Attitude" and "OLE for Idiots: B Is for Beginning"
first.
The Bucket sample application, which accompanies this article, was written
in C and was derived from the TBSS sample application associated with the
previous article in the series, "OLE for Idiots: B Is for Beginning." Bucket
supports object embedding (not linking) and editing by a server in a separate
window (not in-place editing).
=============================================================================
=============================================================================
****
**** The OLE2-D technical article can be downloaded from the
**** file 10-107.zip in library section number 10
****
OLE for Idiots: D Is for Dragon
Herman Rodent
Microsoft Developer Network Technology Group
Created: September 20, 1993
Abstract
This article continues the "OLE for Idiots" series with a brief look at the
role of the dragon in modern day applications. The article describes how the
so-called "Dragon Drop" (drag-and-drop) support was added to the OLE (object
linking and embedding) version 2.0 container application, Bucket, developed
in the previous article, "OLE for Idiots: C Is for Container."msdn_ole2c
Dragon Drop is not as painful for you as it is for the dragon---as we shall
see.
Readers of my previous articles may be starting to think that the business
of dealing with OLE 2.0 has finally got a hold on my few remaining functional
brain cells. You're right---it has!
=============================================================================
=============================================================================
****
**** The OLE2AUTO technical article can be downloaded from the
**** file 10-108.zip in library section number 10
****
OLE 2.0 Automation
Jeff Webb
Senior Technical Writer, Applications Programmability Business Unit
Created: April 30, 1993
Abstract
OLE (object linking and embedding) Automation is part of OLE version 2.0. It
provides a documented, standard way of creating and accessing applications
programmatically---OLE 2.0 includes documentation, dynamic-link libraries
(DLLs), and samples that demonstrate the various aspects of OLE Automation.
This article can't cover the whole spectrum, but it will give you a solid
overview of how you create and access applications that use OLE Automation.
=============================================================================
=============================================================================
****
**** The PROPSET technical article can be downloaded from the
**** file 10-109.zip in library section number 10
****
OLE 2.0 Property Sets Exposed
Charlie Kindel
Program Manager, Microsoft Vertical Developer Relations
Created: August 27, 1993
Abstract
This article and the C++ classes that accompany it are designed to help you
work with property sets in object linking and embedding (OLE) version 2.0.
Property sets are documented in the OLE 2.0 Programmer's Reference (Appendix
B) and the OLE 2.0 Design Specification (Chapter 12). Unfortunately, neither
of these sources is complete. Therefore, I have attempted to make this a
one-stop shopping place for OLE 2.0 property set information.
I have also included helpful code snippets and structure definitions that
you may find useful when implementing property-set--related code. To some,
this kind of information may be obvious, but for others it will save them the
trouble of trying to figure it out themselves.
The implementation given here is a C++ implementation that uses some
features of the Microsoft Foundation classes (CObList for linked list
management). However, there is nothing inherent in property sets that would
prevent you from implementing a set of application programming interfaces
(APIs) for manipulating them in C. Also, my implementation could be easily
modified to not use Foundation classes at all: The only thing I use is the
CObList class for linked list management. If you have your own linked list
management routines, you could easily retrofit them and remove my code's
dependency on Foundation classes.
This article assumes the reader is familiar with the overall architecture of
OLE 2.0, and understands the OLE 2.0 structured storage model (in particular,
the IStorage and IStream interfaces). Chapter 3 of the OLE 2.0 Programmer's
Reference provides a good architectural overview of OLE 2.0, while Chapter 11
addresses structured storage.
=============================================================================
=============================================================================
****
**** The RAWDDE technical article can be downloaded from the
**** file 10-34.zip in library section number 10
****
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 library section number 10
****
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 library section number 10
****
OLE Object Streams
Kraig Brockschmidt
Created: March 23, 1992
=============================================================================
=============================================================================
****
**** The OVERVPEN technical article can be downloaded from the
**** file 10-86.zip in library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 library section number 10
****
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 AVIHOT technical article can be downloaded from the
**** file 10-110.zip in library section number 10
****
AVI Files with Hot Spots
David A. Feinleib
Created: August 16, 1993
Abstract
The AVI Hotspot Editor (AVIHED.EXE) and its accompanying dynamic-link
libraries (DLLs) AVIHVWR.DLL and AVIHAPP.DLL provide you with the ability to
specify hot spots for audio-video interleaved (AVI) files, much as you can
specify hot spots for device-independent bitmap (DIB) files with the
segmented hypergraphics hot-spot editor (SHED.EXE). The AVI hot-spot kit can
be used with Microsoft Multimedia Viewer or with a stand-alone application by
using the correct DLL.
The AVI Hotspot Editor allows you to draw hot spots easily on your AVI file
and save them in a hot-spot information file, which you specify when you call
the hspPlayAVI function in the AVI hot-spot DLL.
The AVI hot-spot kit allows you to:
o Specify Begin and End frames for each hot spot so that, for example, two
hot spots can cover an overlapping space as long as their Begin and End
frames do not overlap;
o Execute any Viewer command or send a message to your calling stand-alone
application when a hot spot is selected; additionally, you can continue or
terminate playing when a hot spot is selected, or jump to another location in
the same AVI file.
=============================================================================
=============================================================================
****
**** The GRAPHX technical article can be downloaded from the
**** file 10-57.zip in library section number 10
****
Graphics Design and Optimization
Matt Saettler
Microsoft Multimedia
Created: August 1992
Revision 1.01
Abstract
=============================================================================
=============================================================================
****
**** The JPEG technical article can be downloaded from the
**** file 10-111.zip in library section number 10
****
Multimedia Technical Note: JPEG DIB Format
Created: May 26, 1993
=============================================================================
=============================================================================
****
**** The MEMORY technical article can be downloaded from the
**** file 10-58.zip in library section number 10
****
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 library section number 10
****
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 library section number 10
****
Multimedia Standards Update: Document Overview
Created: October 2, 1992
Revised: July 30, 1993 (Revision 1.1)
Abstract
This document presents the list of the current documents available from the
Multimedia technologies group at Microsoft. Readers should use this list to
ensure that they have the current version of the listed documents and as a
guide to the documents that are available.
=============================================================================
=============================================================================
****
**** The OPTCDROM technical article can be downloaded from the
**** file 10-61.zip in library section number 10
****
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 PROD_IDS technical article can be downloaded from the
**** file 10-112.zip in library section number 10
****
Multimedia Standards Update: New Multimedia IDs
Revised: June 22, 1993
Revision 1.2.0
=============================================================================
=============================================================================
****
**** The RIFFNEW technical article can be downloaded from the
**** file 10-62.zip in library section number 10
****
Multimedia Standards Update: New Multimedia Data Types and Data Techniques
Created: October 1992
Revised: January 12, 1993
Revision 1.0.108
Revised: June 22, 1993
Revision 2.1.0
=============================================================================
=============================================================================
****
**** The SINGACD technical article can be downloaded from the
**** file 10-98.zip in library section number 10
****
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 library section number 10
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 DRAFT3 technical article can be downloaded from the
**** file 11-4.zip in library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 2VW1DOC technical article can be downloaded from the
**** file 11-65.zip in library section number 11
****
Multiple Views for a Single Document
Dale Rogerson
Microsoft Developer Network Technology Group
Created: August 2, 1993
Abstract
This technical article explains how to provide different views for a single
document. For example, a graphing application might have a graph view and a
data view of the same data. Two sample applications, Tangram and CHKBOOK,
accompany this article. Tangram is a game that demonstrates many of the
features provided by the Microsoft Foundation Class Library version 2.0.
CHKBOOK is a sample included with the Microsoft Foundation Class Library
version 2.0 that demonstrates multiple views for a single document.
=============================================================================
=============================================================================
****
**** The MYMDI technical article can be downloaded from the
**** file 11-66.zip in library section number 11
****
Painting the MDI Client Area
Dale Rogerson
Microsoft Developer Network Technology Group
Created: August 2, 1993
Abstract
This technical article explains how to paint the multiple document interface
(MDI) client area with the Microsoft Foundation Class Library version 2.0.
The MDI client area is the workspace in which the MDI child windows reside.
The Tangram sample application that accompanies this article displays a
bitmap in the MDI client area.
=============================================================================
=============================================================================
****
**** The PICMSDN technical article can be downloaded from the
**** file 11-67.zip in library section number 11
****
The Microsoft Picture Edit Controls 1.0 for MFC
David L. Stearns
Microsoft Information Technology Group
Created: October 1, 1993
Revision: 0.04
Abstract
This article contains information on how to use the Microsoft Picture Edit
Control Libraries 1.0 and describes the overall class hierarchy, the
interfaces to each class, and the internal structure of the classes. The
focus is on the public interfaces. The article also includes instructions on
how to create derived classes from the Microsoft Picture Edit Control
Libraries to add new mask characters, specialize the controls for specific
purposes, or change any default behavior.
}5 }3 The prefix string is treated as literal characters and the user will
not be able to edit them.
=============================================================================
=============================================================================
****
**** The SCROLL technical article can be downloaded from the
**** file 11-68.zip in library section number 11
****
Scrolling with MM_ANISOTROPIC
Dale Rogerson
Microsoft Developer Network Technology Group
Created: July 22, 1993
Abstract
The CScrollView class provided by the Microsoft Foundation Class Library
version 2.0 does not support the MM_ISOTROPIC and MM_ANISOTROPIC mapping
modes. This article describes two solutions for scrolling views that require
these mapping modes.
=============================================================================
=============================================================================
****
**** The TANGRAM technical article can be downloaded from the
**** file 11-69.zip in library section number 11
****
Tangram: Tricks of the Trade
Dale Rogerson
Microsoft Developer Network Technology Group
Created: July 23, 1993
Abstract
The Tangram sample application demonstrates common programming tasks in the
Microsoft Foundation Class Library version 2.0. This technical article
explains how to use Tangram and describes the programming tasks that Tangram
demonstrates.
=============================================================================
=============================================================================
****
**** The VCTN001 technical article can be downloaded from the
**** file 11-33.zip in library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 11
****
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 library section number 12
****
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 TCPTECHA technical article can be downloaded from the
**** file 12-8.zip in library section number 12
****
Implementation Details of the Microsoft LAN Manager TCP/IP Protocol
Margaret K. Johnson
Thanks to Mike Gunning (Hewlett-Packard); and Shirish Koti, Dan Perry,
Mahesh Keni, and Glen Clark (Microsoft).
Abstract
This technical article is the first in a series of three that discuss the
implementation details of the Microsoft LAN Manager TCP/IP that ships with
LAN Manager 2.1 (referred to as LM TCP/IP). This article will focus on LM
TCP/IP internals. The second technical article, "Interfaces to the Microsoft
LAN Manager TCP/IP Protocol," focuses on the socket and RFC NetBIOS
interfaces to LM TCP/IP. The third technical article, "Optimizing the
Microsoft LAN Manager TCP/IP Protocol," focuses on memory management for
MS-DOS implementation and performance considerations. The objective of all
three is to discuss concepts that you need to understand to efficiently
implement LM TCP/IP.
Microsoft has three products that support TCP/IP:
o The actual protocol stack that ships with LAN Manager 2.1
o A TCP/IP utilities product that includes support for FTP, RSH, RCP, and
terminal emulators
o An SNMP service included in LAN Manager 2.1 for support of MIB I and
private LAN Manager MIB II objects
This article will only address the implementation details of the actual
protocol stack.
The TCP/IP parameters are located in PROTOCOL.INI. LM TCP/IP utility
parameters are located in TCPUTILS.INI. The major part of this discussion
will address parameters in PROTOCOL.INI. However, reference is made to
TCPUTILS.INI when addressing name resolution. Parameters contained in either
of these files or in LANMAN.INI are in italics. Commands that can be typed at
aworkstation are in bold.
It is assumed that the reader is familiar with and understands the
difference between the layers of the OSI model. An excellent source for this
information is Andrew Tanenbaum's book, Computer Networks.
Many of the details of the TCP/IP protocol stack are outside the scope of
this document. These topics are handled very well in Douglas Comer's classic
book on TCP/IP, Internetworking with TCP/IP, Volume 1. Particulars about
these two books can be found under "References" at the end of this article.
=============================================================================
=============================================================================
****
**** The TCPTECHB technical article can be downloaded from the
**** file 12-9.zip in library section number 12
****
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 library section number 12
****
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 WFWLM technical article can be downloaded from the
**** file 12-11.zip in library section number 12
****
Integrating Microsoft Windows for Workgroups with Microsoft LAN Manager 2.2
Glen Clark
Microsoft Technical Resource Group
Created: November 1992
Conventional Memory :
Name Size in Decimal Size in Hex
------------- --------------------- -------------
MSDOS 16000 ( 15.6K) 3E80
SETVER 400 ( 0.4K) 190
HIMEM 1184 ( 1.2K) 4A0
EMM386 8512 ( 8.3K) 2140
PROTMAN 6208 ( 6.1K) 1840
ELNKII 14528 ( 14.2K) 38C0
TCPDRV 1040 ( 1.0K) 410
NEMM 400 ( 0.4K) 190
COMMAND 2624 ( 2.6K) A40
UMB 256 ( 0.3K) 100
NETBEUI 37104 ( 36.2K) 90F0
TCPTSR 63504 ( 62.0K) F810
TINYRFC 256 ( 0.3K) 100
FREE 64 ( 0.1K) 40
FREE 144 ( 0.1K) 90
FREE 502768 (491.0K) 7ABF0
Total FREE : 502976 (491.2K)
Upper Memory :
Name Size in Decimal Size in Hex
------------- --------------------- -------------
SYSTEM 163840 (160.0K) 28000
UMB 672 ( 0.7K) 2A0
TINYRFC 15328 ( 15.0K) 3BE0
MINSES 1888 ( 1.8K) 760
NETWKSTA 93456 ( 91.3K) 16D10
ENCRYPT 2112 ( 2.1K) 840
MSRV 10512 ( 10.3K) 2910
NETPOPUP 18976 ( 18.5K) 4A20
FREE 128 ( 0.1K) 80
FREE 20608 ( 20.1K) 5080
Total FREE : 20736 ( 20.3K)
Total bytes available to programs (Conventional+Upper) :
523712 (511.4K)
Largest executable program size : 502768 (491.0K)
Largest available upper memory block : 20608 ( 20.1K)
Conventional Memory :
Name Size in Decimal Size in Hex
------------- --------------------- -------------
MSDOS 17152 ( 16.8K) 4300
SETVER 400 ( 0.4K) 190
HIMEM 1072 ( 1.0K) 430
EMM386 3232 ( 3.2K) CA0
PROTMAN 112 ( 0.1K) 70
WORKGRP 4352 ( 4.3K) 1100
ELNKII 14528 ( 14.2K) 38C0
COMMAND 2624 ( 2.6K) A40
FREE 64 ( 0.1K) 40
FREE 611552 (597.2K) 954E0
Total FREE : 611616 (597.3K)
Upper Memory :
Name Size in Decimal Size in Hex
------------- --------------------- -------------
SYSTEM 167472 (163.5K) 28E30
SMARTDRV 28304 ( 27.6K) 6E90
FREE 32 ( 0.0K) 20
FREE 131808 (128.7K) 202E0
Total FREE : 131840 (128.8K)
Total bytes available to programs (Conventional+Upper) :
743456 (726.0K)
Largest executable program size : 611440 (597.1K)
Largest available upper memory block : 131808 (128.7K)
=============================================================================
=============================================================================
****
**** The CONCUR technical article can be downloaded from the
**** file 12-4.zip in library section number 12
****
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 library section number 12
****
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 HETDB technical article can be downloaded from the
**** file 12-12.zip in library section number 12
****
Designing Client-Server Applications for Enterprise Database Connectivity
Created: June 1992
Abstract
The purpose of this technical article is to outline the database
connectivity solutions Microsoft has developed to allow client-server
applications to access enterprise-wide data. This technical article
identifies some of the basic problems involved in accessing heterogeneous
databases and outlines general approaches to achieving heterogeneous database
access. The database connectivity solutions developed by Microsoft are
discussed in depth, with an emphasis on how these products relate to each
other. Finally, this article provides some general guidelines for designing
applications for enterprise database connectivity using SQL Server and
Microsoft database connectivity products.
=============================================================================
=============================================================================
****
**** The NETINTEG technical article can be downloaded from the
**** file 12-13.zip in library section number 12
****
Microsoft SQL Server's Network Integration Architecture
Chris Moffat
Microsoft Technical Resource Group
Created: October 1992
Abstract
This technical article describes the architecture that enables Microsoft SQL
Server and related products to run efficiently in nearly all network
environments. It first describes the basic network integration architecture
and then discusses how each of the following products uses this architecture
to integrate into complex heterogeneous environments:
o Microsoft SQL Server
o Applications built using Microsoft Open Data Services
o Microsoft SQL Bridge
o Microsoft SQL Server Network Integration Kits for Novell NetWare Networks
o Microsoft SQL Server Network Integration Kits for Banyan VINES Networks
For additional technical information about the products discussed in this
technical note, refer to the following:
o Microsoft SQL Server version 4.2 product line documentation.
o Technical Note #098-32656, Designing Client-Server Applications for
Enterprise Database Connectivity: Heterogeneous database access using
Microsoft SQL Server, Open Database Connectivity, Open Data Services, and SQL
Bridge.
o Technical Note #098-32078, Microsoft Open Data Services: Application
Source Book.
=============================================================================
=============================================================================
****
**** The NTDBLIB technical article can be downloaded from the
**** file 12-14.zip in library section number 12
****
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-15.zip in library section number 12
****
Developing 32-Bit Open Data Services Applications for the Microsoft Windows
NT Operating System
Christopher Moffatt
Microsoft Technical Resource Group
Abstract
=============================================================================
=============================================================================
****
**** The OPENDATA technical article can be downloaded from the
**** file 12-16.zip in library section number 12
****
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 OPTTECH technical article can be downloaded from the
**** file 12-17.zip in library section number 12
****
Query Optimization Techniques: Contrasting Various Optimizer Implementations
with Microsoft SQL Server
Created: February 1992
=============================================================================
=============================================================================
****
**** The SHOWPLAN technical article can be downloaded from the
**** file 12-18.zip in library section number 12
****
Understanding Microsoft SQL Server's Query Optimizer (SHOWPLAN) Output
Gary Schroeder
SQL Server Escalation Engineer
Microsoft Corporate Support
=============================================================================
=============================================================================
****
**** The SQLAPPS technical article can be downloaded from the
**** file 12-6.zip in library section number 12
****
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-19.zip in library section number 12
****
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-20.zip in library section number 12
****
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-21.zip in library section number 12
****
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-22.zip in library section number 12
****
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 VB2VB technical article can be downloaded from the
**** file 12-23.zip in library section number 12
****
Net Gomuku: Bidirectional DDE in Visual Basic
Dale E. Rogerson
Microsoft Developer Network Technology Group
Created: May 3, 1993
Abstract
This article explains how the Net Gomuku sample application (NETGO.EXE)
simulates bidirectional dynamic data exchange (DDE) between two Visual Basic
applications. Net Gomuku is a Visual Basic application that uses the
Microsoft Windows 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 15 x 15 grid: The first player who gets
five pieces in a row wins. For more information on playing Net Gomuku, choose
Index from the Net Gomuku Help menu and review the online Help system.
The reader should be familiar with Visual Basic and DDE programming. Please
see the bibliography at the end of this article for suggested reading.
=============================================================================
=============================================================================
****
**** The VBSHARE technical article can be downloaded from the
**** file 12-24.zip in library section number 12
****
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 library section number 13
****
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 library section number 13
****
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 library section number 13
****
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 library section number 13
****
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 library section number 13
****
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 library section number 13
****
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 library section number 13
****
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 BONNET technical article can be downloaded from the
**** file 14-7.zip in library section number 14
****
Networking in Microsoft Windows NT
Glen Clark
Microsoft Corporate Technology Team
Created: May/June 1993
=============================================================================
=============================================================================
****
**** The DEBUG technical article can be downloaded from the
**** file 14-6.zip in library section number 14
****
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 Exploring the built-in debugging support of Win32, including Win32 debug
events and Win32 debug functions
o Looking at the relationship between a debugger and the process being
debugged
o Representing information about a process being debugged
o Using event objects for communicating between debugger threads
o Managing the debugger's graphical user interface (GUI)
o Responding to user commands in debug threads
o Controlling the threads of a process being debugged
o Accessing thread context information from threads of a process being
debugged
o Terminating and exiting a process being debugged
o Calling debug functions from a process being debugged
o 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 EMFDCODE technical article can be downloaded from the
**** file 14-8.zip in library section number 14
****
EMFDCODE.EXE: An Enhanced Metafile Decoding Utility
Dennis Crain
Microsoft Developer Network Technology Group
Created: July 20, 1993
Abstract
This article describes the process of porting WMFDCODE, the metafile
decoding utility in the Microsoft Windows Software Development Kit (SDK), to
EMFDCODE, the Win32 enhanced metafile utility. Issues encountered during the
port from WMFDCODE to EMFDCODE and the incorporation of enhanced metafile
capabilities into EMFDCODE are discussed. The code for EMFDCODE is also
provided. This article assumes that the reader has a good understanding of
Win32 enhanced metafiles. For a detailed description of enhanced metafiles,
see the "Enhanced Metafiles in Win32"msdn_enhmeta article by Dennis Crain on
the Microsoft Developer Network CD.
=============================================================================
=============================================================================
****
**** The ENHMETA technical article can be downloaded from the
**** file 14-9.zip in library section number 14
****
Enhanced Metafiles in Win32
Dennis Crain
Microsoft Developer Network Technology Group
Created: June 10, 1993
Abstract
With the advent of the Microsoft Win32 Application Programming Interface
(API), a new metafile format called enhanced metafiles has been introduced.
The overall design goal of the enhanced metafile was to describe a picture
without any coding restrictions and to make a metafile easier to use.
Enhanced metafiles have many advantages over the older Windows metafiles
found in Microsoft Windows version 3.1 (Win16). Improvements found in the
enhanced metafile include an expanded header, a description string, a
metafile palette, and an increase in the number and type of graphics device
interface (GDI) functions that may be recorded. In addition to these
enhancements, the metafile record and playback code in Win32 has been
designed to remove all of the restrictions that applied to Windows metafiles
with respect to scaling, clipping, embedding, and querying, among others. To
top it off, enhanced metafiles may be played on any device in a
device-independent manner. This article describes the differences between
Windows metafiles and enhanced metafiles. Sample code that illustrates the
basic concepts of creating and playing enhanced metafiles is provided at the
end of this article.
=============================================================================
=============================================================================
****
**** The FROGFLY1 technical article can be downloaded from the
**** file 14-10.zip in library section number 14
****
Using Multithreading and C++ to Generate Live Objects
Ruediger Asche
Microsoft Developer Network Technology Group
Created: August 22, 1993
Abstract
The language C++ provides a powerful framework for generating objects that
encapsulate data and help the programmer implement well-defined access
mechanisms, regardless of their representation. This modularity makes the
language very well suited to simulating applications that model
object-centered aspects of reality. However, it does not provide an intuitive
mechanism to model live objects, that is, objects that perform computations
on their own instead of simply residing in memory and waiting to be activated
from the outside. This article describes how multithreading can be used to
extend the power of C++ objects to model live objects.
=============================================================================
=============================================================================
****
**** The HANDLES1 technical article can be downloaded from the
**** file 14-11.zip in library section number 14
****
Give Me a Handle, and I'll Show You an Object
Ruediger Asche
Microsoft Developer Network Technology Group
Created: July 15, 1993
Abstract
This article discusses objects and handles under Microsoft Windows version
3.1 and Windows NT. The terms objects and handles have different meanings in
each operating system and imply a variety of relationships between objects
and their corresponding handles. This article elaborates on the differences
between the way components of Windows NT treat objects as opposed to the way
Windows 3.1 treats them, with particular emphasis on shareability issues.
=============================================================================
=============================================================================
****
**** The HEAPMM technical article can be downloaded from the
**** file 14-12.zip in library section number 14
****
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 HOOKS32 technical article can be downloaded from the
**** file 14-13.zip in library section number 14
****
Win32 Hooks
Kyle Marsh
Microsoft Developer Network Technology Group
Created: July 29, 1993
Abstract
This article describes hooks and their use in the Microsoft Win32
application programming interface (API). It discusses hook functions, filter
functions, and the following types of hooks:
o WH_CALLWNDPROC
o WH_CBT
o WH_DEBUG
o WH_FOREGROUNDIDLE
o WH_GETMESSAGE
o WH_JOURNALPLAYBACK
o WH_JOURNALRECORD
o WH_KEYBOARD
o WH_MOUSE
o WH_MSGFILTER
o WH_SHELL
o WH_SYSMSGFILTER
Terminology: In this article, the term Windows refers to the Windows family
of operating systems, that is, 16-bit Windows, Windows NT, and Windows for
Workgroups. Likewise, Windows 3.1 refers to the 3.1 version of these
operating systems.
=============================================================================
=============================================================================
****
**** The MMFILE technical article can be downloaded from the
**** file 14-3.zip in library section number 14
****
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 library section number 14
****
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 ONTHEFLY technical article can be downloaded from the
**** file 14-14.zip in library section number 14
****
Synchronization on the Fly
Ruediger Asche
Microsoft Development Technology Group
Created: September 15, 1993
Abstract
Following upon "Using Multithreading and C++ to Generate Live
Objects,"msdn_frogfly1 this article gives a live demonstration of what a
thorough concurrency analysis of a multithreaded application can look like.
Employing a semiformal approach, it discusses how to establish shared data
protection and demonstrates that the data encapsulation mechanisms in C++
greatly aid in providing this analysis.
=============================================================================
=============================================================================
****
**** The PEFILE technical article can be downloaded from the
**** file 14-15.zip in library section number 14
****
The Portable Executable File Format from Top to Bottom
Randy Kath
Microsoft Developer Network Technology Group
Created: June 12, 1993
Abstract
The Windows NT version 3.1 operating system introduces a new executable file
format called the Portable Executable (PE) file format. The Portable
Executable File Format specification, though rather vague, has been made
available to the public and is included on the Microsoft Developer Network CD
(Specs and Strategy, Specifications, Windows NT File Format Specifications).
Yet this specification alone does not provide enough information to make it
easy, or even reasonable, for developers to understand the PE file format.
This article is meant to address that problem. In it you'll find a thorough
explanation of the entire PE file format, along with descriptions of all the
necessary structures and source code examples that demonstrate how to use
this information.
All of the source code examples that appear in this article are taken from a
dynamic-link library (DLL) called PEFILE.DLL. I wrote this DLL simply for the
purpose of getting at the important information contained within a PE file.
The DLL and its source code are also included on this CD as part of the
PEFile sample application; feel free to use the DLL in your own applications.
Also, feel free to take the source code and build on it for any specific
purpose you may have. At the end of this article, you'll find a brief list of
the functions exported from the PEFILE.DLL and an explanation of how to use
them. I think you'll find these functions make understanding the PE file
format easier to cope with.
=============================================================================
=============================================================================
****
**** The PORTING technical article can be downloaded from the
**** file 14-2.zip in library section number 14
****
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 POSIX technical article can be downloaded from the
**** file 14-16.zip in library section number 14
****
Understanding Windows NT POSIX Compatibility
Ray Cort
Microsoft Corporate Technology Team
Created: May/June 1993
Abstract
This article will discuss the following topics:
o What is POSIX?
o Implementation in Windows NT
o Application conformance
o Verification and conformance
o Windows NT POSIX files
o Running POSIX applications
o Restrictions on POSIX applications
=============================================================================
=============================================================================
****
**** The REGMPAD technical article can be downloaded from the
**** file 14-17.zip in library section number 14
****
How to Use the Windows NT Registry in Your Application
Ron Murray
Microsoft Developer Relations Group
Created: October 1, 1993
Abstract
Microsoft Windows NT version 3.1 includes a configuration database known as
the Registry. Entries within the Registry database replace the profile data
in CONFIG.INI and other private .INI files. This article describes the
characteristics of the Registry and the access conventions you should follow
in your application code.
In particular, this article describes:
o How to set access control information on Registry keys.
o How to adjust the Registry when you install your application on a Windows
NT machine.
o How to connect to your Registry information when your application starts.
=============================================================================
=============================================================================
****
**** The STYLES32 technical article can be downloaded from the
**** file 14-18.zip in library section number 14
****
Win32 Window Hierarchy and Styles
Kyle Marsh
Microsoft Developer Network Technology Group
Created: September 29, 1993
Abstract
This article describes the desktop, top-level, and child windows provided in
the Win32 versions of the Microsoft Windows operating system and their
hierarchical relationships. It explains how applications can navigate the
window structure and control the style and appearance of a window on the
desktop.
=============================================================================
=============================================================================
****
**** The THREADS technical article can be downloaded from the
**** file 14-19.zip in library section number 14
****
Multithreading for Rookies
Ruediger R. Asche
Microsoft Developer Network Technology Group
Created: September 24, 1993
Abstract
One of the major functional enhancements of the Win32 application
programming interface (API) over the 16-bit Microsoft Windows API is the
introduction of multiple threads. Whereas Helen Custer's Inside Windows NT
(Microsoft Press, 1992) provides an excellent overview of the implementation
of threads as part of the system architecture of Windows NT, this article
focuses on some practical applications of multithreading. At the time the
article was written, the only implementation of the Win32 API that fully
supported the thread functionality was provided by Windows NT; thus, this
discussion focuses primarily on Windows NT, although multithreading as such
is more general and is applicable to future implementations of the Win32 API
as well.
This article is the first in a series that describes the Win32 API's
approach to multithreading. It covers the two simplest levels of
multithreading: unsynchronized multithreading and termination waiting. Future
articles will deal with synchronization mechanisms, multithreading in the
Win32 graphical subsystem, and practical applications of multithreading.
This article is fairly light reading. I suggest reading it before going to
bed, while flossing your teeth, or during the commercials in "Saturday Night
Live." It contains a number of code fragments that are meant to be conceptual
rather than segments to be cut and pasted into an existing application. I
deliberately did not implement full-fledged samples because I wanted to keep
everything as short and readable as possible. In certain parts I refer to
existing samples that you can use to study the real-life behavior of
multithreaded applications.
Also, I left out the error checking on most function calls in the code
fragments included here. In a real-life application, this is a cardinal sin
because an error condition that is not caught may seriously affect the
offending application or, in pathological cases, the entire system. You
should double-check that your application handles all possible error and
failure conditions. Although this seems like pretty trivial advice, keep in
mind that multiple threads can cause errors to occur intermittently (that is,
aproblem may occur only once in possibly many invocations of a multithreaded
application), or it might manifest itself in several ways, depending on the
interleaved sequence of statements executed in the multiple threads. Thus,
you benefit from any additional degree of stability you build into your
application.
=============================================================================
=============================================================================
****
**** The USER32 technical article can be downloaded from the
**** file 14-20.zip in library section number 14
****
The New U: What's New in USER32
Kyle Marsh
Microsoft Developer Network Technology Group
Created: September 29, 1993
Abstract
This article discusses some of the new features available in USER32, the
32-bit version of USER found in the 32-bit versions of the Microsoft Windows
operating system. Porting issues from Win16, asynchronous input queues,
thread-localized input states, single-instance applications, window classes,
and Windows hooks are among the topics discussed.
=============================================================================
=============================================================================
****
**** The VIRTMM technical article can be downloaded from the
**** file 14-4.zip in library section number 14
****
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 W32PENS technical article can be downloaded from the
**** file 14-21.zip in library section number 14
****
Pens in Win32
Dennis Crain
Microsoft Developer Network Technology Group
Created: September 6, 1993
Abstract
This article reviews the state of pens in Microsoft Windows version 3.x and
describes the improvements and features added to pens in Win32. In Win32,
pens are considered either cosmetic or geometric; the coordinate space in
which the width of a pen is specified distinguishes the two types. The width
of a cosmetic pen is specified in device units. With this version of Win32,
the width cannot be greater than a single device unit. The width of a
geometric pen is specified in logical units. Geometric pens also possess
attributes not available in Windows 3.x: They can have patterns or hatches;
they are scalable; and the end caps and joins can be specified by the user.
Geometric pens offer features not found in cosmetic pens, but cosmetic pens
draw faster. If speed is a consideration, cosmetic pens are a must. The
accompanying sample illustrates the use of pens in Win32.
=============================================================================
=============================================================================
****
**** The WIN32DLL technical article can be downloaded from the
**** file 14-1.zip in library section number 14
****
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.
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/