RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TPrinter.GetPrinter Method

Retrieves information about the current printer.

Pascal
procedure GetPrinter(ADevice: PChar; ADriver: PChar; APort: PChar; var ADeviceMode: THandle);
C++
__fastcall GetPrinter(const char * ADevice, const char * ADriver, const char * APort, THandle ADeviceMode);

Call GetPrinter to obtain information about the current printer.  

ADevice is a buffer that receives the device name of the current printer. This is the name that appears in the Print Manager (for example, "Epson FX-80"). It is not the printer model name. 

ADriver is a buffer that receives the driver name for the current printer. Some versions of Windows do not use printer driver names, in which case this buffer is unused. On versions of Windows that support printer driver names, this is the name of a printer driver (usually 'WINSPOOL'). 

APort is a buffer that receives the port used by the current printer. It is not used on 32-bit versions of Windows, but is included for backward compatibility. 

DeviceMode returns the handle to a memory buffer containing device-specific initialization data for the device driver. Use the GlobalLock function to convert this handle into a pointer to a DeviceMode record (Delphi) or DEVMODE structure (C++). 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!