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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GUI unresponsive on high CPU utilization

Status
Not open for further replies.
Apr 20, 2009
11
US
I wrote a Delphi 6 app that processes a text file and then populates an Access database. The program pegs the CPU, but otherwise runs fine (even though task manager shows it not responding). It does take some time for the program to run, so I added an abort button and status gauge. The gauge updates fine. The problem is that it is so busy with the calculations, it doesn't even change focus to the abort button when pressed. I tried adding a Refresh in the looping calculation, but other than some flickering in the window, I still get no response.

How can I can get it to check if the abort button was pressed with the least impact on processing?
 
Hi,

put application.processmessages in cpu intensive code parts, this will improve app response. Other option is to move cpu intensive tasks to antoher thread, freeing up the main GUI thread, but this is more complicated...

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
That did it! Wasn't even a noticeable performance hit!

I completely forgot about that command.

Thank you so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top