2025年10月10日 星期五  乙巳年 八月十九 【蛇】乙酉月 壬子日
用户名: 密 码: 保存
您现在的位置:首页 >> 硬件系统 >> 硬件系统 >> 内容

Delphi中检测打印机状态

时间:2011/9/3 15:19:00 点击: 1498

  核心提示:function TestPrinterStatus(LPTPort: Word): Byte; var Status: byte; CheckLPT: word; begin Status := 0...
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 &Status, ah; 
    end; 
  end; 
  Result := Status; 
end;

{ 
  Pass in the LPT port number you want to check & get the following back: 
  01h - Timeout 
  08h - I/O Error 
  10h - Printer selected 
  20h - Out of paper 
  40h - Printer acknowledgement 
  80h - Printer not busy (0 if busy) 
  Note: 
  This 
function doesn't work under NT, it gives an access violation 
  from the DOS interrupt call. 
} 

作者:网络 来源:转载
惊讶 欠揍 支持 很棒 愤怒 搞笑 恶心 不解
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
本类推荐
  • 没有
本类固顶
  • 没有
  • 盒子文章 技术支持:深圳市麟瑞科技有限公司(www.2ccc.com) © 2025 版权所有 All Rights Reserved.
  • 粤ICP备10103342号-1