Print Page | Close Window

How to force screen update?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=14223
Printed Date: 14 May 2025 at 3:16am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to force screen update?
Posted By: hakoar
Subject: How to force screen update?
Date Posted: 06 May 2009 at 5:37am
Hi,
I have an application that does long processing and shows that progress in a progress bar in the statusbar area.
Everything works and get's updated until I "Alt+Tab" to an other application while processing continues.

When I switch back to my processing application, the progress bar or the whole client area doesn't get updated until the processing is complete?

How can I force the screen update within the loop?
I have tried following without any luck:
---
((CMainFrame*)AfxGetMainWnd())->m_wndProgCtrl.RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_ALLCHILDREN);
((CMainFrame*)AfxGetMainWnd())->RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_ALLCHILDREN);
---

Any suggestions?




Replies:
Posted By: Oleg
Date Posted: 07 May 2009 at 12:59am

Hi,

 
Add some AfxGetApp()->PumpMessage();


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 07 May 2009 at 5:54am
Multithreading ftw!

-------------
PokerMemento - http://www.pokermemento.com/


Posted By: ABuenger
Date Posted: 07 May 2009 at 6:29am
Originally posted by znakeeye znakeeye wrote:

Multithreading ftw!


DoEvents ftw



-------------
Codejock support


Posted By: hakoar
Date Posted: 07 May 2009 at 6:34am
Hi,
This "makes more" than just a window update happening .
Hope there would be a method to just force the current view to be re-freshed during the run....
This is a database app that processes in a loop "something" and updates the progressbar when progressing...



Posted By: hakoar
Date Posted: 07 May 2009 at 6:37am
Originally posted by znakeeye znakeeye wrote:

Multithreading ftw!


Hi,
At the moment I don't want to start learning threading implementations. I'm fine with the current, except that the window update problem.
It should be solvable somehow without threads.

Sorry my ignorance but what the "ftw" stands for?
 


Posted By: znakeeye
Date Posted: 15 May 2009 at 3:20am
ftw = "for the win".
 
From experience I know that a progress bar cannot be updated when performing CPU intensive operations unless you run the lengthy operation in another thread!
 
I've posted this link before. You should read it!
http://www.microsoft.com/msj/0798/c0798.aspx - http://www.microsoft.com/msj/0798/c0798.aspx


-------------
PokerMemento - http://www.pokermemento.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net