In our application we have an MFC dialog that opens and processes some data needed to display. Hence the processing is initiated lazily inside OnPaint() event. The processing takes some time (about 20-30 sec), and is solely algorithmic (no UI API called). What happens is that sometimes after the processing is finished the window "disappears". We found out that it's brought behind the parent window (main frame).
Calling SetForegroundWindow() right after processing has finished, or performing the processing in a non-UI thread (letting OnPaint() finish in reasonable time) has eliminated the problem.
Is this issue known? Is there any defined time limit for OnPaint() execution?
Thanks,
Alex.