WM_LBUTTONDOWN is sent to you when the user clicks your window, not when he clicks a child window.
And your decoding of wParam and lParam only applies to WM_COMMAND messages.

Chris' second post should work.