-2

メインフレームウィンドウを取得したい。WTL-MDI でメイン フレーム ウィンドウを取得するには?

class CChildFrame : public CMDIChildWindowImpl<CChildFrame>
{
    ...
    LRESULT OnEdit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)
    {
        ...
        mainfrm->FlashWindow(TRUE);
        return 1;
    }
}
4

1 に答える 1

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.

于 2012-10-08T12:02:44.743 に答える