Programmatically close the preview window

I’m using the VCL versión of List&Label 17. I display on screen an invoice with the preview window. Previously I have enabled the ‘Send To’ button and I can detect when the user clicks on that button. What I would like to do is, once detected the user pushed the Send button, close automatically the preview window in order to run my own email sending procedure.

Is this possible? If so, does anyone know how to achieve this?

Thank you very much in advance.


Just a thought: Maybe you can send a WM_CLOSE message to the handle of the preview-control?

Hi Oliver. Thank you for answering.
Actually the problem is that I have no access to the viewer form (or its handle), so I don´t know how to close it or dend thw WM_CLOSE message. Maybe I’m doing something wrong or I miss something:

From Form-A I call LL component’s LlPreviewDisplay Method to show the previwer window:
LL->LlPreviewDisplay(file.lst, sTmpDir, iHandle);
where iHandle is Form-A’s Handle.

When I push the Send button inside the preview Window, the OnViewerButtonClicked event is fired. This event is defined in Form-A and there, I can check the Button pushed and set the PerformDefaultAction to true or false, but so far I haven’t been able to figure out how to access the preview window (in order to close it).

Any help would be much appreciated.
Thank you.