procedure TMain.JobNotification(
const jobinfo: TPBJobInformation);
const
orientations:
Array [TPrinterOrientation]
Of String =
('
Hochformat', '
Querformat');
var
item: TListitem;
begin
listview1.Items.BeginUpdate;
Try
item := listview1.Items.Add;
item.Caption := FormatDateTime('
dd-mm-yyyy', Date );
item.SubItems.Add( FormatDateTime( '
hh:nn:ss:zzz', Time ));
item.SubItems.Add( GetEnumName( Typeinfo( TPBJobStatus), Ord( jobinfo.Status)));
item.SubItems.Add( IntToStr( jobinfo.JobID ));
item.SubItems.Add( jobinfo.Computer );
item.SubItems.Add( jobinfo.User );
item.SubItems.Add( jobinfo.PrinterName );
item.SubItems.Add( jobinfo.Document );
item.SubItems.Add( IntToStr( jobinfo.Pages ));
item.SubItems.Add( IntToStr( jobinfo.BytesPrinted ));
item.SubItems.Add( IntToStr( jobinfo.TotalPages ));
If jobinfo.Status = jsCompleted
Then
begin
Label8.Caption := IntToStr(StrToInt(Label8.Caption) + jobinfo.TotalPages);
Label12.Caption := IntToStr(StrToInt(Label12.Caption)+5);
RegWriteInt(
HKCU, TSPath, '
Pages', StrToInt(Label8.Caption));
RegWriteInt(
HKCU, TSPath, '
Costs', StrToInt(Label12.Caption));
JvLog.Add('
Pages', Label8.Caption);
JvLog.Add('
Costs', Label12.Caption);
end;
item.SubItems.Add( IntToStr( jobinfo.TotalBytes ));
item.Subitems.Add( IntToStr( jobinfo.Copies ));
item.Subitems.Add( orientations[ jobinfo.Orientation ]
);
Finally
listview1.Items.EndUpdate;
End;
{ Finally }
end;