Announcement

Collapse

New Sub-Forum

In an effort to help make sure there are appropriate categories for topics of discussion that are happening, there is now a sub-forum for databases and database programming under Special Interest groups. Please direct questions, etc., about this topic to that sub-forum moving forward. Thank you.
See more
See less

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