0

I want to create a program in java which counts the number of prints taken from a printer...What I was trying to do is, When i give a print command through an application such as MS word, my printer starts a particular process...

Is there a method to recognize when that process is initiated?... (provided i am currently running the Java program).. so that i can just increment a counter whenever that print process is initiated, and hence i might be able to keep a track of pages printed.

masterk63
  • 17
  • 6

1 Answers1

0

You can write a infinitely running thread and monitor for the process you are looking for, and increment the counter when you see it.

Refer this question to get the code to monitor active process.

Community
  • 1
  • 1
kamoor
  • 2,769
  • 2
  • 16
  • 32