It would be cleaner to avoid TranslateMessage instead of removing the message (possibly getting the wrong one).
Sorry, I don't really see the problem. TranslateMessage should always generate a WM_CHAR, how could we get a wrong message? Shouldn't be possible, except for a bug in TranslateMessage, or I'm missing something.
I could check for message/wParam to skip TranslateMessage, but I found it cleaner to put it into the handler for VK_ESCAPE.
Regards, Fabian Maurer