Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 1.9 KB

GetDefaultPrinter.md

File metadata and controls

59 lines (40 loc) · 1.9 KB

Home

Function name : GetDefaultPrinter

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


The GetDefaultPrinter function retrieves the printer name of the default printer for the current user on the local computer.


Code examples:

Retrieving the name of the default printer for the current user on the local computer (Win NT/XP)
Enumerating print jobs and retrieving information for default printer (JOB_INFO_1 structures)
Printing Image File, programmatically set print page orientation to landscape
Setting default printer

Declaration:

BOOL GetDefaultPrinter(
  LPTSTR pszBuffer,   // printer name buffer
  LPDWORD pcchBuffer  // size of name buffer
);  

FoxPro declaration:

DECLARE INTEGER GetDefaultPrinter IN winspool.drv;
	STRING  @ pszBuffer,;
	INTEGER @ pcchBuffer
  

Parameters:

pszBuffer [in] Pointer to a buffer that receives a null-terminated character string containing the default printer name.

pcchBuffer [in/out] On input, specifies the size, in characters, of the pszBuffer buffer.


Return value:

If the function succeeds, the return value is a nonzero value and the variable pointed to by pcchBuffer contains the number of characters copied to the pszBuffer buffer, including the terminating null character.


Comments:

Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Unsupported.

See also: SetDefaultPrinter, EnumPrinters, PrinterProperties.