473,583 Members | 3,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

printer job monitoring problem

hi,

i have written a printer job monitoring program as the code shown below , a
timer is used to call this function every second . i have a network printer
tat attached to my pc. i facing a problems that some time the program can
detect the print job but some how most of the time it cant detect any printer
job while actually the printing some documents .
any one has facing this problem before ? or any suggestion for me.
(i find out that most of the time when i print document from the internet
explorer , my program cant detect any print job)
beside using WMI , what others methods i can use to detect the print job ?

public void GetPrintJobsCol lection()
{
string f_SearchQuery = "SELECT * FROM Win32_PrintJob" ;
ManagementObjec tSearcher f_SearchPrintJo bs =
new ManagementObjec tSearcher(f_Sea rchQuery);
ManagementObjec tCollection f_PrntJobCollec tion = f_SearchPrintJo bs.Get();
foreach(Managem entObject f_PrntJob in f_PrntJobCollec tion)
{
MessageBox.Show ("Your Document(s) are Printing now") ;
m_JobID = f_PrntJob.Prope rties["JobId"].Value.ToString () ;
m_DocName = f_PrntJob.Prope rties["Document"].Value.ToString () ;
m_TotalPages = f_PrntJob.Prope rties["TotalPages "].Value.ToString () ;
m_PrinterQueue[m_PrintQCount] = m_JobID ;
if (Convert.ToDoub le (m_TotalPages) <= 0)
m_TotalPages = "1" ;
DeductPrintingV alue (Convert.ToInt1 6(m_TotalPages) ) ;
}
Nov 17 '05 #1
0 1662

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1131
by: Dan | last post by:
Does .NET provide any way to implement printer monitoring (similar to FindFirstPrinterNotification), or is it necessary to call the API?
0
3639
by: James Griffiths | last post by:
Here is a report I've written about a printing problem that is being experienced by a particular company for whom I had developed a A97 system. After upgrading to Win XP and AXP, some printing problems have arisen. My investigations show that it is not related to the particular system I developed. but is affecting Access in general. So, has...
3
10036
by: Gordon Truslove | last post by:
I've been trying to get the printer status using GetPrinter and Printer_Info_2 I'm getting closer, but it still fails. Error 122 - The data area passed to a system call is too small. --------------------------------------------------------------- public struct PRINTERINFO2
1
4266
by: Mortel | last post by:
Hi, How I can get information from printer about count of copy pages, who's print pages etc. I want monitoring printers and save that information to file log. Maybe printer has any events to do that ? Thank's for all. Boniek
4
8674
by: sengkok | last post by:
hi, i have written a small print job monitoring program which can monitor the job ID and total pages printed . i am facing on strange problem which is the total print pages is always equal to 1 , not matter how many pages i have printing . anyone have facing the same issue ? and any solution on this issue ? the code i written as bellow ...
0
2080
by: Jeff Reed | last post by:
I am experiencing the the problem outlined the below. Unfortunately, I am using WinXP and I not sure if I can apply the solution due to lack of security control Any feed back would be apreciated http://support.microsoft.com/default.aspx?scid=kb;EN-US;31795 FIX: "Failed to Start Monitoring Directory Changes" Error Message When You Browse...
9
3193
by: Tim D | last post by:
Hi, I originally posted this as a reply to a rather old thread in dotnet.framework.general and didn't get any response. I thought it might be more relevant here; anyone got any ideas? My questions are below... "David Good" wrote: > We have a network running both Win2k and Win2k3 webservers and our web sites > reside on a UNC network...
3
5106
by: Olaf Rabbachin | last post by:
Hi folks, during printing, I'm constantly checking the printer-spooler to monitor whether a document has showed up in a printer's spooler and - after it has - whether the print-job has been finished. I'm using the following code for that: --- 8< --- Imports System.Management
14
531
by: werdna.sivad | last post by:
I need to develop some software that will step in between a computer and it's printer. The software should read from one LPT port (connected to printing computer) and then redirect that traffic out a second LPT port (connected to printer). It will do stuff to the data as it goes by. Can you give me any direction on what is needed to...
0
7894
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7821
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6577
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5697
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5370
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3841
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1152
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.