Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » MDI application & child windows (maximized button) Collapse All
Subject Author Date
Andrew Cochran Nov 27, 2006 - 5:53 AM

Hi, It seems to me that something is wrong here. I write an MDI Application. I want it does’t have minimized, maximized and close buttons and SysMenu in it’s child frame, and I also want all child windows to be always maximized.
I try to remove them by the following code in PreCreateWindow()

cs.style &= ~(WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SYSMENU);

But the following problems appear:
1. All child windows are not maximized when switching using tabs, and they aren’t become (I need them always be maximized).
But if I left WS_MAXIMIZEBOX style - everything is OK, but the button appears.
2. Close button is disabled in the tabwindow and I cannot close any child window using it (I need it be active and work)

Please, help. Where am I wrong?

Andrew Cochran Nov 30, 2006 - 12:48 AM

I’m sorry for my persistence, but there are no any answer from you for hole 3 days.

Is there any problem?
May be there ara problems in my question formulation?

I just need to resolve the problem as soon as possible...

Best regards!

Technical Support Nov 30, 2006 - 8:56 AM

We are really sorry for the delay. The only reason is that we were a bit busy with releasing 2.62.

It is not a bug. We would suggest you that you use another way for making the child window maximized.

First, use the following CExtMenuControlBar-derived class for the menu bar:

class CMyMenuBar : public CExtMenuControlBar
{
public:
    CMyMenuBar()
    {
    }
    bool IsDisplayMdiDocumentButtons() const
    {
        ASSERT_VALID( this );
        return false;
    }
    virtual BOOL TranslateMainFrameMessage(MSG* pMsg)
    {
        ASSERT_VALID( this );
        if( WM_KEYFIRST <= pMsg->message && pMsg->message <= WM_KEYLAST )
        {
            BOOL bAlt = HIWORD(pMsg->lParam) & KF_ALTDOWN;
            BOOL bCtrl = GetKeyState(VK_CONTROL) & 0x80000000;
            if(        (    pMsg->wParam == VK_SUBTRACT
                    ||    pMsg->wParam == 189
                    )
                &&    bAlt
                )
                return TRUE;
            if(        pMsg->wParam == VK_F4
                &&    bCtrl
                )
                return TRUE;
        }
        return CExtMenuControlBar::TranslateMainFrameMessage(pMsg);
    }
};
Second, insert the following lines to the CChildFrame::PreCreateWindow method:
cs.style |= WS_MAXIMIZE;
Finally, override the ActivateFrame method:
void CChildFrame::ActivateFrame(int nCmdShow)
{
    nCmdShow = SW_SHOWMAXIMIZED;
    CMDIChildWnd :: ActivateFrame( nCmdShow );
}


Andrew Cochran Dec 1, 2006 - 2:09 AM

Thank you very much for exhaustive answer.

Now it’s working according to my needs.

:)
Good luck!