 |
GetDefaultPrinter ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
The GetDefaultPrinter function retrieves the printer name of the default printer for the current user on the local computer. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| 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. |
 |
 |
| Usage: |
 |
* returns default printer name (WinNT)
nBufsize = 250
cPrinter = REPLICATE(Chr(0), nBufsize)
= GetDefaultPrinter(@cPrinter, @nBufsize)
cPrinter = SUBSTR(cPrinter, 1, AT(Chr(0),cPrinter)-1)
|
 |
 |
| My comment: |
 |
Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Unsupported.
See also: SetDefaultPrinter, EnumPrinters, PrinterProperties. |
 |
 |
| Word Index links for the GetDefaultPrinter : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2002-12-30 21:44:29 | | Modified: | 2007-06-11 20:04:55 | Visited in last 7 days: 56 |