My Question is not directly related to madCodeHook, but came from its usage
Madshi in your print monitor demo you are getting the name of the printer from the CreateDC call. Now this works fine, but the problem is when you try to monitor the printing and count pages. There is a lot of CreateDC calls in the system. Although they can be filtered almost 100% some can stil come through.
But bigger problem is that Excel for example wraps multiple copies of one printjob inside CreateDC, DeleteDC block.
So idealy the jobs could be monitored by just watching for StartDoc and then either AbortDoc or EndDoc. (now I am watching for DeleteDC but that is a lot of traffic for little effect).
The question is: is there any way I can get Printer name or Printer Handle from DC handle. Probably not, but maybe somebody knows a way, or some workaround to this problem.
I am listening