I've written my own unidirectional port monitor for both win9x- and NT-based platforms. It works perfectly on win98, but I have an idiot problem with the NT version.
The port works well, does perfectly what it has to do, but after enddocport function call (i.e. after finishing the printing) the jobs still remain in the printer queue having "sent to printer" status on XP or "printed" status on NT4SP6. (all pages are printed and all bytes are sent).
The job normally has to disappear from printer queue unless "keep printed documents" is checked, hasn't it?!.
More, on system restart, all jobs remained in queued are sent to printer (i.e. print monitor) again! More more, even I delete all of these jobs from queue, they still reappear and are sent to printer again at the next system restart. Has anybody a logical explanation and/or a workaround for this?