Skip to content

Latest commit

 

History

History
70 lines (50 loc) · 1.94 KB

File metadata and controls

70 lines (50 loc) · 1.94 KB

Home

Function name : GetPrinter

Group: Printing and Print Spooler - Library: winspool.drv


The GetPrinter function retrieves information about a specified printer.


Code examples:

Retrieving the name of the default printer for the current user on the local computer (Win NT/XP)
How to retrieve the number of print jobs queued for the printer
How to browse and connect to printers on a network (WinNT)

Declaration:

BOOL GetPrinter(
  HANDLE hPrinter,    // handle to printer
  DWORD Level,        // information level
  LPBYTE *pPrinter,    // printer information buffer
  DWORD cbBuf,        // size of buffer
  LPDWORD pcbNeeded   // bytes received or required
);  

FoxPro declaration:

DECLARE INTEGER GetPrinter IN winspool.drv;
AS GetPrinterA;
	INTEGER   hPrinter,;
	INTEGER   Lvl,;
	STRING  @ pPrinter,;
	INTEGER   cbBuf,;
	INTEGER @ pcbNeeded  

Parameters:

hPrinter [in] Handle to the printer for which the function retrieves information. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.

Level [in] Specifies the level or type of structure that the function stores into the buffer pointed to by pPrinter.

pPrinter [out] Pointer to a buffer that receives a structure containing information about the specified printer.

cbBuf [in] Specifies the size, in bytes, of the buffer pointed to by pPrinter.

pcbNeeded [out] Pointer to a variable that the function sets to the size, in bytes, of the printer information.


Return value:

If the function succeeds, the return value is a nonzero value.


Comments:

Corresponding FoxPro functions: GetPrinter(), SYS(1037).