以下是msdn,第一个参数为NULL时,第二个参数会返回一个handle,这个handle是干嘛用的呢?怎么用?着急。。求教育
就剩下25分
BOOL OpenPrinter(
LPTSTR pPrinterName, // printer or server name
LPHANDLE phPrinter, // printer or server handle
LPPRINTER_DEFAULTS pDefault // printer defaults
);
pPrinterName
[in] Pointer to a null-terminated string that specifies the name of the printer or print server, the printer object, the XcvMonitor, or the XcvPort.
For a printer object use: PrinterName,Job xxxx. For an XcvMonitor, use: ServerName,XcvMonitor MonitorName. For an XcvPort, use: ServerName,XcvPort PortName.
Windows NT/2000/XP: If NULL, it indicates the local printer server.
phPrinter
[out] Pointer to a variable that receives a handle to the open printer or print server object.
Windows 2000/XP: 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.