This method retrieves the handle to the pointer of the specified printer's DEVMODE structure. The DEVMODE structure stores information about various settings and properties of a device, such as a printer.

[C++Builder]   [ bool = ]imagekitcontrolname->PrintDraw->GetDevModeHandle()
[Delphi]   [ Boolean = ]imagekitcontrolname.PrintDraw.GetDevModeHandle()

Parameters

None

Return Value

Returns True when successful, returns False when not successful.

Explanation

The GetDevModeHandle method retrieves the handle to the pointer of the specified printer's DEVMODE structure. The DEVMODE structure stores information about various settings and properties of a device, such as a printer.

To execute this method, set the PrinterName property or the PrintFileName property. (the printer file name saved by the SaveDevModeHandle or SavePrinterInfo methods). If both the PrinterName property and the PrintFileName property are set, the PrinterName takes precedence.


Examples:

Retrieving the DEVMODE handle from the printer name

VImageKit1.PrintDraw.PrinterName := 'EPSON LP-8200C';
VImageKit1.PrintDraw.PrintFileName := '';
VImageKit1.PrintDraw.GetDevModeHandle;
//Enter your processing code here... ..
VImageKit1.PrintDraw.ReleaseDevModeHandle;

Retrieving the DEVMODE handle from the printer settings file

VImageKit1.PrintDraw.PrinterName := '';
VImageKit1.PrintDraw.PrintFileName := 'IkPrn.Ik';
VImageKit1.PrintDraw.GetDevModeHandle;
//Enter your processing code here... ..
VImageKit1.PrintDraw.ReleaseDevModeHandle;

If this method is successfully executed, the handle to the pointer of the DEVMODE structure will be set in the DevMode property. The DevMode property is used by the PrintCreateDC method. For more information about the DEVMODE structure, please refer to WindowsAPI or related manuals.

Note: The handle to the pointer of the DEVMODE structure is freed using the ReleaseDevModeHandle method.

 

The ImageKit9 VCL is a product created by Newtone Corporation