en en en en en en en en en en en en en en en en en en en en en en en en en en en pt en en en en en en en en en en en en en en en en en en en en en en en nl en pt en en en en en en en en en en en de en en en en en nl en en en en en en en en en en fr en da en en en en en en en nl en en en en en en en en en en en nl en en en en en en en en de en en en fr en en en en en en en en en pt en en en en en en
By logging into your account, you agree to our Privacy Policy, personal data processing and storage practices as described therein.
Forgot password or user name?
Search in titles only Search in PowerBASIC for Windows only
You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
All Time Today Last Week Last Month
All Discussions only Photos only Videos only Links only Polls only Events only
Join Date: Mar 2002
Clearing Windows msg pump
17 Jul 2009, 12:29 PM
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:
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
Join Date: Aug 1998
17 Jul 2009, 01:00 PM
>when a program is starting up
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.
Port Washington WI USA
Join Date: Mar 2002
17 Jul 2009, 01:21 PM
Join Date: Mar 2002
21 Jul 2009, 02:51 PM
Had a popup message with a dialog show modeless with a problem with it's message pump.
Copyright © 1998-2022 PowerBASIC Tools, LLC - All Rights Reserved.
Powered by vBulletin® Version 5.7.0
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
All times are GMT-5. This page was generated at 09:40 PM.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.