I need to send a WM_KEYDOWN message to all the Child Windows in my MDI app. The idea being that a particular key press refreshes a window and I want to refresh all child wnds at just a single key press. Other than refresh there would be couple of more such functions like right/left/up/down arrow keys etc. that need to go to each of these child wnds.
I am maintaining a list of all the available/eligible Child Windows in an STL List (being done during child window/view creation). Now, where can I capture a key press and pass it on to ALL the child windows in this list? Some specifics of the implementation would be appreciated as well.
After some soul and internet searching, I have came to conclusion that SendMessageToDescendants should be helpful. Now: 1. Where to call SendMessageToDescendants from 2. How to pass the params required by CView's OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) to void SendMessageToDescendants( UINT message, WPARAM wParam = 0, LPARAM lParam = 0, BOOL bDeep = TRUE, BOOL bOnlyPerm = FALSE );