views:

265

answers:

1

I have a class derived from CDockablePane. I need to do something when the view is focused, so I handle WM_SETFOCUS and it all works nicely most of the time.

But when the pane is docked in Tabbed Document mode (TDI), and the user activates it, the WM_SETFOCUS is not called.

I used Spy and noticed the WM_MDIACTIVATE message is sent to the pane's parent window.

However if I handle WM_MDIACTIVATE inside the pane or inside the mainframe, it does not get called either.

Any ideas what I need to handle?

A: 

You may need to inherit the frame class and trigger the sending of a custom message to your views when WM_MDIACTIVATE is received by the frame.

Aidan Ryan