When MDI menu is activated by pressing Alt-key or via
mouse click, the command bar steals the focus from the
currently active pane/bar or child frame. Although
CBR_EX_ALTFOCUSMODE flag allows restoring the focus
to the previous state and TakeFocus/GiveFocusBack can
be overridden, it is not exactly what could be needed.
For example, I may want to alter the menu items
depending on where the focus resides (pane or child
frame), or to dispatch a command message to the focus
window (not necessarily a child frame). Also, if I have a
caption of docked pane drawn in active or inactive color
depending on the focus, the caption becomes inactive
when menu is activated and it is not obvious where the
command will be routed.
Instead of capturing the focus, a keyboard hook could
redirect inputs from active window to the command bar.
This would simulate the behavior of standard menu.
Thanks a lot.