overview.hlp (Table of Contents; Topic list)
Using Device Monitors (1.2)
About Section  Function Group                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
                           Using Device Monitors
 
A program creates a device monitor for a given device by using the
DosMonOpen function. The program does not receive input from the device
until it uses the DosMonReg function to register the input and output
buffers to be used with the monitor. These buffers are structures into which
MS OS/2 copies the input or reads the output. The format of the structures
depends on the device. Typically, a program retrieves the correct size of
the input and output buffers by trying to register the buffers with an
incorrect size. The DosMonReg function copies the correct size to the first
field in each structure.
 
Once a monitor is registered, a program can retrieve input from the device
by using the DosMonRead function. It can modify this information and then
pass it on by using the DosMonWrite function. If the program does not pass
the information on by using the DosMonWrite function, that information is
lost.
 
You can discontinue input monitoring by using the DosMonClose function.
 
 
                                      ♦