KILLMESSAGERAPID-Q SpecificWindows

A statement that removes a message from the queue.

Syntax: KILLMESSAGE hWnd, Message
KILLMESSAGE form.handle, WM_CHAR

Details:
Ideally, KillMessage should be used inside an event, such as OnKeyDown, to remove any messages you don't want processed further.
For example to disable the beep after hitting the enter key in a QEDIT:

' You can use killmessage something like this... if the key pressed is
'an enter (13) it sends a killmessage for WM_CHAR (&H102) which kills
'the last character pressed and eliminates the beep

     SUB EditKeyDown (Key AS WORD, Shift AS LONG, Sender AS QEDIT)
      CONST WM_CHAR = &H102 'define WM_CHAR

'I checked which key was pressed with a select case, note I used
'form.handle for the KillMessage:

      SELECT CASE KEY
      CASE 13
       KILLMESSAGE form.handle, WM_CHAR ' kill return
       SELECT CASE Sender.Tag
'handle return depending on which edit was sender
'move to next edit, do something with contents of
'edit, etc.
       END SELECT
      END SELECT

'you can use this to move to the next edit in a group:
'SendMessage(Form.Handle, &H28, 0, 0)

'I also handled cursor up and down keys for a verticle column of edits
'in the same way, I used KillMessage to kill WM_CHAR and then moved
'the focus to the edit above or below the one I was in.
'hope that helps

' "dakodamc"  Sat Aug 23, 2003  9:16 pm