OnRequestPrint Event - VCL

<< Click to Display Table of Contents >>

Navigation:  Events Generated by the VCL >

OnRequestPrint Event - VCL

Previous pageReturn to chapter overviewNext page

Is fired to inform the application about the several stages during the printing process.

OnRequestPrint(

Sender: TVPEngine;

Action: Integer;

var ResultingAction: Integer

)

Sender

the VPE object that fired the event

Action

Action

Value

Comment

PRINT_MSG_ABORT

0

User aborted while printing

PRINT_MSG_START

1

Print started

PRINT_MSG_END

2

Print ended

PRINT_MSG_SETUPABORT

3

User aborted Setup-Dialog

PRINT_MSG_SETUPSTART

4

Setup-Dialog started

PRINT_MSG_SETUPEND

5

Setup-Dialog ended

 

ResultingAction

is a return-parameter, i.e. you can assign it one of the following values to control the resulting action of VPE:

Resulting Action

Value

PRINT_ACTION_OK

0

PRINT_ACTION_ABORT

1

Remarks:

Do not call CloseDoc() when processing this event. You would terminate a module that is working.

 

Your application should return PRINT_ACTION_OK (zero) if it processes this message, except for Action = PRINT_MSG_SETUPSTART, where your application may return in addition PRINT_ACTION_ABORT (= 1) to abort the print job. PRINT_MSG_SETUPSTART is sent, when the user clicked the print button in the preview (or pushed the corresponding key). You have the option to abort the job, for you can then create and print internally a new document which is completely different to the preview.

 

Another use for the PRINT_MSG_SETUPSTART message is, to pre-initialize the Device Control Properties at this stage, before the printer setup dialog will be shown to the user.