JNA API 3.5.1
com.sun.jna.platform.win32

Interface Winspool

    • Method Detail

      • EnumPrinters

        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.
        Parameters:
        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.
        Returns:
        If the function succeeds, the return value is a nonzero value. If the function fails, the return value is zero.
JNA API 3.5.1

Copyright © 2007-2012 Timothy Wall. All Rights Reserved.