A while back, I was bidding on RentACoder for a job that involved printing from a command line application, using just the default printer. I bid way too high ($75 - let that be a lesson), but also created an entire application by way of a demonstration. I figure I can make it a bit more flexible, and sell it on, anyway.
Another byproduct of this process was that I learned a lot about Windows Printer programming. In fact, I didn't really know a whole lot before I started, and now I know just a little more. I thought I'd share the technique that I used in the demo, by writing an article about it.
The article covers the use of:
These are the functions that you will need to manage the printer. In addition, we touch on:
These are used to plan the print job, and actually dump out the text. It's well worth the little lesson, if you ever want to print quickly and easily, without resorting to PrintDlg.
You can find the entire article here : Win32 Default Printer Printing Sample
Any questions, start a discussion, or drop me an email.
Happy coding!