Wiki Home

Win 32 Api Add Printer


Namespace: WIN_COM_API
Please describe Win 32 Api Add Printer here.

Add PrinterOffsite link to http://www.news2news.com/vfp/?function=511

The Add PrinterOffsite link to http://www.news2news.com/vfp/?function=511
function adds a printer to the list of supported printers for a specified server.


Code examples:

Declaration:


HANDLE Add PrinterOffsite link to http://www.news2news.com/vfp/?function=511
(
LPTSTR pName, // server name
DWORD Level, // printer information level
LPBYTE pPrinter // printer information buffer
);



FoxPro declaration:


DECLARE INTEGER Add PrinterOffsite link to http://www.news2news.com/vfp/?function=511
IN winspool.drv;
STRING pName,;
INTEGER Level,;
STRING @ pPrinter




Parameters:

pName
[in] Pointer to a null-terminated string that specifies the name of the server on which the printer should be installed.

Level
[in] Specifies the version of the structure to which pPrinter points. This value must be 2.

pPrinter
[in] Pointer to a PRINTER_INFO_2 structure that contains information about the printer.


Return value:

If the function succeeds, the return value is the handle to a new printer object.


My comment:

When you are finished with the handle, pass it to the Close Printer function to close it.

Use the Enum Print ProcessorsOffsite link to http://www.news2news.com/vfp/?function=508
function to enumerate the set of print processors installed on a server. Use the Enum Print Processor DatatypesOffsite link to http://www.news2news.com/vfp/?function=509
function to enumerate the set of data types that a print processor supports. Use the Enum PortsOffsite link to http://www.news2news.com/vfp/?function=510
function to enumerate the set of available ports. Use the Enum Printer DriversOffsite link to http://www.news2news.com/vfp/?function=124
function to enumerate the installed printer drivers.
( Topic last updated: 2005.04.26 04:32:38 AM )