打印机状态(50分)

  • 主题发起人 主题发起人 bigxiong
  • 开始时间 开始时间
B

bigxiong

Unregistered / Unconfirmed
GUEST, unregistred user!
Win98用的是后台打印,我怎样才能知道打印机的打印状态,即是否打印
 
Tprinter
ndicates whether a print job is printing.
property Printing: Boolean;
Description
Use Printing to determine if a job is printing.
Printing is True when the application has called the begin
Doc method but the EndDoc method (or the Abort method) hasn't yet been called.
 
function TestPrinterStatus(LPTPort: word): byte;
var
Status: byte;
CheckLPT: word;
begin

Status := 0;
if (LPTPort >= 1) and (LPTPort <= 3) then

begin

CheckLPT := LPTPort -1;
asm
mov dx, CheckLPT;
mov al, 0;
mov ah, 2;
int 17h;
mov &amp;Status, ah;
end;

end;

Result := Status;
end;

参数时打印机端口,返回值如下:
01h - Timeout
08h - I/O Error
10h - Printer selected
20h - Out of paper
40h - Printer acknowledgement
80h - Printer not busy (0 if busy)
你试一试,差不多!
 
win2000无法编译
 
后退
顶部