tags:

views:

195

answers:

1

I'm working on a MFC C++ dialog where I need to respond to right mouse click events for a dialog even if the mouse is hovering over a control.

I could write event handler code for each control to delegate the work to the parent dialog, but I'm hoping there is a more elegant solution?

I'm hoping there is some way to intercept the windows messages, but I'm still figuring that part out. I've tried listening to the WM_COMMAND messages with Spy++ but I didn't see what I needed.

Any suggestions?

+4  A: 

You could set up a hook to intercept mouse messages. Take a look at SetWindowsHookEx and WH_MOUSE

Alan
Yep, thats working really well! Thanks!
Greg Malcolm