Cancel dialog question
-
I have a cancel dialog for an operation that takes a while. The problem is when, in the loop, I try to change a Static control's text on the cancel dialog, it doesn't seem to erase its background (if it's showing a long file name and then a short one, the end part of the long one is still showing). I found workarounds like calling InvalidateRect on the parent dialog, but it causes a lot of flickering... I'm using the following code to process messages while in the loop:
`MSG msg; while (PeekMessage((LPMSG) &msg, (HWND) NULL, 0, 0, PM_REMOVE)) { if (!IsDialogMessage(m_hDlgWnd, (LPMSG) &msg)) { TranslateMessage((LPMSG) &msg); DispatchMessage((LPMSG) &msg); } }`
Is there anything i'm missing? (I'm not using MFC or anything) - thanks
-
I have a cancel dialog for an operation that takes a while. The problem is when, in the loop, I try to change a Static control's text on the cancel dialog, it doesn't seem to erase its background (if it's showing a long file name and then a short one, the end part of the long one is still showing). I found workarounds like calling InvalidateRect on the parent dialog, but it causes a lot of flickering... I'm using the following code to process messages while in the loop:
`MSG msg; while (PeekMessage((LPMSG) &msg, (HWND) NULL, 0, 0, PM_REMOVE)) { if (!IsDialogMessage(m_hDlgWnd, (LPMSG) &msg)) { TranslateMessage((LPMSG) &msg); DispatchMessage((LPMSG) &msg); } }`
Is there anything i'm missing? (I'm not using MFC or anything) - thanks
Why not invalidate the static control itself. After setting the new text you want.
-
Why not invalidate the static control itself. After setting the new text you want.