Discussion Locked

VB6 and Printers??????????

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I want to launch my program every time windows prints to any printer installed on a computer. I think there must be a way of intersepting a call from Windows to a printer. Does anybody know how to do this? Any comments are welcome.
Thanks,
Victor

8 replies

by glen_mcleod

There isn't a quick answer to this question.

First you have to find an API call that will listen for this event (I don't know of one from memory), then you have to compile it as a systray app that starts on load. Thing is, if people don't want the app running on their system, it's fairly easy to shut down.

Glen

by rrv

Write a separate program which will enumerate all the printers in local PC. get active printer in that list. if anyone gets active shell your program. Put this program in runonce in Registry so it starts as soon as PC starts. I have mentioned the APIs in this description itself. If you could not post a message i shall help you out.
RV

by rrv

Clear Explanation=>Get all printer names in a PC and their handles. Get Active Printer handle. using GetProcessTimes find if that printer is currently used. If being used, call your program by using Shell in VB and that is it.

This discussion is closed to new replies.