Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Event priorities

Status
Not open for further replies.

mykaitch

Programmer
Nov 21, 2006
3
GB
I have a DOH moment. If you write a tight loop under a button (say) you cannot click the button because the system rupts will not give you time ( try a while true loop for example). There is a Borland 'command' to force the loop to test for rupts such as mouse click or keyboard, but I have forgotten what it is !!! As a result my (very fast app) runs but I cannot click my end button. Anybody remember the command/method please ?
 
I think you want Application->ProcessMessages();
 
tsh73, looks like we posted at the same time... great minds and all. :)
 
I hope this is the right place! Yes, thanks, that worked okay but much better I found was to put the loop in a thread and then it runs in the background whilst I do all the pretty stuff.
 
Even when spawning off a thread you should be a 'good citizen' and allow for other processes on that processor, to get a little attention from it, by releasing some spare cycles to them by ProcessMessages() You'll hardly notice any downgrade in process-speed, but the entire system will be _much_ more responsive!

HTH
TonHu
 
Thanks for that too, I will put it back in my thread stuff.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top