Hi All,
I have a borderless form that i can drag around fine when dragging
anywhere on the form by using the following code:
protected override void WndProc(ref Message m)
{
const int WM_NCHITTEST = 0x84;
const int HTCLIENT = 0x01;
const int HTCAPTION = 0x02;
if (m.Msg == WM_NCHITTEST)
{
this.DefWndProc(ref m);
if (m.Result == new IntPtr(HTCLIENT))
{
m.Result = new IntPtr(HTCAPTION);
}
else
{
base.WndProc(ref m);
}
}
else
{
base.WndProc(ref m);
}
}
What i also need to be able to do is detect when the user stops the drag
and lets go of the mouse button. MouseUp does not seem to be firing
when using this code, is that because the code above is somehow 'heading
off' the message so the Up is not getting as far as MouseUp?
Anyway, if someone has any idea on how i could capture the mouseup when
using this drag code i would be most grateful.
Cheers,
Dave