Why does OnMouseMove fire repeatedly when the mouse is not moving in D2010?

"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!

My psychic debugging sense tells me that you are on Windows, the label is a tooltip window and you are updating on every mousemove In all seriousness, I've seen this exact thing with tooltip window when we switched to Vista. It seems that more recent versions of the Windows tooltip window somehow generate WM_MOUSEMOVE messages when you update them. The only fix I could find was to only update the label when the text actually changes So, If you aren't on windows, Ignore me.

But if you are on Windows, try updating the label text only when it actually changes.

My psychic debugging sense tells me that you are on Windows, the label is a tooltip window and you are updating on every mousemove. In all seriousness, I've seen this exact thing with tooltip window when we switched to Vista. It seems that more recent versions of the Windows tooltip window somehow generate WM_MOUSEMOVE messages when you update them.

The only fix I could find was to only update the label when the text actually changes. So, If you aren't on windows, Ignore me. But if you are on Windows, try updating the label text only when it actually changes.

Very lame psychic debugging, as Delphi 2010 is Win32-only. :-) – Ken White Dec 31 '09 at 20:23 Should have included: and TLabel is a standard Windows label control and not a tooltip window. – Ken White Dec 31 '09 at 20:29 Ah, that sort of kills it then.

Must be something else. Should I delete this comment? – John Knoeller Dec 31 '09 at 20:32 Nah, don't delete it.It might be useful to someone else who runs across it.

Just couldn't pass up the chance. :-) You'll notice I made sure to include the grin and smile, though. – Ken White Dec 31 '09 at 21:00 @John : Thanks for not deleting it.

I googled "Windows 7 mouse move repeatedly" and this was the first result. I'm programming in . Net and I recently had this very problem under Windows 7 and it was solved by not refreshing the tooltip if the text had not changed.

– Mathieu Pagé Dec 31 '097 at 16:56.

Mason, I can't reproduce this is a new D2010 (Update 4 & 5) VCL Forms application on Windows XP SP2. Here's what I did: File|New|VCL Forms Application Dropped a TImage and TLabel on the form Picked a random image out of the default images folder (GreenBar. Bmp) for the TImage.

Picture Double-clicked the TImage. OnMouseMove event in the Object Inspector, and added the following code: procedure TForm1. Image1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin Label1.

Caption := Format('X: %d Y: %d', X, Y); end; Ran the application (F9). The label showed "Label1" (the default caption, of course) until I first moved the mouse over the image. It then updated correctly to show the X and Y coordinates.As soon as I moved the mouse pointer out of the image, the label stopped updating.

It appears to be something in your specific code, or something specific to the version of Windows you're using, and not Delphi 2010 itself.

This is in Vista, in case it helps. – Mason Wheeler Dec 31 '09 at 20:30 @Ken I think that in Mason's example mouse position is updated even when he is not moving it. Therefore, you should test it also by for example incrementing some variable each time the event is fired up cause on a fast graphic card flickerking might be not visible for the same caption values.

– Wodzu Dec 31 '09 at 20:44 @Wodzu: That was the purpose of using the mouse position (X and Y, passed as parameters to the event handler) and Format(). It takes time to call the function and update the label, and it's done rapidly as the mouse moves quickly across the image. Moving off the image quickly as well, the label stops updating.

– Ken White Dec 31 '09 at 20:58 @Mason: I don't have a Vista machine here, and don't have D2010 installed on one any longer (upgraded to Win7 on that machine). – Ken White Dec 31 '09 at 21:01 @Ken yes, but what if the mouse is NOT moving and still the event is beeing fired? On a quick machine you may not notice the refresh of the label and the caption will stay the same.

– Wodzu Dec 31 '097 at 20:51.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions