key strokes

  • Thread starter Thread starter Venue
  • Start date Start date
V

Venue

I have this issue on a MessageBox. If the user responds to the ok/cancel
button and taps more than once, the keystrokes are registered in buffer and
as soon as the MessageBox disappears the button below is activated though
not desired. What can I do to handle it, anything like clear key buffer.
 
Well, I suppose that you could use PeekMessage to clear the message queue.
You'll have to P/Invoke it. You'd want to do something roughly like this
after detecting the dismissal of the dialog:

while ( PeekMessage( &msg, NULL, WM_KEYFIRST, WM_KEYLAST, TRUE ) )
{ // You just want to ignore the message, so do nothing
e. }Paul T.
have this issue on a
MessageBox. If the user responds to the ok/cancel
 
Whoops. The last parameter to PeekMessage should be PM_REMOVE, not TRUE.
You can also remove all mouse messages using the special values,
WM_MOUSEFIRST and WM_MOUSELAST.

Paul T.
 
Back
Top