how to get all network printers?? DELPHI

Author Message
Lenniii

  • Total Posts : 11
  • Scores: 0
  • Reward points : 0
  • Joined: 3/3/2008
  • Status: offline
how to get all network printers?? DELPHI Sunday, March 09, 2008 9:58 PM (permalink)
0
hi, can anyone tell me how i find all connected / installed network printers?

<message edited by Lenniii on Tuesday, March 11, 2008 1:31 AM>
LS
 
#1
    Lenniii

    • Total Posts : 11
    • Scores: 0
    • Reward points : 0
    • Joined: 3/3/2008
    • Status: offline
    RE: how to get all network printers?? Tuesday, March 11, 2008 1:26 AM (permalink)
    0
    I wanna do it with


    typedef struct _PRINTER_INFO_2 {
    LPTSTR pServerName;
    LPTSTR pPrinterName;
    LPTSTR pShareName;
    LPTSTR pPortName;
    LPTSTR pDriverName;
    LPTSTR pComment;
    LPTSTR pLocation;
    LPDEVMODE pDevMode;
    LPTSTR pSepFile;
    LPTSTR pPrintProcessor;
    LPTSTR pDatatype;
    LPTSTR pParameters;
    PSECURITY_DESCRIPTOR pSecurityDescriptor;
    DWORD Attributes;
    DWORD Priority;
    DWORD DefaultPriority;
    DWORD StartTime;
    DWORD UntilTime;
    DWORD Status;
    DWORD cJobs;
    DWORD AveragePPM;

    } PRINTER_INFO_2, *PPRINTER_INFO_2;

    But how to use it?

    procedure TForm1.FindNetworkPrinters;
     
      var Device, Driver, Port: array[0..255] of Char;
         hDevMode: THandle;
     
      begin
       Printer.GetPrinter(Device, Driver, Port, hDevmode);
       
         if winspool._PRINTER_INFO_2(Device) = 0 then
           Edit1.Text := 'Printer is local'
           else
           Edit1.text := 'Printer is a network Printer';
     
      end;
     


    "if winspool._PRINTER_INFO_2(Device) = 0 then" <-- device cant be right there, can it be? i would say to insert here
    LPTSTR pServerName;
    can anyone PLEASE help me???
    LS
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9