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

📄 mywindow.cpp

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

#include "stdafx.h"
#include "InternetEx.h"
#include "MyWindow.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMyWindow dialog


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


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


BEGIN_MESSAGE_MAP(CMyWindow, CDialog)
	//{{AFX_MSG_MAP(CMyWindow)
	ON_WM_SIZE()
	ON_WM_SHOWWINDOW()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyWindow message handlers

BOOL CMyWindow::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CMyWindow::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);
	
}

void CMyWindow::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CDialog::OnShowWindow(bShow, nStatus);
	
	// TODO: Add your message handler code here
	COleVariant vEmpty;
	COleVariant vURL;
	vURL = m_cszURL;
	if(m_Browser)
		m_Browser.Navigate2(vURL, vEmpty, vEmpty, vEmpty, vEmpty);		
	
}

⌨️ 快捷键说明

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