0
votes

I recently got into Win32 programming and I bumped into a bug I couldn't seem to find anywhere on the net yet. I have an Edit Control that behaves a bit odd. I have a maximum of 3 characters set for the control. When I enter a number (ES_NUMBER is set) it keeps adding it to the control - if it weren't for the limit.

Image of when I enter a 0: 000

It does the same for Delete and Backspace - the entire control is cleared instantly.

I have the feeling that window procedure messages that are sent to the edit control's default window procedure might not be cleared from the message queue. Is there any way to find out if this is the case? Has anyone ever experienced this kind of behavior? I don't manually process any of the messages for the Edit Control.

1
What are the EXACT steps to reproduce this? Window styles assigned to the control, window messages sent to the control, Windows version, etc. - Remy Lebeau

1 Answers

0
votes

This seems to have been a problem with PeekMessage/GetMessage. Message intended for Dialog Windows (while my window was not a dialog) were not being removed by PeekMessage until a new message appeared in queue, even though PM_REMOVE was specified. Replacing the line with GetMessage fixed the issue.