In a Delphi 7 application, I want to move a component following the mouse. I’m doing something like this:
procedure MyComponent.MouseMove(Sender: TObject;Shift: TShiftState; X, Y: Integer); begin AnotherComponent.Top := X; AnotherComponent.Left := Y; end;
When I move the mouse the CPU usage for the main core goes up to 100% on a recent PC.
Any idea or tick to reduce the CPU usage in this case ?
Finally I’ve change my code for this one:
Really easy to implement (2 lines added), no timer, works well for me…