Announcement

Collapse
No announcement yet.

Removing %VK_RETURN from keybd buffer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Removing %VK_RETURN from keybd buffer

    Up till now the following has worked fine for specialized dialog's that I use as special purpose message boxes (so I can minimize etc). In at least one program it hangs the program where the same routine in other programs does not. Is the following the best way to strip the return key out of the keyboard buffer.

    Code:
                DO
                  DIALOG DOEVENTS TO CNT&
                LOOP WHILE CNT& > 1
                IF (GetKeyState(%VK_RETURN) AND &H8000) THEN
                  WHILE GetMessage(Msg,%Null,0,0)
                    IF msg.wparam = %VK_RETURN THEN EXIT
                  LOOP
                END IF
    Bob Mechler

  • #2
    A well placed SetForeGroundWindow hdlg did the trick.

    Code:
                DO
                  DIALOG DOEVENTS TO CNT&
                LOOP WHILE CNT& > 1
                SetForeGroundWindow hdlg
                IF (GetKeyState(%VK_RETURN) AND &H8000) THEN
                  WHILE GetMessage(Msg,hdlg,0,0)
                    IF msg.wparam = %VK_RETURN THEN EXIT
                  LOOP
                END IF

    Comment

    Working...
    X