I have an application that has to print a line at a time to a dot-matrix
printer, as a security log.
The application thus needs to have exclusive access to the printer, and the
problem is that
the Windows print spooler, if it knows about the printer, also tries to
obtain exclusive access
to the printer. On Windows 2000 we just didn't set up a local printer.
On XP, however, every time the system starts up, at the first logon, Windows
autodetects
the printer & sets up a local printer for it.
Is it possible to disable automatic printer detection?
Alternately, is there a way to print a line at a time that's compatible with
the spooler
service that (a) does NOT eject a page after each enddoc call, and (b)
doesn't
create a spool file for each little one-line print job (these can happen up
to several times
a second, so it's best not to brutalize the disk unnecessarily). Right now
we're just
opening "LPT1", but if there's another way, I'd like to hear about it.
Thanks,
Brian Knittel