dos12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DosMonReg (1.2)
Function Group  Overview  Changes               Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSMONITORS
 
USHORT DosMonReg(hmon, pbInBuf, pbOutBuf, fPosition, usIndex)
HMONITOR hmon;       /* monitor handle to register             */
PBYTE pbInBuf;       /* pointer to structure for input buffer  */
PBYTE pbOutBuf;      /* pointer to structure for output buffer */
USHORT fPosition;    /* position flag                          */
USHORT usIndex;      /* index                                  */
 
The DosMonReg function registers a monitor by placing it in a chain of other
monitors for the same device. Each monitor receives input from or sends
output to the device in the order in which it appears in the chain.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hmon       Identifies the monitor to register. This handle must have been
           created previously by using the DosMonOpen function.
 
pbInBuf    Points to the MONIN structure that receives data from the device
           driver or from the previous monitor in the chain.
 
pbOutBuf   Points to the MONOUT structure that receives data for the next
           monitor in the chain.
 
fPosition  Specifies the position of the monitor in the chain of input and
           output. This parameter can be one of the following values:
 
           Value            Meaning
           ─────────────────────────────────────────────────────────────────
           MONITOR_BEGIN    Place the monitor at the beginning of the chain,
                            ahead of any other monitors in the chain.
 
           MONITOR_DEFAULT  Place the monitor anywhere in the chain.
 
           MONITOR_END      Place the monitor at the end of the chain.
 
           Any of the fPosition values can be combined with MONITOR_SPECIAL
           by using the OR operator to allow the monitor to continue to
           receive data even if the device is disabled or another monitor
           further down the chain is blocked. If the MONITOR_SPECIAL
           constant is not set, no monitors will receive input when the
           device driver is disabled or any monitor is blocked.
 
usIndex    Specifies a device-specific value. If the device is the keyboard,
           usIndex specifies the ID for the screen group to monitor. If no
           screen-group number is available (the monitor is detached), the
           ID of the current foreground screen group can be obtained by
           calling DosGetInfoSeg. (The current foreground screen group is
           the group that most recently called KbdCharIn.)
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
 
     ERROR_MON_BUFFER_TOO_SMALL
     ERROR_MON_INVALID_HANDLE
     ERROR_MON_INVALID_PARMS
     ERROR_NOT_ENOUGH_MEMORY
 
Comments
 
The MONIN and MONOUT structures must be in the same segment.
 
See Also
 
DosGetInfoSeg, DosMonClose, DosMonOpen, DosMonRead, DosMonWrite, KbdCharIn,
MONIN, MONOUT