K Feening
asked on
Program not responding
I have an application that copies files from the origional directory to a backup/copy directory with a tProgress bar and 2 tLabels to show the progress of the copy
If the user clicks on the program or the windows screen NOT RESPONDING show on the top of the application and the tprogress bar and tlabels stop showing the progress - the program is still running but the user thinks its stopped and exits it. causing the copy not to be completed
How do I stop the the not responding and keep the tProgress bar and tlabels working
attached is a part of the code I am using
If the user clicks on the program or the windows screen NOT RESPONDING show on the top of the application and the tprogress bar and tlabels stop showing the progress - the program is still running but the user thinks its stopped and exits it. causing the copy not to be completed
How do I stop the the not responding and keep the tProgress bar and tlabels working
attached is a part of the code I am using
for i := 0 to filelistbox.Items.Count - 1 do begin // Listbox with the files to bg copied
pbBuild.stepit; // tProgress Bar
f := 'c:\backupfiles\' + filelistbox.Items.Strings[i];
f1 := 'c:\origionalfiles\' + filelistbox.Items.Strings[i];
Label1.caption := 'From ' + f;
Label2.caption := 'To ' + f1;
Label1.refresh;
Label2.refresh;
form1.Refresh;
CopyFile(PChar(f), PChar(f1), False);
appscount := appscount + 1;
form1.bringtofront;
lCopied.Caption := 'Files Copied - ' + inttostr(AppsCount);
lCopied.repaint;
form1.Repaint;
form1.refresh;
end;
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ps: specify in all components used in the procedure "CopyFile" Form1. before.(ex: like i forget fist[Form1.filelistbox.Ite ms.Count.. .])
ASKER
Simple solutions are the best
Thanks
Kevin
Thanks
Kevin
Open in new window