Call application.terminate instead. Application.terminated:= true does not call terminatequery because it can not be canceled. =========== It [bypassing OnTerminateQuery] is done intentionally
- Pressing btnCancell puts the thread to terminate, its OnTerminated at its very end sets "appliation.terminated:= true" - closing the app {clicking [x] titlebar button etc} fires application.OnTreminateQury which disables terminating the apllication but the end of thread code [making sure the graceful {proper cleanup & result code} exit] // // Application.OnTreminateQuery // procedure tmainfo.appterminatequery(var terminate: Boolean); begin terminate:= false; thrdUpdate.terminate; end; // // Treadcomp.OnTerminate // procedure tmainfo.tdupadteterminate(const sender: tthreadcomp); begin // blocking the Cancel button since cancelling should be already in progress btnCancel.enabled:= false; // visual informing user about application results case RESULTCODETY(ExitCode) of SUCCESS: begin lblFinStatus.caption:= 'Завершено успешно.'; lblFinStatus.color:= cl_ltgreen; pbCurrentFile.value:= 1; pbTotals.value:= 1; end; CANCELLED: begin lblFinStatus.caption:= 'Отменено.'; lblFinStatus.color:= cl_ltblue; end else {FAILED} lblFinStatus.caption:= 'Произошла ошибка.'; lblFinStatus.color:= cl_ltred; end; application.unlock; if ExitCode = integer(FAILED) then begin showmessage(lastopermsglocal,'ОШИБКА АВТООБНОВЛЕНИЯ'); // <<< WANTED TO WORK end; waitus(3000000); application.lock; // the only way to exit the application , with no more questions & checks application.terminated:= true; end; 2012/7/25, Ivanko B <ivankob4m...@gmail.com>: > Should be noted in code. > ================ > what to "egrep" ? > > > 2012/7/25, Martin Schreiber <mse00...@gmail.com>: >> On Wednesday 25 July 2012 17:18:43 Ivanko B wrote: >>> MSEgui tprogressbar.value is thread safe. >>> =============== >>> A list of all thread safe MSEgui widget's properties ? >>> >> Should be noted in code. >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> mseide-msegui-talk mailing list >> mseide-msegui-talk@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk >> > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk