Article View: borland.public.cppbuilder.nativeapi
Article #4315Printer notification
From: Bogdan
Date: Fri, 10 Feb 2006 18:08
Date: Fri, 10 Feb 2006 18:08
49 lines
2115 bytes
2115 bytes
I'm trying to monitor the printer and log each succesfully printed job, but
I
cannot make a difference between a job that is deleted before printing
because
the user chose to abort the print operation, and the job that is deleted
from
the spooler because it finished printing.
Is there a way to differentiate between the two situations?
I'm using the following piece of code :
void __fastcall TPrinterMonitor::Execute()
{
while(!Terminated)
{
WaitForSingleObject(Notifier,INFINITE);
Changes = 0x00000000;
if(FindNextPrinterChangeNotification(Notifier,&Changes,NULL,NULL))
{
if(Changes & PRINTER_CHANGE_ADD_JOB)
{
Line = "Job added";
Synchronize(Update);
};
if(Changes & PRINTER_CHANGE_DELETE_JOB)
{
Line = "Job deleted";
Synchronize(Update);
};
if(Changes & PRINTER_CHANGE_SET_JOB)
{
Line = "Job set";
Synchronize(Update);
};
if(Changes & PRINTER_CHANGE_WRITE_JOB)
{
Line = "Job write";
Synchronize(Update);
};
};
};
FindClosePrinterChangeNotification(Notifier);
};
Bogdan
Technical Details
Message-ID:
<43ecd5bb@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!colt.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2eb2d0dc0d96a498,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Bogdan" <boprea@xnet.ro> From: "Bogdan" <boprea@xnet.ro> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Printer notification Date: Fri, 10 Feb 2006 20:08:27 +0200 Lines: 51 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 85.186.237.190 Message-ID: <43ecd5bb@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1139594683 85.186.237.190 (10 Feb 2006 10:04:43 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!colt.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail