RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TPrinter.SetPrinter Method

Specifies the current printer.

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

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

 

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