Board index » delphi » Application.ProcessMessages inside event handler?

Application.ProcessMessages inside event handler?

I wish to check for other events while in a MouseMove handler.
I have included a lock to reprevent recursion but during rapid mouse
movement I get a GPF error.

In simple form,  the code looks like

var
busy:Boolean;

procedure TMainForm.PaintBoxMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);

begin
  if not busy then
  begin
      busy:=True;
      {do something else}
       Application.processMessages;
      busy:=false;
  end;
end;

Obviously something else is going on that I am not aware of. Any ideas?  Thanks.

=========================================================================
Peter Howlett
Kinetix
Perth,
Western Australia <-- California lifestyle without the guns or traffic!!
=========================================================================

 

Re:Application.ProcessMessages inside event handler?


Sorry, false alarm by the original author.

However, sending this item did help me to find the problem. I was forced
to actually implement my "simplified example" and guess what - it worked!
The problem lay elsewhere.

Next time I'll do it before posting!

=========================================================================
Peter Howlett
Kinetix
Perth,
Western Australia <-- California lifestyle without the guns or traffic!!
=========================================================================

Other Threads