I'm trying to handle OnMouseMove in Delphi (XE3) and even when I don't move the mouse I get endless stream of OnMouseMove events, one after another.
Ex.: start new VCL Forms Application. Add OnMouseMove handler to the form with this code:
var s: string;
begin
s := IntToStr(GetTickCount()) + ': MouseMove';
OutputDebugString(PChar(s));
end;
Place the mouse over the form, observe endless OnMouseMoves in IDE's Messages log.
I would expect MouseMove messages to only arrive when I actually move the cursor (and maybe at some other exceptional situations). In fact, i've always though OnMouseMove worked this way.
Am I doing something wrong? Is this correct from a Delphi standpoint (i.e. by design)? Is this correct by WinAPI? What to do about it?