I have a bug that is fixed by simply putting in an AfxMessageBox message. However, I don't want the message box window to pop up and be visible to the user. How can I make Windows / the app / whatever think that an AfxMessageBox just popped up WITHOUT actually showing one?

I've tried InvalidateRect, ActivateFrame, Activate... What else can I try? What messages get posted when an AfxMessageBox gets posted?

(and I don't want to pop up the box then hide it-- from my experience, the user can still see the message box for a split second)

Thank You