資源簡介
自己用mfc的htmlview做的瀏覽器,帶收藏夾功能,可繼續動態添加網站

代碼片段和文件信息
//?MainFrm.cpp?:?implementation?of?the?CMainframe?class
//
#include?“stdafx.h“
#include?“web.h“
#include?“MainFrm.h“
#include?“webview.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CMainframe
IMPLEMENT_DYNCREATE(CMainframe?CframeWnd)
BEGIN_MESSAGE_MAP(CMainframe?CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code?!
ON_COMMAND_RANGE(0xe00?0xfff?OnFavorite)
ON_WM_CREATE()
//}}AFX_MSG_MAP
ON_COMMAND(IDOKOnNew)
END_MESSAGE_MAP()
static?UINT?indicators[]?=
{
ID_SEPARATOR???????????//?status?line?indicator
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?construction/destruction
CMainframe::CMainframe()
{
//?TODO:?add?member?initialization?code?here
}
CMainframe::~CMainframe()
{
}
int?CMainframe::OnCreate(LPCREATESTRUCT?lpCreateStruct)
{
CImageList?img;
CString?str;
if?(CframeWnd::OnCreate(lpCreateStruct)?==?-1)
return?-1;
if?(!m_wndToolBar.CreateEx(this)?||
!m_wndToolBar.LoadToolBar(IDR_MAINframe))
{
TRACE0(“Failed?to?create?toolbar\n“);
return?-1;??????//?fail?to?create
}
if?(!m_wndDlgBar.Create(this?IDR_MAINframe?
CBRS_ALIGN_TOP?AFX_IDW_DIALOGBAR))
{
TRACE0(“Failed?to?create?dialogbar\n“);
return?-1; //?fail?to?create
}
if?(!m_wndReBar.Create(this)?||
!m_wndReBar.AddBar(&m_wndToolBar)?||
!m_wndReBar.AddBar(&m_wndDlgBar))
{
TRACE0(“Failed?to?create?rebar\n“);
return?-1;??????//?fail?to?create
}
if?(!m_wndStatusBar.Create(this)?||
!m_wndStatusBar.SetIndicators(indicators
??sizeof(indicators)/sizeof(UINT)))
{
TRACE0(“Failed?to?create?status?bar\n“);
return?-1;??????//?fail?to?create
}
//?TODO:?Remove?this?if?you?don‘t?want?tool?tips
m_wndToolBar.SetBarstyle(m_wndToolBar.GetBarstyle()?|
CBRS_TOOLTIPS?|?CBRS_FLYBY);
UpdateMenu();
return?0;
}
void?CMainframe::UpdateMenu()
{
//生成“我的收藏夾”子菜單
char????????????path[MAX_PATH];
CMenu*??????????pMenu;
//?開始消去存在的菜單
pMenu=GetMenu()->GetSubMenu(4);
TRACE(“%d“pMenu->GetMenuItemCount());
// TRACE(“%d“pMenu->GetMenuItemCount());
while(pMenu->DeleteMenu(0?MF_BYPOSITION));
SHGetSpecialFolderPath(NULL?path?CSIDL_FAVORITES?FALSE);
????//添加我的收藏菜單項
BuildFavoritesMenu(path?0?pMenu);
}
BOOL?CMainframe::PreCreateWindow(CREATESTRUCT&?cs)
{
if(?!CframeWnd::PreCreateWindow(cs)?)
return?FALSE;
//?TODO:?Modify?the?Window?class?or?styles?here?by?modifying
//??the?CREATESTRUCT?cs
return?TRUE;
}
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?diagnostics
#ifdef?_DEBUG
void?CMa
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????6649??2011-06-29?16:33??web\MainFrm.cpp
?????文件???????1885??2011-06-29?16:33??web\MainFrm.h
?????文件???????4239??2011-06-29?01:18??web\ReadMe.txt
?????文件???????1198??2011-06-29?01:51??web\res\Toolbar.bmp
?????文件???????1078??2011-06-29?01:18??web\res\web.ico
?????文件????????395??2011-06-29?01:18??web\res\web.rc2
?????文件???????1078??2011-06-29?01:18??web\res\webDoc.ico
?????文件???????1057??2011-06-29?15:16??web\resource.h
?????文件????????205??2011-06-29?01:18??web\StdAfx.cpp
?????文件???????1103??2011-06-29?01:18??web\StdAfx.h
?????文件???????1263??2011-06-29?16:38??web\URL.cpp
?????文件???????1177??2011-06-29?16:38??web\URL.h
?????文件??????44468??2011-06-29?16:40??web\web.aps
?????文件???????2637??2011-06-29?16:55??web\web.clw
?????文件???????4155??2011-06-29?01:18??web\web.cpp
?????文件???????4506??2011-06-29?02:31??web\web.dsp
?????文件????????531??2011-06-29?01:18??web\web.dsw
?????文件????2224177??2011-06-29?16:55??web\web.exe
?????文件???????1323??2011-06-29?01:18??web\web.h
?????文件??????58368??2011-06-29?16:55??web\web.ncb
?????文件??????51712??2011-06-29?16:55??web\web.opt
?????文件???????1803??2011-06-29?16:55??web\web.plg
?????文件??????12512??2011-06-29?16:40??web\web.rc
?????文件???????1682??2011-06-29?01:18??web\webDoc.cpp
?????文件???????1442??2011-06-29?01:18??web\webDoc.h
?????文件???????3624??2011-06-29?16:33??web\webView.cpp
?????文件???????1965??2011-06-29?16:10??web\webView.h
?????目錄??????????0??2011-06-29?01:51??web\res
?????目錄??????????0??2011-06-29?16:55??web
-----------?---------??----------?-----??----
............此處省略2個文件信息
評論
共有 條評論