I had the same issue and found a simple solution. In the process/task that you are triggering from this dialog, insert the following code so it gets called periodically while that process/task progresses. MSG msgs; while( ::PeekMessage( &msgs, NULL, 0, 0 , PM_NOREMOVE ) ) { if( !AfxGetThread()->PumpMessage() ) { ::PostQuitMessage(0); break; } }
bxveer
Posts
-
Dialog question -
CFormView looses title on losing focusI have an app that uses several CFormView objects. I set a default title to each of them when adding their frame windows to the document. I also set a new title in the OnUpdate function of these views based on the value of a member attribute. When the view is invoked it displays the title/caption in the title bar but, strangely, looses the title when loosing focus. The titles becomes ":1", ":2", etc. for these views if I switch from them to other views. To get back the title, I have to force an update so the OnUpdate gets called and the title is reset. I am sure it's something very minor that's causing it but not sure what it is. Any feedback is very much appreciated.
-
CDialog wipes out when switching to a different applicationThank you for the link but it does not solve my issue.
-
CDialog wipes out when switching to a different applicationThank you. Can you refer to any topics in this board that would help triggering my functions in a different thread. I have not done any multi-threaded apps as yet.
-
CDialog wipes out when switching to a different applicationI have a VC++ app that uses a progress dialog that contains a CProgressCtrl to indicate progress of a task. When the app kicks of a task, this dialog is launched as a modal dialog and progress of the task is indicated by the CProgressCtrl. Issue ----- For tasks that take extended period of time, the progress dialog blanks out (becomes a blank white rectangle) as soon as user selects a different app. But the processing continues as usual. The dialog is closed when the task is completed. Users are getting confused by this behavior since they are not sure if the app went into an infinite loop or is processing normally since there is no indication of progress in the dialog. They just have to give it time or kill it. I am trying to figure out how to maintain the progress indication in this dialog irrespective of user switching apps. Any suggestions are very much appreciated. So far, I tried the following, based on posts in this board, without success. 1. Force the dialog to stay on top of all windows in the desktop by including the following statement in OnInitDialog SetWindowPos(&this->wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); 2. Calling a Refresh function in the dialog, containing the following statements, periodically during the progression of the task SetForegroundWindow(); SetFocus();