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

window stops refreshing when focus changes to different application 1

Status
Not open for further replies.

Stipdonk

Programmer
Jun 18, 2009
2
Thanks for coming.

I have written an application that processes very large quantities of data per run. (A "run" can take several minutes to complete.)
The main window of the app has a popup window that has a visual counter to let the user see the progress of the work being done.

The problem is that if the user shifts focus to a different application part way through the run, the visual counter (and all visual components) cease to update even though the program continues to run. Setting focus back to my app does not reactivate the visual objects. When the calculations are complete (the time to complete the calculations is not affected - the non visual objects function properly), then the visual components of my app reactivate and my application acts normally again.

I would be greatful for any relevant feedback.
Thank you,
Gord
 
Have you tried forcing a SetRedraw( ) upon receiving focus?
 
Thank you for responding.

I have revisited SetRedraw()functionality and tried to use it in different events but that does not seem to be the problem/solution.

It seems that the popup window (and also the main window) is being "flagged" by Microsoft Windows as "Not Responding" until the data run is complete and then it becomes responsive again. {While flagged as "Not Responding" the window's activate event does not trigger even though the window frame shows that it has focus}

Any other ideas would be greatly appreciated
 
Maybe try to a little redesign your app.

For example, you can build a kind of progress bar window taking control on your process. I don't know what your app is designed to do and what does it mean "large quantities of data".
You can use Yield() function to interrupt processing data.
It can be a good idea to interrupt every hundred or thousand of data rows (not every one) and let user to press Cancel button or redraw your window.

Tomek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top