The EnumMonitors function initializes an array of structures with data describing the monitors for the specified server.
BOOL EnumMonitors(
LPTSTR pName, // pointer to server name
DWORD Level, // structure level
LPBYTE pMonitors, // pointer to structure array
DWORD cbBuf, // size, in bytes, of buffer
LPDWORD pcbNeeded, // addr. of variable with no. of bytes copied
// (or required)
LPDWORD pcReturned // addr. of variable with no. of job info.
// structures copied
);
Windows NT: This value can be 1 or 2.
Windows 95, Windows 98: This value must be 1.
Windows NT: The buffer receives an array of MONITOR_INFO_1 structures if Level is 1, or MONITOR_INFO_2 structures if Level is 2.
Windows 95, Windows 98: The buffer receives an array of MONITOR_INFO_1 structures if Level is 1.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winspool.h.
Import Library: Use winspool.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Printing and Print Spooler Overview, Printing and Print Spooler Functions, MONITOR_INFO_1, MONITOR_INFO_2