1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

List printers and set the default

Discussion in 'Plugins' started by vefatica, Oct 16, 2011.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,792
    Likes Received:
    29
    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
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,280
    Likes Received:
    38
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,792
    Likes Received:
    29
    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.
     
  4. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    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
     
  5. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,280
    Likes Received:
    38
    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.
     
  6. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,792
    Likes Received:
    29
    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"
     
  7. mfarah

    Joined:
    Nov 2, 2009
    Messages:
    226
    Likes Received:
    5
    Why not "printers"? (or is it taken?)
     

Share This Page