Capture Form Move - Start and Stop

  • Thread starter Thread starter johns1111
  • Start date Start date
J

johns1111

Hi,

I want to capture the move of a form with an override of OnMove, which
works fine.

But I want to register also when a user starts moving a form and when
he releases it, any idea how to accomplish that?

Here is what I tried so far without success:

- Capturing the OnMouseCaptureChanged: As the Capture flag is set
during the form move and is unset after, I expected this event to be
fired, but it isn't. So it does not help...

- Overriding WndProc and capturing WM_NCLMOUSEDOWN, WM_NCLMOUSEUP,
WM_LMOUSEUP: To register the mouse down in the HTCAPTION and the mouse
up as the end of the dragging of the form. I receive the nc mouse down
event, but I never get a mouse up, except if the form is maximized. No
idea, why that is... the form has a sizeable toolbar frame.

Anybody any other ideas?
 
John,

Catch WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE windows messages. These are the
markers that Windows puts et the begining and at the end of the move/resize
modal loop.
 
Back
Top