-2

I want to get main frame window. How to get main frame window in WTL-MDI?

class CChildFrame : public CMDIChildWindowImpl<CChildFrame>
{
    ...
    LRESULT OnEdit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)
    {
        ...
        mainfrm->FlashWindow(TRUE);
        return 1;
    }
}
Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • 1
    You have project templates, which show you how. You should mentioned what you have tried. You need to show some code. – Roman R. Oct 07 '12 at 12:38

1 Answers1

0

The WTL base classes CMDIChildWindowImpl, CFrameWindowImplBase don't hold a pointer to main frame. It does not mean that you cannot do it yourself, you derive from these classes so you can pass the pointer explicitly as a part of initialization, and use it from there. After all you always have parent HWND in the child window class, so you can send an application defined message to exchange with certain information with the parent window.

Roman R.
  • 68,205
  • 6
  • 94
  • 158