🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13393

Re: Windows: Adding a network printer

#13393
From: Vladimir Afanasyev
Date: Wed, 15 Oct 2003 08:19
37 lines
2240 bytes
Hi,

Charles Page <lissom@snet.net> wrote:
>Does anyone have/know of example code for adding a printer to Windows 
>(pref. XP) using the API functions AddPrinterDriver, etc.
>

You can find appropriate information on MSDN lib. site.


AddPrinterDriver
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_29f6.asp

HOWTO: Add a Network Printer Connection
http://support.microsoft.com/default.aspx?scid=kb;en-us;147202

HOWTO: Install Printer Drivers from a Network Print Server
http://support.microsoft.com/default.aspx?scid=kb;en-us;203604


For WinXP WMI is common way for administrative tasks.:

AddPrinterDriver Method of the Win32_PrinterDriver Class
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/addprinterdriver_method_in_class_win32_printerdriver.asp

Install a Printer Driver not Found in Drivers Cab
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/printing/scrprn20.asp

Install Printer Drivers
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/printing/scrprn22.asp

How to use WMI with BCB:
Let us try WMI (samples)
http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=19443

Vladimir.
Technical Details
Message-ID: <3f8d0323$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f8c674e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,e97b2fa0aeb75d7e
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-15 01:39:37 PST
From: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Sender: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Reply-To: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Subject: Re: Windows: Adding a network printer
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 212.82.216.226     
X-Forwarded-For: 192.168.0.147
References:  <3f8c674e$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <3f8d0323$1@newsgroups.borland.com>
Date: 15 Oct 2003 01:19:47 -0700
X-Trace: newsgroups.borland.com 1066205987 207.105.83.66 (15 Oct 2003 01:19:47 -0700)
Lines: 37
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail