Vcl.Printers.TPrinter.GetPrinter

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure GetPrinter(ADevice, ADriver, APort: PChar; var ADeviceMode: THandle);

C++

void __fastcall GetPrinter(System::WideChar * ADevice, System::WideChar * ADriver, System::WideChar * APort, NativeUInt &ADeviceMode);

Properties

Type Visibility Source Unit Parent
procedure
function
public
Vcl.Printers.pas
Vcl.Printers.hpp
Vcl.Printers TPrinter

Description

Retrieves information about the current printer.

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++).

See Also