码迷,mamicode.com
首页 > 其他好文 > 详细

通过消息获取 打印任务数量

时间:2014-12-22 12:30:24      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:

http://www.scalabium.com/faq/dct0047.htm

 

D2007下未测试成功。

If you need detect how many jobs are in the MS Windows print spooler, then you must handle a WM_SPOOLERSTATUS message. When job is added or deleted in the spooler querue, this message will be broadcast.
So you must create a message handler for this message trapping:

type
  TyourForm = class(TForm)
  private
    { Private declarations }
    procedure WMSpoolerStatus(var Msg: TWMSpoolerStatus);
      message WM_SPOOLERSTATUS;
  public
    { Public declarations }
  end;

implementation

{$R *.DFM}

procedure TyourForm.WMSpoolerStatus(var Msg: TWMSpoolerStatus);
begin
  ShowMessage(‘Now in the spooler a ‘ + IntToStr(msg.JobsLeft) + ‘ jobs‘;
  msg.Result := 0;
end;



通过消息获取 打印任务数量

标签:

原文地址:http://www.cnblogs.com/CodeGear/p/4177721.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!