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 31 32 33 34 35 36 37 38
| procedure Thread_TraitementSimulation.TraitementFichiers;
var
wStop : Boolean;
begin
wStop := false;
UpdateInfoTexte('Début traitement fichiers');
while not wStop
do begin
if(FindFirst(wPath_DirSerieImpression+'\'+searchResultDirSI.Name+'\*.stca',faAnyFile,searchResult)=0)
then begin
UpdateInfoTexte('Fichier trouvé: '+searchResult.Name);
Synchronize(UpdateInfoDA);
//Déplacement du fichier dans Autofile
if(MoveFile(PChar(wPath_DirSerieImpression+'\'+searchResultDirSI.Name+'\'+searchResult.Name),
PChar(wPath_DirAutofile+'\'+searchResult.Name)))
then begin
UpdateInfoTexte('Fichier déplacé dans autofile. Execution de F4');
sleep(3000);
SetForegroundWindow(wHandleFenetre);
keybd_event(VK_F4,0,0,0);
Sleep(1000);
UpdateInfoTexte('F4 à été exécuté');
while FindFirst(wPath_DirAutofile+'\*.stca',faAnyFile, searchResultDirA)=0
do begin
UpdateInfoTexte('Vérification si impression terminée');
Sleep(1000);
Synchronize(UpdateInfoDA);
FindClose(searchResultDirA);
end;
FindClose(searchResultDirA);
UpdateInfoTexte('Impression terminée');
end else UpdateInfoTexte('Fichier non trouvé...');
FindClose(searchResultDirSI);
end
else wStop := true;
end;
end; |