Click here to Skip to main content
15,880,972 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.
Posted
Updated 6-Jul-19 8:58am
v3
Comments
Sergey Alexandrovich Kryukov 26-Jul-13 0:46am    
First of all, please stop posting non-answers as "solution". It can give you abuse reports which eventually may lead to cancellation of your CodeProject membership.
Comment on any posts, reply to available comments, or use "Improve question" (above).
Also, keep in mind that members only get notifications on the post sent in reply to there posts.
—SA
xuyunhai 26-Jul-13 2:35am    
you mean's that i could not modify my post,only way is improve quetion?
Sergey Alexandrovich Kryukov 26-Jul-13 2:42am    
Why told you so? You can modify any of your posts anytime, of course.

Only you should not abuse posting. I found that you posted some content as "solutions", but those posts are not solutions. Posting via "Add your solution here" is in fact reserved for the cases when you try to help some member by responding to this member's question and giving some useful suggestion, advice, etc. You should not use it for anything else.

—SA
xuyunhai 26-Jul-13 2:51am    
i understand,not only accept solution,but also post via "Add your solution here"。
Sergey Alexandrovich Kryukov 26-Jul-13 3:01am    
Do you mean accepting your own solution, or some other one? Accepting your own I would call cheating, but no, you did not do it, which is good.
—SA

1 solution

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.
 
Share this answer
 
Comments
xuyunhai 26-Jul-13 2:47am    
yeah,you're right,i had seen the msdn.
but i mean's how to get the mouse x and y coordinates in the client.
maybe i didn't explain very well.
KarstenK 26-Jul-13 4:04am    
google: "get mouse coordinates c++"

if you where me collegue friend: that makes a icecream or a beer ;-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900