>DECLARE SHORT OpenPrinter IN Winspool.drv; > STRING @pPrinterName, INTEGER @phPrinter,; > STRING @pDefault >DECLARE SHORT ClosePrinter IN Winspool.drv; > INTEGER hPrinter >DECLARE SHORT GetPrinter IN Winspool.drv AS GetPrinterInfo; > INTEGER hPrinter, INTEGER Level,; > STRING @pPrinter, INTEGER cbBuf,; > INTEGER @pcbNeeded >lcprinter = 'LPT1:' >lnhandle = 0 >llresult = (OpenPrinter(@lcprinter, @lnhandle, 0) # 0) >IF llresult > lnsize = 0 > = GetPrinterInfo(lnhandle, 2, 0, 0, @lnsize) > lcstruct = REPLICATE(CHR(0), lnsize) > llresult = (GetPrinterInfo(lnhandle, 2, @lcstruct, lnsize, @lnsize) # 0) > IF llresult > lcstatus = SUBSTR(lcstruct, 73, 4) > lnstatus = 0 > FOR lni = 1 TO 4 > lnstatus = lnstatus + ASC(SUBSTR(lcstatus, lni, 1)) * (256 ^ (lni - 1)) > NEXT > ? lnstatus > ENDIF > = ClosePrinter(lnhandle) >ENDIF >* Printer status codes returned by Win95/98 >#define PRINTER_STATUS_PAUSED 0x00000001 >#define PRINTER_STATUS_ERROR 0x00000002 >#define PRINTER_STATUS_PENDING_DELETION 0x00000004 >#define PRINTER_STATUS_PAPER_JAM 0x00000008 >#define PRINTER_STATUS_PAPER_OUT 0x00000010 >#define PRINTER_STATUS_MANUAL_FEED 0x00000020 >#define PRINTER_STATUS_PAPER_PROBLEM 0x00000040 >#define PRINTER_STATUS_OFFLINE 0x00000080 >#define PRINTER_STATUS_IO_ACTIVE 0x00000100 >#define PRINTER_STATUS_BUSY 0x00000200 >#define PRINTER_STATUS_PRINTING 0x00000400 >#define PRINTER_STATUS_OUTPUT_BIN_FULL 0x00000800 >#define PRINTER_STATUS_NOT_AVAILABLE 0x00001000 >#define PRINTER_STATUS_WAITING 0x00002000 >#define PRINTER_STATUS_PROCESSING 0x00004000 >#define PRINTER_STATUS_INITIALIZING 0x00008000 >#define PRINTER_STATUS_WARMING_UP 0x00010000 >#define PRINTER_STATUS_TONER_LOW 0x00020000 >#define PRINTER_STATUS_NO_TONER 0x00040000 >#define PRINTER_STATUS_PAGE_PUNT 0x00080000 >#define PRINTER_STATUS_USER_INTERVENTION 0x00100000 >#define PRINTER_STATUS_OUT_OF_MEMORY 0x00200000 >#define PRINTER_STATUS_DOOR_OPEN 0x00400000 >#define PRINTER_STATUS_SERVER_UNKNOWN 0x00800000 >#define PRINTER_STATUS_POWER_SAVE 0x01000000>hth,