首页  编辑  

清空本程序的键盘消息队列

Tags: /超级猛料/Message.消息和事件/   Date Created:

procedure EmptyKeyQueue ;

var

 Msg               : TMsg ;

begin

  while PeekMessage ( Msg , 0 , WM_KEYFIRST , WM_KEYLAST , PM_REMOVE or PM_NOYIELD ) do ;

end ;

procedure EmptyMouseQueue ;

var

 Msg               : TMsg ;

begin

  while PeekMessage ( Msg , 0 , WM_MOUSEFIRST , WM_MOUSELAST , PM_REMOVE or PM_NOYIELD ) do ;

end ;