Lost MouseMove messages

  • Thread starter Thread starter bryanbassett
  • Start date Start date
B

bryanbassett

I have a custom WinForms control that allows the user to draw with a
black pen in the control area. I use OnMouseDown, OnMouseMove,
OnMouseUp to get the points and draw a line between each point.

I find that if another control in my app uses a lot of UI thread time
(renders a jpeg in the OnPaint), that I completely lose a whole bunch
of MouseMove points. I would expect them to stay queued and I would
process them once the jpeg is done. But instead I get a huge gap in
the points.

Can someone confirm this is expected behavior? At what level
(Windows, WinForms) is it occurring?

I am running on Windows CE 5 using the Compact Framework 2.0. I also
used CF 3.5.

Bryan
 
I find that if another control in my app uses a lot of UI thread time
(renders a jpeg in the OnPaint), that I completely lose a whole bunch
of MouseMove points.

This is expected behavior on the desktop. The window manager coalesces
WM_MOUSEMOVE messages and delivers only the latest one. I expect it's the
same on CE.

See
http://msdn2.microsoft.com/en-us/library/ms645601(VS.85).aspx#_win32_Mouse_Messages

I would render the jpeg in the background and then just display the latest
available version in OnPaint.
I am running on Windows CE 5 using the Compact Framework 2.0. I also
used CF 3.5.

You might want to check with a CE group to see if there are other solutions
for your scenario other than handling mousemoves (such as the Tablet API on
the desktop).

--Rob
 
Back
Top