Set Default Printer (SDP) version 2.0  Documentation
(original documentation by Ed. Brophy modified by P. Peccatte)
--------------------------------------------------------------

What is it?

  SDP is a command line utility for setting printer/output-device 
  properties to be used under Windows 95, 98.  It will not run 
  under Windows 3.1 and NT.

Why did I make it?

  I had to make print outs every morning automatically using task scheduling 
  software using NotePad & WordPad using the little know /p command line 
  option.  (aside:  NotepPad /p SDP.TXT automatically loads, prints, and 
  closes this doc.)  However, if someone sent a fax or something the previous
  day, the print outs would go to the fax instead of the printer.  I needed
  A utility that would make the printer the default output every morning.  
  I created SDP and I set my scheduling software to run it before the morning
  print outs and... guess what?  No more problems.

How do you use it?

  The basic usage is:  SDP.EXE <INI file (without the suffix .INI)>
  
  The INI file, which needs to be in the same directory as the SDP
  program, must contain a parameter PrinterName in a section [printer].
  The PrinterName is all or part of the printer's name and/or port and SDP will
  select the first device that it matches.  The printer description is 
  CASE SENSITIVE!  Epson is not the same as EPSON to SDP.  You should run 
  SDP without parameters to see the case used.  Also do no use quotes or 
  these < > on the command line, just what it asks for.  

  The section [printer] can contain another parameter Default.
  Default=1 does the specified printer as the default printer.

  Example: The File OKI.INI begins with the lines:
  
  [printer]
  PrinterName=Okidata
  Default=1
 
  Running SDP.EXE OKI makes the first printer called Okidata as the default printer.

  Running SDP without parameters gives you the help screen that shows which 
  printers are installed (i.e. selectable) and their complete, case sensitive 
  description.  It displays the printer's name and port separated by a comma.
  You can enter this entire description as shown or any part of it.
  
  SDP can be run from a DOS window, a DOS batch file, the Run command on the
  Start Menu or you can create a shortcut with the <printer description> 
  after the program's name.  From a DOS batch file, it's a good idea to use 
  the START command with the /w wait option.

  Example:  START /W SDP.EXE Epson

  This will cause the DOS batch file to wait until SDP is done setting the
  default printer before continuing with the next command.

  If SDP finds the printer used in the <INI file> it does the 
  setting and displays a Success message for a default time of 5 seconds, 
  closing itself afterwards.  This default time can be changed by editing 
  the INI file.  It can even be set to not display a window!  If the printer 
  could not be found, the printer was found and the setting failed, or 
  if there was no parameters, SDP does not automatically close itself.
  To create a SDP.INI file, you only need two lines in the INI file:

  [delay]
  timeout=5
 
  The timeout setting is measured in seconds.  Setting the timeout=0 
  keeps the Success window from being displayed.
  
  The third section [settings] in the INI file allows to set different properties of the printer.
  For example:

		[settings]
		PortName=\\QEDNT\MyPrinter
		DriverName=Apple LaserWriter Pro 630
		Comment=This is my current printer
		Orientation=Landscape
		Copies=2
		PaperSize=A4

  Allowed parameters in the section [settings] are:

		Portname=<the port name>
		DriverName=<the name of the driver>
		Comment=<a comment>
		Orientation= PORTRAIT | LANDSCAPE
		Copies=<#copies>
		Scale=<#scale>
		PaperSize=<complete list below>
                DefaultSource=<complete list below>
		MediaType= STANDARD | GLOSSY | TRANSPARENCY
		PrintQuality= HIGH | MEDIUM | LOW | DRAFT 
		Duplex= SIMPLEX | HORIZONTAL | VERTICAL 

How does it work?  (for the curious)

  SDP 2.0 was created using Microsoft Visual C++ 6.0 with standard Win32 API
  calls.  It uses EnumPrinter, OpenPrinter and SetPrinter functions to
  do most of the dirty work.  Source code is available upon request.

Licensing B.S.

  This is FREEWARE (my favorite kind of software) so if you paid for it, 
  you got taken.  It is designed to work under Windows 9x/NT.  I have 
  tested it under Windows 95 and 98, and I use it myself.  I have found it 
  to be completely safe, but like all software, use at your own risk.
  I make no guarantees, and none should be implied.  If you're the worrying
  sort, use the standard precaution:  backup first.

What about support?

  As with most freeware, support is very limited.  If you've got a bug to
  report, a comment, or if you'd like to request a copy of the source code,
  my email address is:  
  
  Edward Brophy
  ebrophy@aztec.asu.edu
    -or-
  faust@bnswest.net

  Visit --> http://www.bnswest.net/~faust/index.html
  for possible updates and additional freeware!

  version 2.0 -> Patrick Peccatte
  peccatte@club-internet.fr
  http://peccatte.rever.fr

History:

    9/8/98  Version 1.0  

            Initial release.


   11/5/98  Version 1.1  

            Added features:  Due to requests, added a way of controlling
                             how long the window stays open.  See the
                             SDP.INI file for instructions.  This only
                             effects the "Success" window.
  
            Added extra command line checking so that SDP can be run 
            from shells, scripts and other applications.
 
            Tested SDP under Windows 98.


  11/18/98  Version 1.2

            Bug fix for page fault error via DOS shell execution.


    4/3/99  Version 1.3

            Major rewrite of the printer setting code.  SDP no longer
            uses WIN.INI so as to make it more NT compatible.  Also 
            dropped the ability to select printer based on the printer's
            driver name in order to simplify code.  Only the printer's
            name and port descriptions used now.


    4/5/99  Version 1.31

            Minor display bug fix.

    9/17/99 Version 2.0
            Printer name in INI file and printer settings added by Patrick Peccatte.

            Supported settings in the section [settings] of the INI file:
            -------------------------------------------------------------
           
		Portname=<the port name>

		DriverName=<the name of the driver>

		Comment=<a comment>

		Orientation=
		   PORTRAIT
		   LANDSCAPE

		Copies=<#copies>

		Scale=<#scale>

		PaperSize=
		   LETTER Letter, 8 1/2- by 11-inches 
		   LEGAL Legal, 8 1/2- by 14-inches 
		   A4 A4 Sheet, 210- by 297-millimeters 
		   CSHEET C Sheet, 17- by 22-inches 
		   DSHEET D Sheet, 22- by 34-inches 
		   ESHEET E Sheet, 34- by 44-inches 
		   LETTERSMALL Letter Small, 8 1/2- by 11-inches 
		   TABLOID Tabloid, 11- by 17-inches 
		   LEDGER Ledger, 17- by 11-inches 
		   STATEMENT Statement, 5 1/2- by 8 1/2-inches 
		   EXECUTIVE Executive, 7 1/4- by 10 1/2-inches 
		   A3 A3 sheet, 297- by 420-millimeters 
		   A4SMALL A4 small sheet, 210- by 297-millimeters 
		   A5 A5 sheet, 148- by 210-millimeters 
		   B4 B4 sheet, 250- by 354-millimeters 
		   B5 B5 sheet, 182- by 257-millimeter paper 
		   FOLIO Folio, 8 1/2- by 13-inch paper 
		   QUARTO Quarto, 215- by 275-millimeter paper 
		   10X14 10- by 14-inch sheet 
		   11X17 11- by 17-inch sheet 
		   NOTE Note, 8 1/2- by 11-inches 
		   ENV_9 #9 Envelope, 3 7/8- by 8 7/8-inches 
		   ENV_10 #10 Envelope, 4 1/8- by 9 1/2-inches 
		   ENV_11 #11 Envelope, 4 1/2- by 10 3/8-inches 
		   ENV_12 #12 Envelope, 4 3/4- by 11-inches 
		   ENV_14 #14 Envelope, 5- by 11 1/2-inches 
		   ENV_DL DL Envelope, 110- by 220-millimeters 
		   ENV_C5 C5 Envelope, 162- by 229-millimeters 
		   ENV_C3 C3 Envelope, 324- by 458-millimeters 
		   ENV_C4 C4 Envelope, 229- by 324-millimeters 
		   ENV_C6 C6 Envelope, 114- by 162-millimeters 
		   ENV_C65 C65 Envelope, 114- by 229-millimeters 
		   ENV_B4 B4 Envelope, 250- by 353-millimeters 
		   ENV_B5 B5 Envelope, 176- by 250-millimeters 
		   ENV_B6 B6 Envelope, 176- by 125-millimeters 
		   ENV_ITALY Italy Envelope, 110- by 230-millimeters 
		   ENV_MONARCH Monarch Envelope, 3 7/8- by 7 1/2-inches 
		   ENV_PERSONAL 6 3/4 Envelope, 3 5/8- by 6 1/2-inches 
		   FANFOLD_US US Std Fanfold, 14 7/8- by 11-inches 
		   FANFOLD_STD_GERMAN German Std Fanfold, 8 1/2- by 12-inches 
		   FANFOLD_LGL_GERMAN

		DefaultSource=
		   ONLYONE
		   LOWER
		   MIDDLE
		   MANUAL
		   ENVELOPE
		   ENVMANUAL
		   AUTO 
		   TRACTOR
		   SMALLFMT
		   LARGEFMT 
		   LARGECAPACITY
		   CASSETTE
		   FORMSOURCE

		MediaType=
		   STANDARD Plain paper. 
		   GLOSSY Glossy paper. 
		   TRANSPARENCY Transparent film. 

		PrintQuality=
		   HIGH
		   MEDIUM
		   LOW
		   DRAFT 

		Duplex=
		   SIMPLEX
		   HORIZONTAL
		   VERTICAL 