F
Frank Rizzo
I have a USB printer connected to my PC. My winform app prints out some
text using the typical print methods that are normally used. I will
then turn off the printer or disconnect the USB cable. My application
still prints fine and reports no error. Of course, then windows pops up
a balloon from the system tray alerting me that the printing failed.
The print job just sits in the printer's print queue, until I reconnect
the printer and then it prints.
My questions is two fold:
1. How can I detect before printing whether the USB printer is connected?
2. How can I hook into the alert that Windows pops, so that my app
knows if the print failed? Of course, I just want alerts for the print
jobs I submit.
The interesting thing is that if I print to a network printer that is
disconnected, print methods do throw exceptions immediately.
Thanks
text using the typical print methods that are normally used. I will
then turn off the printer or disconnect the USB cable. My application
still prints fine and reports no error. Of course, then windows pops up
a balloon from the system tray alerting me that the printing failed.
The print job just sits in the printer's print queue, until I reconnect
the printer and then it prints.
My questions is two fold:
1. How can I detect before printing whether the USB printer is connected?
2. How can I hook into the alert that Windows pops, so that my app
knows if the print failed? Of course, I just want alerts for the print
jobs I submit.
The interesting thing is that if I print to a network printer that is
disconnected, print methods do throw exceptions immediately.
Thanks