Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

List printers and set the default

May
12,845
164
I'm working on a (SYSUTILS) plugin to list the printers and set the default printer. So far I have this working model (far below). Suggestions would be appreciated. One thought is to implement (instead) some of:

Code:
_NPRNTRS = number of printers
_DEFPRNTR = index (or name?) of default printer
@PRNTR[index] = name of printer
DEFPRNTR index (or name?) ... set default printer
(although what I have now is short and simple).

Code:
g:\projects\4sysutils\release> ptrs /?

PTRS [N] ... list printers [or set default to printer N]

g:\projects\4sysutils\release> ptrs
Index:  0
Name:   Microsoft XPS Document Writer

Index:  1
Name:   HP LaserJet P4014/P4015 PCL6

Index:  2 (Default)
Name:   HP LaserJet 1020

Index:  3
Name:   Adobe PDF

g:\projects\4sysutils\release> ptrs 0

g:\projects\4sysutils\release> ptrs
Index:  0 (Default)
Name:   Microsoft XPS Document Writer

Index:  1
Name:   HP LaserJet P4014/P4015 PCL6

Index:  2
Name:   HP LaserJet 1020

Index:  3
Name:   Adobe PDF
 
On Sun, 16 Oct 2011 13:55:56 -0400, Charles Dye <> wrote:

|PrinterStuff Plugin ( PrinterStuff Plugin )
|
|<GRINS away runs and>

It's good to know you've done all that. I'll leave mine as simple as possible.
 
From: vefatica
| It's good to know you've done all that. I'll leave mine as simple as
| possible.

Do you intend yours to do anything Charles' won't? Regardless, I'd suggest you make yours independent of SYSUTIL.DLL - I have (and I am sure some others, too) have them both SYSUTIL andPRINTERSTUFF loaded; don't want naming conflicts.
--
Steve
 
Do you intend yours to do anything Charles' won't?

Actually, doing less might be a good idea. PrinterStuff is a pretty hefty plugin for use in specialized circumstances; I can see where lightweight informational functions could be useful in a general-purpose utility plugin.
 
On Sun, 16 Oct 2011 18:07:16 -0400, Steve Fabian <> wrote:

|From: vefatica
|| It's good to know you've done all that. I'll leave mine as simple as
|| possible.
|
|Do you intend yours to do anything Charles' won't? Regardless, I'd suggest you make yours independent of SYSUTIL.DLL - I have (and I am sure some others, too) have them both SYSUTIL andPRINTERSTUFF loaded; don't want naming conflicts.

The only name I intend to use is PRNTRS. I'll change it if Charles uses it. I
whittled it down to this.

Code:
v:\> prntrs /?
PTRS [N] ... list printers [or set default to printer N]

v:\> prntrs
0       "Microsoft XPS Document Writer" (Default)
1       "HP LaserJet P4014/P4015 PCL6"
2       "HP LaserJet 1020"
3       "Adobe PDF"

v:\> prntrs 2

v:\> prntrs
0       "Microsoft XPS Document Writer"
1       "HP LaserJet P4014/P4015 PCL6"
2       "HP LaserJet 1020" (Default)
3       "Adobe PDF"
 
Back
Top