1.BOOL OpenPrinter(<br><br> LPTSTR pPrinterName, // pointer to printer or server name <br> LPHANDLE phPrinter, // pointer to printer or server handle <br> LPPRINTER_DEFAULTS pDefault // pointer to printer defaults structure <br>  
; <br> 得到打印机句饼;<br>2.BOOL GetPrinter(<br>HANDLE hPrinter,// handle to printer of interest <br>DWORD Level, // version of printer info data structure <br>//此处Level=2 <br>LPBYTE pPrinter,// pointer to array of bytes that receives printer info. structure <br>DWORD cbBuf, // size, in bytes, of array of bytes <br>LPDWORD pcbNeeded // pointer to variable with count of bytes retrieved (or required) <br>  
; <br> 得到结构 pPrinter,可得到属性DWORD<br>3.<br>BOOL EnumPrinters(<br>DWORD Flags, // types of printer objects to enumerate<br>LPTSTR Name, // name of printer object<br>DWORD Level, // specifies type of printer info structure<br>LPBYTE pPrinterEnum,// pointer to buffer to receive printer info structures<br>DWORD cbBuf, // size, in bytes, of array<br>LPDWORD pcbNeeded,// pointer to variable with no. of bytes copied (or required)<br>LPDWORD pcReturned // pointer to variable with no. of printer info. structures copied<br>  
;