Reputation: 9672
I have a situation where I have a main window with a toolbar containing some edit fields.
We want the user to be able to keep focus in the edit fields and still be able to right click on the view window (both descendents of the same main window, same thread).
In current tests, I see that the focus messages happen even before the view receives the RMB down message:
I don't want to have the edit retain focus no matter what: just maintain focus if the user tries to do an RMB click on the view.
Because the focus stuff happens first, I'm a bit at a loss as to how to tell that what's about to happen is the right mouse button down.
Upvotes: 0
Views: 1377
Reputation: 942438
Start by turning on the WS_EX_NOACTIVATE style flag on the right-clicked window. That stops the window manager from automatically activating the clicked window.
Upvotes: 1