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)
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>
|
|
|
|
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)
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???
|
|
|
|