ltjax
ltjax

Reputation: 15997

Capturing WM_MOUSEMOVE events in parent window

I have a (parent) window in which a child-window is created by a another library (Ogre3d). Window initialization uses the bare Win32 API.

I'd like to capture the mouse input in my parent window, but it seems like I my WM_MOUSEMOVE events are received only by the child-window, which makes sense, since that fills all of my client-area.

Is there a way to capture the WM_MOUSEMOVE messages in the parent window or (unintrusively) redirect those messages from the child-window?

Upvotes: 3

Views: 3506

Answers (1)

Bukes
Bukes

Reputation: 3718

If you can obtain a handle to the window in question you can subclass it.

In a nutshell, you get to register a callback function that gets a crack at all of the messages sent to the sub-classed window.

The linked article should get you where you need to be.

Upvotes: 4

Related Questions