Capture Form Move - Start and Stop

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?
 
S

Stoitcho Goutsev \(100\)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top