![]() |
How to capture Windows NT Printer Data Stream?Jan 29, 1997 This information is provided "as is", there is no support or guarantee from this WEB site! |
||
| There are two places that
you can trap your Windows NT Printer Data Stream. It
depends on how you want to trap it. To trap it
programmatically follow step 2, to trap it manually
follow step 1. Step1. To trap your Windows NT Printer Data Stream manually: For Windows NT 3.51 or lower: Go to your control panel, select your print manager, go to your default printer, double click your default printer then its property's dialog box will pop up in front of you. Switch your printer output port to File if it is not yet selected. For Windows NT 4.00 or higher: Go to Start then to Setting and to Printers Folder, double click your default printer (the printer property's dialog box will pop up in front of you). From the Printer menu, select property, Select Ports tab. Switch your printer output port to File if it is not yet selected.. NOTE: You will be required to type an output file each time you print something to your printer. Step2. To trap your Windows NT Printer Data Stream programmatically: Whether you have Windows NT 3.51 or 4.0 or higher, the procedures to capture the data stream are the same. If you want to avoid supplying a file name to an-output-file dialog box each time you print something, you will want to modify the Microsoft Localmon sample code. This can be found in your C:\DDK\SRC\PRINT\LOCALMON directory. In the Localmon source, the print-to-file, print-to-COM ports, and print-to-Parallel ports are handled by this single DLL. You will want to go through this source code and find out where the print-to-file dialog box is located, you will want to disable it by writing a program to direct the output file to your desired file name. Note: Windows NT 3.51 localmon seemed to be broken, the one that came with the DDK 3.50 works fine. What if I want to strip something off my Printer Data Stream and save it to a file? Then you will want to modify your WINPRINT.DLL. Microsoft also supplies the source code for this DLL. Winprint is another name, it is called "Print Processor". Its source code can be found under your C:\DDK\SRC\PRINT\WINPRINT. Open up a file RAW.C. This is where the Data Stream from a spooler being passed to your print processor:
|