Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need to send an extra parameter with SendMessage fn

Status
Not open for further replies.

ArvindKumar17

Programmer
Jan 7, 2003
13
MU
hi friends,
I am using the CWnd::SendMessage function. I am sending the message to the WM_LBUTTONDOWN.
OnLButtonDown(UINT nFlags, CPoint point) contains an extra parameter point of type CPoint which I am unable to send.
I have tried
SendMessage(WM_LBUTTONDOWN, MK_LBUTTON , ???)
What do I put next ? I can put only 3 parameters. 3rd parameter does not accept of type pointer.

regards
-arvind
 
From the MSDN (WM_LBUTTONDOWN):

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.

You'll have to pack the coordinates in the LPARAM of CWnd::SendMessage. MFC will take care of the translation to CPoint when it receives the message.
Greetings,
Rick
 
Hi,
May I Write like this?
LPARAM lParam = MAKELPARAM(pt.x,pt,y);

SendMessage(WM_LBUTTONDOWN, MK_LBUTTON ,lParam);

Cheers
Venkatesh L B
 
Yep, seems perfectly legal to me....
Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top