Announcement

Collapse
No announcement yet.

Clearing Windows msg pump

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

  • BOB MECHLER
    replied
    Had a popup message with a dialog show modeless with a problem with it's message pump.

    Bob Mechler

    Leave a comment:


  • BOB MECHLER
    replied
    Thanks,

    Bob Mechler

    Leave a comment:


  • Michael Mattias
    replied
    >when a program is starting up

    Why not simply...
    Code:
    FUNCTION PBMAIN 
      WHILE ISTRUE PeekMessage (msg, %NULL, %NULL, %NULL, %PM_REMOVE) : WEND
    
      ' OK, ready to start now.
    Can precede with call to GetQueueStatus() for keystroke messages if you want.





    MCM

    Leave a comment:


  • BOB MECHLER
    started a topic Clearing Windows msg pump

    Clearing Windows msg pump

    About half the time on certain machines the return key the closes a prompt in one program seems to still be there for the next program and from time to time will 'press enter' on the first field of the new screen. (I use a GetMessage message pump). This never happens on my machine but it does on the machine of our quality control program tester.

    Sometimes it happens in small utility programs where someone types in a program name on the command line and the only field in the program is a field where pressing enter will cause the program to continue into it's processing phase. Sometimes, just typing the name of the program on the command line and pressing enter one time will trigger the first and only field in the program to act like enter was pressed. Very annoying.

    If the tester is in a program like GoToMeeting or Terminal Services it never happens.

    I'm needing a way to make sure when a program is starting up that there are no keystrokes left over from other Windows operations that may get caught and processed by the While GetMessage message pump.

    In other words a clear keystrokes utility at the start of the program.

    I am experimenting with PeekMessage because I had that working to interrupt long running reports using the ESC key and it work fine with code like the following:

    Code:
    SUB NewEvent
          STATIC Msg AS tagMsg, n2 AS DWORD, n1 AS DWORD
          DO
             IF PeekMessage(Msg, %NULL, 0, 0, %PM_REMOVE) THEN
                IF Msg.Message = %WM_QUIT THEN StopCmd = %True: EXIT DO
                IF Msg.Message = %WM_KEYDOWN AND msg.wparam = 27 AND TRAP_ABORT THEN ABORT_KEY$ = CHR$(27): EXIT DO
                IF IsDialogMessage(hDlg, Msg) = %FALSE THEN  ' Don't touch Tab
                   TranslateMessage Msg
                   DispatchMessage Msg
                END IF
             ELSE
                n2 = GetTickCount: IF n1 = 0 THEN n1 = n2
                IF ABS(n2 - n1) > 100 THEN SLEEP 10: n1 = GetTickCount
                EXIT DO
             END IF
          LOOP
    END SUB
    Any help would be appreciated

    Bob Mechler
Working...
X