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.
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
BOOL GetDefaultPrinter(
LPTSTR pszBuffer, // printer name buffer
LPDWORD pcchBuffer // size of name buffer
);
DECLARE INTEGER GetDefaultPrinter IN winspool.drv;
STRING @ pszBuffer,;
INTEGER @ pcchBuffer
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.
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.
Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Unsupported.
See also: SetDefaultPrinter, EnumPrinters, PrinterProperties.