如何计算邮寄消息的位置? [英] how to calculate postmessage's position?

查看:80
本文介绍了如何计算邮寄消息的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想使用发送单击消息的postmessage API时,我想知道如何计算组件的位置?



i知道位置的第四个参数,公式是x + y * 65536。

但我不知道如何得到x和y的值?

--------- -------------------------------------------------- -------------------------------------

也许我没有解释得非常好,

i意味着如何在客户端获取鼠标x和y坐标。

获得x和y坐标后,如何计算和设置第四个参数。

所以我可以点击我需要的地方。

解决方案

你还没读过msdn吗? :mad:



http://msdn.microsoft.com/en-us/library/windows/desktop/ms645616(v = vs.85).aspx [ ^ ]





他们写的是:



Quote:

lParam

低位字指定光标的x坐标。坐标相对于客户区的左上角。

高位字指定光标的y坐标。坐标相对于客户区的左上角。





x和y是在客户端点击鼠标的坐标。 / BLOCKQUOTE>

when i want to use postmessage API that send single click message,i want to know how to calculate the component's position?

i konw the forth parameter that is position,the formula is that x+y*65536。
But i don't know how to get x and y's value?
------------------------------------------------------------------------------------------------
maybe i didn't explain very well,
i mean's how to get the mouse x and y coordinates in the client.
after got the x and y coordinates,how to calculate and set the forth parameter.
so that i can click somewhere that i need.

解决方案

havent you read the msdn? :mad:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms645616(v=vs.85).aspx[^]


They is written:

Quote:

lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.



x and y are the coordinates which got the mouse click in the client.


这篇关于如何计算邮寄消息的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆