欢迎来到天天文库
浏览记录
ID:34724429
大小:69.18 KB
页数:6页
时间:2019-03-10
《mfc操作ie浏览器例子》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、//IEAboutDlg.cpp:实现文件//#include"stdafx.h"#include"IEAbout.h"#include"IEAboutDlg.h"#include"afxdialogex.h"#ifdef_DEBUG#definenewDEBUG_NEW#endif//用于应用程序“关于”菜单项的CAboutDlg对话框classCAboutDlg:publicCDialogEx{public:CAboutDlg();//对话框数据enum{IDD=IDD_ABOUTBOX};protected:virtualvoid
2、DoDataExchange(CDataExchange*pDX);//DDX/DDV支持//实现protected:DECLARE_MESSAGE_MAP()};CAboutDlg::CAboutDlg():CDialogEx(CAboutDlg::IDD){}voidCAboutDlg::DoDataExchange(CDataExchange*pDX){CDialogEx::DoDataExchange(pDX);}BEGIN_MESSAGE_MAP(CAboutDlg,CDialogEx)END_MESSAGE_MAP()//C
3、IEAboutDlg对话框CIEAboutDlg::CIEAboutDlg(CWnd*pParent/*=NULL*/):CDialogEx(CIEAboutDlg::IDD,pParent){m_hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME);}voidCIEAboutDlg::DoDataExchange(CDataExchange*pDX){CDialogEx::DoDataExchange(pDX);}BEGIN_MESSAGE_MAP(CIEAboutDlg,CDialogEx)ON_WM
4、_SYSCOMMAND()ON_WM_PAINT()ON_WM_QUERYDRAGICON()ON_BN_CLICKED(IDC_BTN_TEST,&CIEAboutDlg::OnBnClickedBtnTest)END_MESSAGE_MAP()//CIEAboutDlg消息处理程序BOOLCIEAboutDlg::OnInitDialog(){CDialogEx::OnInitDialog();//将“关于...”菜单项添加到系统菜单中。//IDM_ABOUTBOX必须在系统命令范围内。ASSERT((IDM_ABOUTBOX&0x
5、FFF0)==IDM_ABOUTBOX);ASSERT(IDM_ABOUTBOX<0xF000);CMenu*pSysMenu=GetSystemMenu(FALSE);if(pSysMenu!=NULL){BOOLbNameValid;CStringstrAboutMenu;bNameValid=strAboutMenu.LoadString(IDS_ABOUTBOX);ASSERT(bNameValid);if(!strAboutMenu.IsEmpty()){pSysMenu->AppendMenu(MF_SEPARATOR);p
6、SysMenu->AppendMenu(MF_STRING,IDM_ABOUTBOX,strAboutMenu);}}//设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动//执行此操作SetIcon(m_hIcon,TRUE);//设置大图标SetIcon(m_hIcon,FALSE);//设置小图标//TODO:在此添加额外的初始化代码returnTRUE;//除非将焦点设置到控件,否则返回TRUE}voidCIEAboutDlg::OnSysCommand(UINTnID,LPARAMlParam){if((nID&0x
7、FFF0)==IDM_ABOUTBOX){CAboutDlgdlgAbout;dlgAbout.DoModal();}else{CDialogEx::OnSysCommand(nID,lParam);}}//如果向对话框添加最小化按钮,则需要下面的代码//来绘制该图标。对于使用文档/视图模型的MFC应用程序,//这将由框架自动完成。voidCIEAboutDlg::OnPaint(){if(IsIconic()){CPaintDCdc(this);//用于绘制的设备上下文SendMessage(WM_ICONERASEBKGND,rei
8、nterpret_cast(dc.GetSafeHdc()),0);//使图标在工作区矩形中居中intcxIcon=GetSystemMetrics(SM_CXICON);intcyIcon
此文档下载收益归作者所有