设为首页 加入收藏

TOP

一个类似QQ窗体自动上卷的程序(二)
2014-11-24 02:41:02 来源: 作者: 【 】 浏览:1
Tags:一个 类似 窗体 自动 上卷 程序
msevnt.cbSize = Marshal.SizeOf(typeof(TRACKMOUSEEVENT));
msevnt.dwFlags = TME_HOVER;
msevnt.hwndTrack = (long)this.Handle;
msevnt.dwHoverTime = 300;


if (m.WParam.ToInt32() == VK_LBUTTON)
{
Point newCursor = GetPointFromLPARAM(m.LParam.ToInt32());
this.Location = new Point(this.Location.X + newCursor.X - this._mouseDownPos.X,
this.Location.Y + newCursor.Y - this._mouseDownPos.Y);
}
}
break;
default:
break;
}
}

///


/// 获得低16位值
///

///
///
public static int GET_X_LPARAM(int lParam) { return (lParam & 0xffff); }


///


/// 获得高16位值
///

///
///
public static int GET_Y_LPARAM(int lParam) { return (lParam >> 16); }
///
/// 解析出鼠标的新坐标(相对于窗体的坐标)
///

///
///
public static Point GetPointFromLPARAM(int lParam)
{ return new Point(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); }


private Point _mouseDownPos = new Point();


private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
}
}


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Linux popen函数的使用总结 下一篇Helix Server多个缓冲区溢出漏洞

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: