Get rid of mouse messages?

Hi,

I'm programming a screen saver. I'm using a article by Mark R Johnson about
an screen saver prototype (http://www.dfrontiers.com/delphi/m_mj12.html, lots
of thanks to him) which does not use the windows screen saver api functions
but seemed to be easy to implement. But there is no support for passwords.
Now this is my problem.

I set the Application.OnMessage to an procedure of the form which covers the
screen. This message handler looks for WM_KEYDOWN an WM_MOUSEMOVE messages.
On this events a procedure is called which shows a password dialog. If the
password is okay, this procedure closes the application.
But if not the PasswordDlg pops up again and again until the user enters the
correct password. I found, that if I only look for key events, this behaviour
does not occur. It seems to me, that the first mouse move message is not
deleted after handling or there is a whole queue full with them. How can I
get rid of these messages after having them handled?

Volker

P.S.:
Some code snippets:

var
  crs          : TPoint;

procedure TFormScreen.FormScreenMessageHook(var Msg : TMsg; var Handled :
boolean);
var
  done : boolean;
begin
  if Msg.message = WM_MOUSEMOVE then
    done := (Abs(LOWORD(Msg.lParam) - crs.x) > 5) or
            (Abs(HIWORD(Msg.lParam) - crs.y) > 5)
  else
    done := (Msg.message = WM_KEYDOWN) or (Msg.message = WM_ACTIVATE) or
            (Msg.message = WM_ACTIVATEAPP) or (Msg.message = WM_NCACTIVATE);

  if done then begin
    Handled := true;
    AskPassword;
  end;
end; {TScrnFrm.FormScreenMessageHook}

procedure TFormScreen.FormShow(Sender: TObject);
begin
...
  GetCursorPos(crs);
  Application.OnMessage := FormScreenMessageHook;
...
end;

procedure TFormScreen.AskPassword;
var
  Res : integer;
begin
  Application.OnMessage := nil;
  if not PasswordDlg.Visible
     and (length(FormConfiguration.ePassword.Text) > 0)
  then begin
    Res := PasswordDlg.ShowModal;
    if     PasswordDlg.OKPressed
      and (PasswordDlg.Password.Text
           = FormConfiguration.ePassword.Text)
    then begin
      Close;
      exit;
    end;
  end;
  Application.OnMessage := FormScreenMessageHook;
end;