When I try to drag my window with this the window jumps and flickers around:
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_MOVE)
{
int x = (m.LParam.ToInt32() & 0xffff);
int y = ((m.LParam.ToInt32() >> 16) & 0xffff);
if (x < 500)
Location = new Point(0, y);
else
base.WndProc(ref m);
}
else
base.WndProc(ref m);
}
- must stop jumping
WM_MOVE
,WM_MOVING
,WM_WINDOWPOSCHANGING
or other move event must continue firing while dragging the window because I want every new position to be checked.- another problem is
Location = new Point(0, y);
fires another move event (this one should be ignored)
Please help!