GetPrinter The GetPrinter function retrieves information about a specified printer. BOOL GetPrinter( HANDLE hPrinter, // handle to printer DWORD Level, // information level LPBYTE pPrinter, // printer information buffer DWORD cbBuf, // size of buffer LPDWORD pcbNeeded // bytes received or required ); Return Values If the function succeeds, the return value is a nonzero value.If the function fails, the return value is zero. To get extended error information, call GetLastError.
BOOL EnumPrintProcessors( LPTSTR pName, // print server name LPTSTR pEnvironment, // environment name DWORD Level, // information level LPBYTE pPrintProcessorInfo, // processor data buffer DWORD cbBuf, // size of data buffer LPDWORD pcbNeeded, // bytes received or required LPDWORD pcReturned // number of processors ); The EnumPrintProcessors function enumerates the print processors installed on the specified server. 可以利用此函数搜索打印机,而AddPrinter可以安装打印机。
The GetPrinter function retrieves information about a specified printer. BOOL GetPrinter(
HANDLE hPrinter, // handle to printer
DWORD Level, // information level
LPBYTE pPrinter, // printer information buffer
DWORD cbBuf, // size of buffer
LPDWORD pcbNeeded // bytes received or required
);
Return Values
If the function succeeds, the return value is a nonzero value.If the function fails, the return value is zero. To get extended error information, call GetLastError.
LPTSTR pName, // print server name
LPTSTR pEnvironment, // environment name
DWORD Level, // information level
LPBYTE pPrintProcessorInfo, // processor data buffer
DWORD cbBuf, // size of data buffer
LPDWORD pcbNeeded, // bytes received or required
LPDWORD pcReturned // number of processors
);
The EnumPrintProcessors function enumerates the print processors installed on the specified server.
可以利用此函数搜索打印机,而AddPrinter可以安装打印机。