1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
Type
TJobs = array [0..1000] of JOB_INFO_2;
PJobs = ^TJobs;
Var
BytesNeeded, NumJobs, i : Cardinal;
pJ : PJobs;
begin
// Recherche des Jobs
EnumJobs(HandleImprimante,0,1000,2,nil,0, BytesNeeded,NumJobs);
pJ := AllocMem(BytesNeeded);
EnumJobs(HandleImprimante,0,1000,2,pJ,BytesNeeded, BytesNeeded,NumJobs);
if NumJobs = 0 then
ListeAjouts.Add('.....Pas de jobs en attente')
else
for i := 0 to Pred(Numjobs) do begin
If (Pj[i].Status And JOB_STATUS_SPOOLING) = 0 then begin
ListeAjouts.Add('.....Job ' + IntToStr(pJ[i].JobId) + SavePchar(pJ[i].pDocument));
IdFic:=IntToStr(pj[i].JobId);
if ListeJobs.IndexOf(IdFic) = -1 then begin
inc(NbJobs);
Synchronize(MiseAJourCompteur);
end;
end;
end; |
Partager