CDialog wipes out when switching to a different application
-
I 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();
-
I 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();
http://www.codeproject.com/KB/miscctrl/progresswnd.aspx[^] Check for modal progress bar.
-@SuDhIrKuMaR@-
-
I 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();
I guess your application is single threaded and that is the problem. Once you enter in a function which takes long time GUI cannot be updated since there is only one thread and it is busy in the expensive function. The solution is to create another thread and do the processing in that thread. -Saurabh
-
I guess your application is single threaded and that is the problem. Once you enter in a function which takes long time GUI cannot be updated since there is only one thread and it is busy in the expensive function. The solution is to create another thread and do the processing in that thread. -Saurabh
-
http://www.codeproject.com/KB/miscctrl/progresswnd.aspx[^] Check for modal progress bar.
-@SuDhIrKuMaR@-