Dockable Windows?

I have made an MDI application and would like to make the child windows
dockable, that is when they near any side of the parent window they will
jump and stick to that side.

I have tried a few ways to no avail and I shall list them here in case
anyone has any ideas.

I tried using the mouse up and mouse down handlers but these only work in
the client area of the form not in that blue bit at the top(forget its name)
that moves the window.

I then tried to do this using the OnIdle method of the application testing
to see if the windows were close to the edge of the main window.

Anyway hope someone can help me.

Thank you for your time

Gareth Watson