public interface Winspool extends StdCallLibrary
Modifier and Type | Interface and Description |
---|---|
static class |
Winspool.PRINTER_INFO_1 |
static class |
Winspool.PRINTER_INFO_4 |
StdCallLibrary.StdCallCallback
Library.Handler
Modifier and Type | Field and Description |
---|---|
static Winspool |
INSTANCE |
static int |
PRINTER_ENUM_CONNECTIONS |
static int |
PRINTER_ENUM_CONTAINER |
static int |
PRINTER_ENUM_DEFAULT |
static int |
PRINTER_ENUM_EXPAND |
static int |
PRINTER_ENUM_FAVORITE |
static int |
PRINTER_ENUM_HIDE |
static int |
PRINTER_ENUM_ICON1 |
static int |
PRINTER_ENUM_ICON2 |
static int |
PRINTER_ENUM_ICON3 |
static int |
PRINTER_ENUM_ICON4 |
static int |
PRINTER_ENUM_ICON5 |
static int |
PRINTER_ENUM_ICON6 |
static int |
PRINTER_ENUM_ICON7 |
static int |
PRINTER_ENUM_ICON8 |
static int |
PRINTER_ENUM_ICONMASK |
static int |
PRINTER_ENUM_LOCAL |
static int |
PRINTER_ENUM_NAME |
static int |
PRINTER_ENUM_NETWORK |
static int |
PRINTER_ENUM_REMOTE |
static int |
PRINTER_ENUM_SHARED |
FUNCTION_MAPPER, STDCALL_CONVENTION
OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER
Modifier and Type | Method and Description |
---|---|
boolean |
EnumPrinters(int Flags,
String Name,
int Level,
Pointer pPrinterEnum,
int cbBuf,
IntByReference pcbNeeded,
IntByReference pcReturned)
The EnumPrinters function enumerates available printers, print servers, domains, or print providers.
|
static final Winspool INSTANCE
static final int PRINTER_ENUM_DEFAULT
static final int PRINTER_ENUM_LOCAL
static final int PRINTER_ENUM_CONNECTIONS
static final int PRINTER_ENUM_FAVORITE
static final int PRINTER_ENUM_NAME
static final int PRINTER_ENUM_REMOTE
static final int PRINTER_ENUM_SHARED
static final int PRINTER_ENUM_NETWORK
static final int PRINTER_ENUM_EXPAND
static final int PRINTER_ENUM_CONTAINER
static final int PRINTER_ENUM_ICONMASK
static final int PRINTER_ENUM_ICON1
static final int PRINTER_ENUM_ICON2
static final int PRINTER_ENUM_ICON3
static final int PRINTER_ENUM_ICON4
static final int PRINTER_ENUM_ICON5
static final int PRINTER_ENUM_ICON6
static final int PRINTER_ENUM_ICON7
static final int PRINTER_ENUM_ICON8
static final int PRINTER_ENUM_HIDE
boolean EnumPrinters(int Flags, String Name, int Level, Pointer pPrinterEnum, int cbBuf, IntByReference pcbNeeded, IntByReference pcReturned)
Flags
- The types of print objects that the function should enumerate.Name
- If Level is 1, Flags contains PRINTER_ENUM_NAME, and Name is non-NULL, then Name is a pointer
to a null-terminated string that specifies the name of the object to enumerate. This string can
be the name of a server, a domain, or a print provider.
If Level is 1, Flags contains PRINTER_ENUM_NAME, and Name is NULL, then the function enumerates
the available print providers.
If Level is 1, Flags contains PRINTER_ENUM_REMOTE, and Name is NULL, then the function enumerates
the printers in the user's domain.
If Level is 2 or 5,Name is a pointer to a null-terminated string that specifies the name of a
server whose printers are to be enumerated. If this string is NULL, then the function enumerates
the printers installed on the local computer.
If Level is 4, Name should be NULL. The function always queries on the local computer.
When Name is NULL, setting Flags to PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS enumerates
printers that are installed on the local machine. These printers include those that are physically
attached to the local machine as well as remote printers to which it has a network connection.
When Name is not NULL, setting Flags to PRINTER_ENUM_LOCAL | PRINTER_ENUM_NAME enumerates the
local printers that are installed on the server Name.Level
- The type of data structures pointed to by pPrinterEnum. Valid values are 1, 2, 4, and 5, which
correspond to the PRINTER_INFO_1, PRINTER_INFO_2 , PRINTER_INFO_4, and PRINTER_INFO_5 data
structures.pPrinterEnum
- A pointer to a buffer that receives an array of PRINTER_INFO_1, PRINTER_INFO_2, PRINTER_INFO_4,
or PRINTER_INFO_5 structures. Each structure contains data that describes an available print
object.
If Level is 1, the array contains PRINTER_INFO_1 structures. If Level is 2, the array contains
PRINTER_INFO_2 structures. If Level is 4, the array contains PRINTER_INFO_4 structures. If Level
is 5, the array contains PRINTER_INFO_5 structures.
The buffer must be large enough to receive the array of data structures and any strings or other
data to which the structure members point. If the buffer is too small, the pcbNeeded parameter
returns the required buffer size.cbBuf
- The size, in bytes, of the buffer pointed to by pPrinterEnum.pcbNeeded
- A pointer to a value that receives the number of bytes copied if the function succeeds or the
number of bytes required if cbBuf is too small.pcReturned
- A pointer to a value that receives the number of PRINTER_INFO_1, PRINTER_INFO_2 , PRINTER_INFO_4,
or PRINTER_INFO_5 structures that the function returns in the array to which pPrinterEnum points.