I have an MDI parent window, where accelerators work fine (Ctrl+N=open, Ctrl+O=close, etc), but only when there are no children open. So my question is, how do I forward the accelerators from children to the parent? Should I just add an OnMenuPick that calls parent->OnMenuPick?
Hmm... Works fine here, are you using the built in message handling?
Yes, both the parent and children use the OnXxx functions. I did override CodeEditor's (the child window) WndProc to handle WM_SETFOCUS.
CodeEditor::WndProc( unsigned int message, unsigned int wparam, unsigned int lparam )
{
MdiParent *parent;
// This strange code is necessary because my parent is actually the MDI client, whose parent is what we want.
parent = GetWindowLong( GetParent( GetParent( m_hWnd ) ), 0 );
int nindex = 0;
int maxtabs = 0;
if( message == WM_SETFOCUS ) && parent
{
maxtabs = parent->tabs->GetTabCount( );
parent->status->SetPaneText( 0, "Focus: " + buffer.filename );
// Find the tab in the parent that associates with me
while( nindex <= maxtabs )
{
if( parent->tabs->GetItemData( nindex ) == this )
{
parent->tabs->SetSelectedTab( nindex );
break;
}
nindex++;
}
return 0;
}
return MDIChildWnd!!WndProc( message, wparam, lparam );
}
MdiParent has an OnMenuPick method. Could the scintilla control have anything to do with it?
I'll look into it. Accelarator messages are supposed to be forwarded to the correct window.
OK think I see the problem. Wait until the next update (rev 3) which I will post this evening.
Cool, thanks for the speedy fix. Right now it's just my code editor, and it doesn't bother me much. No hurry.