Hello,
I stumbled upon a curious problem with MFC. I have a Dialog where I check every Edit field on ON_EN_KILLFOCUS if it's valid. If validation doesn't go through I set focus back and show error message. This would be fine, if only I would close the dialog. I mean if I leave wrongly entered field and press close button or X, then ON_EN_KILLFOCUS is invoked first, after other handling events, because message appears and focus goes back to the field. So my question: Is there a way to find out in ON_EN_KILLFOCUS which event will be after it? If yes then I can check if its close event and then close dialog, not returning my focus to wrongly entered Edit field. Any help would be so much help!