请教各位大虾,在VB中怎样获取到打印机的状态(比如:打印机是否开着、打印是否成功)?
分不够可以加!

解决方案 »

  1.   

    如果想得到各打印作业的状态,通常我们可以通过调用以下API:   OpenPrinter   GetPrinter   EnumJobs   ClosePrinter   目前在微软的网站上没有现成的关于以上API调用的VB代码,但有一篇VC的示例代码,您可以参考一下:   HOWTO: Get the Status of a Printer and a Print Job
       (http://support.microsoft.com/support/kb/articles/Q160/1/29.asp)   另外,您还可以试一下ADSI中的IADsPrintQueueOperations和IADsPrintJobOperations接口。具体信息您可以参考以下文档:   http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netdir/adsi/iadsprintjoboperations.asp?frame=true   它需要Win2000及以后版本或装了Active Directory Client Extension的WinNT 4.0sp6a/Win95/98/Me来运行。关于Active Directory Client Extension的安装信息,您可以参考以下文档:   http://www.microsoft.com/windows2000/server/evaluation/news/bulletins/adextension.asp 
      

  2.   

    http://www.china-askpro.com/msg9/qa81.shtml