Windows with Delphi Windows API (94) Windows Filesystem (41) Windows Forms (69) Windows Graphics (38)
Exchange Links About this site Links to us 
|
Emptying the keyboard queue (key messages)
This article has not been rated yet. After reading, feel free to leave comments and rate it.
Use the procedure below to remove all pending key messages from your own message queue.
Note that you only can empty your own application's message queue, not from that of another process.  | |  | | program Dummy;
procedure EmptyKeyQueue;
var
msg: TMsg;
begin
while PeekMessage(msg, 0, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE or PM_NOYIELD) do;
end;
begin
EmptyKeyQueue;
end. | |  | |  | You don't like the formatting? Check out SourceCoder then!
Comments:
|