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

📄 modaldlg.cpp

📁 这个程序主要是利用MFC编译的一个可以定制浏览器窗口的程序
💻 CPP
字号:
// ModalDlg.cpp : implementation file
//

#include "stdafx.h"
#include "InternetEx.h"
#include "ModalDlg.h"
#include "mainfrm.h"

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

/////////////////////////////////////////////////////////////////////////////
// CModalDlg dialog


CModalDlg::CModalDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CModalDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CModalDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}


void CModalDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CModalDlg)
	DDX_Control(pDX, IDC_MY_EXPLORER, m_Browser);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CModalDlg, CDialog)
	//{{AFX_MSG_MAP(CModalDlg)
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CModalDlg message handlers

BOOL CModalDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CMainFrame* pParent = (CMainFrame*)GetParent();

	m_cszURL = pParent->m_strModalDlgInfo.cszURL;

	SetWindowPos(NULL, pParent->m_strModalDlgInfo.nLeft, pParent->m_strModalDlgInfo.nTop, pParent->m_strModalDlgInfo.nWidth, pParent->m_strModalDlgInfo.nHeight, NULL);
	COleVariant vEmpty;
	COleVariant vURL;
	vURL = m_cszURL;

	if(m_Browser)
		m_Browser.Navigate2(vURL, vEmpty, vEmpty, vEmpty, vEmpty);	
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CModalDlg::OnSize(UINT nType, int cx, int cy) 
{
	CDialog::OnSize(nType, cx, cy);
	
	// TODO: Add your message handler code here
	CRect rect;
	GetClientRect(&rect);
	if(m_Browser)
		m_Browser.SetWindowPos(NULL,rect.left, rect.top, rect.Width(), rect.Height(), NULL);	
	
}

⌨️ 快捷键说明

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