- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using a call to PEEKCHARQQ in a DLL function (that's called from Delphi) inside of a DO WHILE loop to, hopefully, trap a keystroke such as ESC to end the loop, yet the call ALWAYS returns false, as if nothing is ever in the keyboard buffer. Should PEEKCHARQQ not be used inside of a DLL?
Bill
Bill
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
According to docs, PEEKCHARQQ Checks the keystroke buffer for a recent console keystroke . My reading is that it will work only for applications with console (either real or "overloaded" as in QuickWin). A better way would be to use PeekMessage(...WM_KEYDOWN), or, still better, to use synchronization objects and let the caller decide how to interrupt the calculation if necessary. See ThreadDlg sample for an illustration of the technique.
HTH
Jugoslav
HTH
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right! thanks. PeekMessage is the answer. As a Fortran "old timer" I can't get used to there not being a console all the time.
BILL
BILL

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page