Missing WM_LBUTTONDOWN

1.1k views Asked by At

I have a very weird behaviour in a screen with a modeless dialog and I cannot find a solution.

I open a modeless dialog by clicking on a button in a view. As the dialog is not modal I should be able to click any other buttons in this view while the dialog is opened. But I cannot. In fact I can not place the focus in any control..edits, buttons, etc.

I have check which messages the view is getting and it seems it doesn't get the WM_LBUTTONDOWN message. But it does get the WM_LBUTTONUP message.

To make things even weirder it just happen in Windows 7 64-bits (no one reported this problem in windows XP and is being used for a long time) and just in some computers. But I cannot find the reason and I don't have a clue about why it happens in these computers.

Does anybody have a clue? Somewhere to start looking at?

Thanks.

Javier

3

There are 3 answers

0
Javier De Pedro On BEST ANSWER

it was a tricky question. The problem happened to be in a custom implementation of the dialogs. They draw it's non-client area with MFC2008 visual styles and when calling OnNcActivate for the visual manager it returned FALSE when Aero and Desktop Window Manager where active. So the dialog was not releasing the control to its child-controls.

Quite tricky as I said.....I just let you know where was the problem just in case someone somewhere ever have a similar problem. I lost two days trying to figure it out.

Thanks.

Javier

0
lb90 On

This is and old question, but for whoever comes here looking for a solution to their problem: beware of the WM_MOUSEACTIVATE message. If either MA_ACTIVATEANDEAT or MA_NOACTIVATEANDEAT is returned, the mouse click will subsequently be ignored.

0
Lei Shi On

you must deal with WM_NCACTIVATE in wrong way. make sure the parent window procedure return TRUE when it receive WM_NCACTIVATE with wparam is FALSE.