Vcl.Printers.TPrinter.SetPrinter

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure SetPrinter(ADevice, ADriver, APort: PChar; ADeviceMode: THandle); overload;
procedure SetPrinter(ADevice, ADriver, APort: string; ADeviceMode: THandle); overload;

C++

void __fastcall SetPrinter(System::WideChar * ADevice, System::WideChar * ADriver, System::WideChar * APort, Winapi::Windows::THandle ADeviceMode)/* overload */;
void __fastcall SetPrinter(System::UnicodeString ADevice, System::UnicodeString ADriver, System::UnicodeString APort, Winapi::Windows::THandle ADeviceMode)/* overload */;

Properties

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

Description

Specifies the current printer.

Call SetPrinter to change the current printer.

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

ADriver specifies the driver name for the new printer (usually 'WINSPOOL').

APort is included for backward compatibility. It should be set to an empty string.

DeviceMode is the handle to a memory buffer device-specific initialization data for the device driver. This handle can be obtained by calling the GlobalAlloc function to allocate a DeviceMode record (Delphi) or DEVMODE structure (C++).

See Also