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

📄 modalframewnd.cpp

📁 VC++ 编程宝典,电子工业出版社,源代码,第三部分
💻 CPP
字号:
// ModalFrameWnd.cpp : implementation file
//

#include "stdafx.h"
#include "ModalWin.h"
#include "ModalFrameWnd.h"

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

/////////////////////////////////////////////////////////////////////////////
// ModalFrameWnd

IMPLEMENT_DYNCREATE(ModalFrameWnd, CFrameWnd)

ModalFrameWnd::ModalFrameWnd()
{
}

ModalFrameWnd::~ModalFrameWnd()
{
}


BEGIN_MESSAGE_MAP(ModalFrameWnd, CFrameWnd)
	//{{AFX_MSG_MAP(ModalFrameWnd)
	ON_WM_CREATE()
	ON_WM_CLOSE()
	ON_WM_LBUTTONDBLCLK()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// ModalFrameWnd message handlers

int ModalFrameWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	
	return 0;
}

void ModalFrameWnd::OnClose() 
{
	// TODO: Add your message handler code here and/or call default
	// Since it will not be destroyed here
	// hide the modal frame window
	ShowWindow( SW_HIDE ); 

	// End the modal loop, started in OnViewGoModal()
	// Return true or any other value you desire
    EndModalLoop( TRUE );

	// Re-enable the main application window
   ::EnableWindow( AfxGetApp()->m_pMainWnd->m_hWnd, TRUE ); 
	 
}

void ModalFrameWnd::OnLButtonDblClk(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	
	CFrameWnd::OnLButtonDblClk(nFlags, point);
	OnClose();
}

⌨️ 快捷键说明

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