This method retrieves the handle of the specified printer's DEVMODE structure and DEVNAMES structure.
Parameters
None
Return Value
Returns True (nonzero) when successful, returns False (0) when not successful.
Explanation
The GetDevModeHandle method retrieves the handle of the specified printer's DEVMODE structure and DEVNAMES structure.
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
ImageKit1.PrintDraw.PrinterName = "EPSON LP-8200C"
ImageKit1.PrintDraw.PrintFileName = ""
ImageKit1.PrintDraw.GetDevModeHandle
'Enter your processing code here... ..
ImageKit1.PrintDraw.ReleaseDevModeHandle
Retrieving the DEVMODE handle from the printer settings file
ImageKit1.PrintDraw.PrinterName = ""
ImageKit1.PrintDraw.PrintFileName = "IkPrn.Ik"
ImageKit1.PrintDraw.GetDevModeHandle
'Enter your processing code here... ..
ImageKit1.PrintDraw.ReleaseDevModeHandle
If this method is successfully executed, the handle of the DEVMODE structure will be set in the DevMode property and the handle of the DEVNAMES structure will be set in the DevNames property. The DevMode property and the DevNames property are used by the PrintCreateDC method. For more information about the DEVMODE and DEVNAMES structures, please refer to WindowsAPI or related manuals.
Note: The handles of the DEVMODE and DEVNAMES structures are freed using the ReleaseDevModeHandle method.
Differences between ImageKit7/8/9
Successfully executing this method results in the DevMode property and the DevNames property values being updated.