This Container has some items (which works as button, items are not
CWnd derived, it just paints itself on container, it keeps pointer to
container).
On WM_LBUTTONDOWN on item, item send WM_COMMAND to container.
Problem is : When I get WM_LBUTTONDOWN on part of container which work
as
item, I Send WM_COMMAND, but than I don't get WM_LBUTTONUP message.
(Even in PretranslateMsg() WM_LBUTTONUP doesn't comes).Why??
Try posting your WM_COMMAND using PostMessage rather than SendMessage.
If that doesn't work, check with Spy++ if you get the button up
notification without your button down handler present. If you then see
the button up message, it implies whatever you're doing in your
handler is preventing the default behaviour that would generate the
button up message.
Dave
If I don't send WM_COMMAND, then container receives WM_LBUTTONUP
I just Send WM_COMMAND by PostMessage() method.
Spy++ also doesn't show WM_LBUTTONUP message on that window
Note that if you say
void CMyWindow::OnLButtonDown(UINT flags, CPoint pt)
{
...do some stuff
GetParent()->SendMessage(WM_COMMAND, ...);
}
void CMyParent::OnMyCommand()
{
... stuff
}
then this is not going to help, because the omitted parts are the critical parts. While
you don't have to reveal anything proprietary, you really do have to tell us what you are
doing in terms of Windows itself. For example, popping up a dialog in the OnCommand
handler would definitely mess you over.
Also, if you care about the WM_LBUTTONUP message, really, really care, then you should
probably SetCapture in the child window handler, and do nothing along the way that could
interfere with that capture.
But without seeing what Windows APIs you are calling along the way, there is no way to
tell what is going wrong. Also show your message map entry that routes to your command
handler.
joe
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm