⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 framewndex.cpp

📁 一个多窗口的浏览器的程序benbrowse
💻 CPP
字号:
/////////////////////////////////////////////////////////////////////////////
// FrameWndEx.cpp: implementation of the frame classes.
//
/////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2001 by Nikolay Denisov. All rights reserved.
//
// This code is free for personal and commercial use, providing this 
// notice remains intact in the source files and all eventual changes are
// clearly marked with comments.
//
// You must obtain the author's consent before you can include this code
// in a software library.
//
// No warrantee of any kind, express or implied, is included with this
// software; use at your own risk, responsibility for damages (if any) to
// anyone resulting from the use of this software rests entirely with the
// user.
//
// Please email bug reports, bug fixes, enhancements, requests and
// comments to: nick@actor.ru
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "FrameWndEx.h"
//#include "WindowListDialog.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

/////////////////////////////////////////////////////////////////////////////
// CFrameWndEx


/////////////////////////////////////////////////////////////////////////////
// CMDIClientWndEx


/////////////////////////////////////////////////////////////////////////////
// Implementation


/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
// CMDIFrameWndEx

IMPLEMENT_DYNCREATE( CMDIFrameWndEx, CMDIFrameWnd )

CMDIFrameWndEx::CMDIFrameWndEx()
{
}

CMDIFrameWndEx::~CMDIFrameWndEx()
{
}

/////////////////////////////////////////////////////////////////////////////
// Overrides

void CMDIFrameWndEx::DelayUpdateFrameMenu( HMENU hMenuAlt )
{
    // This function seems to be called by the framework only two times
    // when in-place activation begins and ends.

    if ( m_bInPlace )
    {
        CMenu* pFrameMenu = GetMenu();
        VERIFY( SetMenu( 0 ) );
        if ( pFrameMenu != 0 )
        {
            BOOL bMaximized;
            CMDIChildWnd* pActive = MDIGetActive( &bMaximized );
            if ( ( pActive!= 0 ) && bMaximized )
            {
                if ( pFrameMenu->GetSubMenu( 0 ) == pActive->GetSystemMenu( FALSE ) )
                {
                    VERIFY( pFrameMenu->RemoveMenu( 0, MF_BYPOSITION ) );
                    VERIFY( pFrameMenu->DeleteMenu( SC_MINIMIZE, MF_BYCOMMAND ) );
                    VERIFY( pFrameMenu->DeleteMenu( SC_RESTORE, MF_BYCOMMAND ) );
                    VERIFY( pFrameMenu->DeleteMenu( SC_CLOSE, MF_BYCOMMAND ) );
                    VERIFY( pActive->ModifyStyle( 0, WS_SYSMENU ) );
                }
            }
        }
    }

    m_bInPlace = !m_bInPlace;

    CMDIFrameWnd::DelayUpdateFrameMenu( hMenuAlt );
}

void CMDIFrameWndEx::OnUpdateFrameTitle( BOOL bAddToTitle )
{
    CFrameWndBase< CMDIFrameWnd >::OnUpdateFrameTitle( bAddToTitle );

    // If our MDIChildFrame was created with ( WS_VISIBLE | FWS_ADDTOTITLE )
    // styles, then we have to refresh Window menu in order to reflect
    // MDIChildFrame title changes.  CMDIChildWnd::OnUpdateFrameTitle()
    // calls CMDIFrameWnd::OnUpdateFrameTitle(), so here we go.
//    VERIFY( m_wndMDIClient.PostMessage( WM_MDIREFRESHMENU ) );
}

/////////////////////////////////////////////////////////////////////////////
// CMDIFrameWndEx message handlers

BEGIN_MESSAGE_MAP(CMDIFrameWndEx, CMDIFrameWnd)
    //{{AFX_MSG_MAP(CMDIFrameWndEx)
    ON_WM_CREATE()
    ON_WM_SYSCOMMAND()
    ON_WM_MENUCHAR()
    ON_WM_NCACTIVATE()
    ON_WM_SETTINGCHANGE()
    ON_WM_CLOSE()
    ON_WM_INITMENUPOPUP()
    ON_WM_MENUSELECT()
    ON_WM_DRAWITEM()
    ON_WM_MEASUREITEM()
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()

int CMDIFrameWndEx::OnCreate( LPCREATESTRUCT lpCreateStruct )
{
    if ( CFrameWndBase< CMDIFrameWnd >::OnCreate( lpCreateStruct ) == -1 )
    {
        return -1;
    }

//    VERIFY( m_wndMDIClient.SubclassWindow( m_hWndMDIClient ) );

    return 0;
}


/////////////////////////////////////////////////////////////////////////////
// CMDIChildWndEx

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -