ShowPrintPreviewDlg example for Delphi

Function TForm1.DoPrintPreview ( hDevMode: L_HGLOBAL;
    hDevNames: L_HGLOBAL; 
    rcMargin: TRect; 
    rcMinMargins: TRect; 
    Icon: TIcon ): L_INT; 
begin
   LEADDlgFile1.MarginsRect:= rcMargin; 
   LEADDlgFile1.MinMarginsRect:= rcMinMargins; 
   LEADDlgFile1.DevModeHandle:= hDevMode; 
   LEADDlgFile1.DevNamesHandle:= hDevNames; 
   LEADDlgFile1.WindowIcon:= Icon; 
   LEADDlgFile1.CommandShow:= SW_SHOW; 

   LEADDlgFile1.LEADImage:= LEADImage1; 

   Result:= LEADDlgFile1.ShowPrintPreviewDlg ( Self ); 
end;