PEGetSelectedPrinter

Use PEGetSelectedPrinter to obtain information about the printer currently selected for the report. If a printer has been specified in Crystal Reports using the File|Printer Setup|Specific printer option, this call will return information about that printer. If the File|Printer Setup|Default printer option has been selected for the report, and custom options for the Default printer have been specified (Default Properties is toggled off in the Print Setup dialog box), information about the default printer specified under Windows Control Panel|Printers will be returned. If Default Properties is toggled on for the Default printer, this function will return a successful result, but the string handles will point to NULL strings.

C Syntax
BOOL CRPE_API PEGetSelectedPrinter (
        short printJob,
        HANDLE FAR *driverHandle,
        short FAR *driverLength,
        HANDLE FAR *printerHandle,
        short FAR *printerLength,
        HANDLE FAR *portHandle,
        short FAR *portLength,
    #if defined (WIN32)
        DEVMODEA FAR * FAR *mode
    #else
        DEVMODE FAR * FAR *mode
    #endif
        );
Parameters

l

printJob

Specifies the print job that you want to query to get information on the non-default printer that has been selected with the report.

driverHandle

Specifies a pointer to the handle of the printer driver for the printer that is selected with the print job.

driverLength

Specifies a pointer to the length of the printer driver name.

printerHandle

Specifies a pointer to the handle of the printer that is selected with the print job.

printerLength

Specifies a pointer to the length of the printer name.

portHandle

Specifies a pointer to the handle of the port to which the selected printer is connected.

portLength

Specifies a pointer to the length of the port name.

mode

Specifies a pointer to the DEVMODE, or DEVMODE Windows API structure.

Returns
Remarks
VB Syntax
Declare Function PEGetSelectedPrinter Lib "crpe32.dll" (
    ByVal printJob As Integer, DriverHandle As Long, DriverLength As Integer,
    PrinterHandle As Long, PrinterLength As Integer, PortHandle As Long,
    PortLength As Integer, DevMode As Any ) As Integer
Delphi Syntax
function PEGetSelectedPrinter (
    printJob: Word;
    var driverHandle: Hwnd;
    var driverLength: Word;
    var printerHandle: Hwnd;
    var printerLength: Word;
    var portHandle: Hwnd;
    var portLength: Word;
    var mode: PDeviceModeA
    ): Bool stdcall;


Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com