.NET 处理windows消息中获得LParam中XY坐标的两种方法

1.快速运算获得 通过高级运算符获得

int nPosX = (Msg.LParam.ToInt32() & 65535);
int nPosY = (Msg.LParam.ToInt32() >> 16);

 

2.转换成Point对象 此方法容易使用

Point point = new Point(Msg.LParam.ToInt32());

 

获得Point对象直接访问point.X point.Y就太轻易了

posted on 2010-12-11 00:14  狐狸狡猾不  阅读(1024)  评论(0编辑  收藏  举报

导航



Powered by: 博客园 copyright © 2009-2012 狐狸狡猾不