Article View: borland.public.cppbuilder.nativeapi
Article #8111Re: printer
From: JD
Date: Tue, 23 Nov 2004 02:27
Date: Tue, 23 Nov 2004 02:27
43 lines
2404 bytes
2404 bytes
"Francisco navarro" <paconava@telefonica.net> wrote:
>
> [...] the first time it execute, look for this printers and
> if it is missing, install it without intervention of the
> user, if it possible?
Sure. However, you don't want to check *only* the first time
the program is run because the user could see the printer a
day or two later and not knowing what it is, delete it.
I don't know how to get the list of printers from Windows but
that's a small thing to figure out. If you're using the VCL,
itterate the TPrinter::Printers list to see if your printer is
there.
If not, install the generic printer:
PRINTER_INFO_2 PrinterInfo;
PrinterInfo.pServerName = NULL;
PrinterInfo.pPrinterName = "Some Custom Name";
PrinterInfo.pShareName = NULL;
PrinterInfo.pPortName = "FILE:";
PrinterInfo.pDriverName = "Generic / Text Only";
PrinterInfo.pComment = NULL;
PrinterInfo.pLocation = NULL;
PrinterInfo.pDevMode = NULL;
PrinterInfo.pSepFile = NULL;
PrinterInfo.pPrintProcessor = "WinPrint";
PrinterInfo.pDatatype = "RAW";
PrinterInfo.pParameters = NULL;
PrinterInfo.pSecurityDescriptor = NULL;
PrinterInfo.Attributes = 576;
PrinterInfo.Priority = 1;
PrinterInfo.DefaultPriority = 0;
PrinterInfo.StartTime = 0;
PrinterInfo.UntilTime = 0;
PrinterInfo.Status = 0;
PrinterInfo.cJobs = 0;
PrinterInfo.AveragePPM = 0;
~ JD
Technical Details
Message-ID:
<41a2ae05$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41a1aad1$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4bd1fc7fc9ea3536 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "JD" <nospam@nospam.com> Sender: "JD" <nospam@nospam.com> Reply-To: "JD" <nospam@nospam.com> Subject: Re: printer Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 172.175.3.131 References: <41a1aad1$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <41a2ae05$1@newsgroups.borland.com> Date: 22 Nov 2004 19:27:01 -0700 X-Trace: newsgroups.borland.com 1101180421 207.105.83.66 (22 Nov 2004 19:27:01 -0700) Lines: 44 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail