BOOL OpenPrinter(
LPTSTR pPrinterName, // printer or server name
LPHANDLE phPrinter, // printer or server handle
LPPRINTER_DEFAULTS pDefault // printer defaults
);
Parameters
pPrinterName
[in] Pointer to a null-terminated string that specifies the name of the printer or print server.
Windows NT/2000: If NULL, it indicates the local printer server.
phPrinter
[out] Pointer to a variable that receives the handle identifying the opened printer or print server object.
Windows 2000: The phPrinter parameter can return an Xcv handle for use with the XcvData function. For more information about XcvData, see the Microsoft Windows 2000 Driver Development Kit.
pDefault
[in] Pointer to a PRINTER_DEFAULTS structure. This value can be NULL.