// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#include "stdafx.h"
#include "OutlookDemo.h"
#include "WorkspaceObj.h"
#include "FolderListPopupWnd.h"
#include "PreviewPane.h"
#include "MailFrame.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
BOOL CMyOutlookBar::AllowShowOnPaneMenu() const
{
return m_bMode2003 == ((CMainFrame*)GetParent())->IsOutlookBar2003();
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
const int iMaxUserToolbars = 10;
const UINT uiFirstUserToolBarId = AFX_IDW_CONTROLBAR_FIRST + 40;
const UINT uiLastUserToolBarId = uiFirstUserToolBarId + iMaxUserToolbars - 1;
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_WM_CREATE()
ON_WM_ACTIVATE()
ON_COMMAND(ID_OUTLOOK_ADD_PAGE, OnOutlookAddPage)
ON_COMMAND(ID_OUTLOOK_ANIMATION, OnOutlookAnimation)
ON_COMMAND(ID_OUTLOOK_DELETE_PAGE, OnOutlookDeletePage)
ON_COMMAND(ID_OUTLOOK_RENAME_PAGE, OnOutlookRenamePage)
ON_COMMAND(ID_OUTLOOK_SHOW_TEXT_LABELS, OnOutlookShowTextLabels)
ON_UPDATE_COMMAND_UI(ID_OUTLOOK_RENAME_PAGE, OnUpdateOutlookRenamePage)
ON_UPDATE_COMMAND_UI(ID_OUTLOOK_DELETE_PAGE, OnUpdateOutlookDeletePage)
ON_UPDATE_COMMAND_UI(ID_OUTLOOK_ANIMATION, OnUpdateOutlookAnimation)
ON_UPDATE_COMMAND_UI(ID_OUTLOOK_SHOW_TEXT_LABELS, OnUpdateOutlookShowTextLabels)
ON_COMMAND(ID_RESET_PAGE, OnResetPage)
ON_UPDATE_COMMAND_UI(ID_RESET_PAGE, OnUpdateResetPage)
ON_WM_CLOSE()
ON_UPDATE_COMMAND_UI(ID_OUTLOOK_ADD_PAGE, OnUpdateOutlookAddPage)
ON_WM_SETTINGCHANGE()
ON_WM_ENABLE()
ON_COMMAND(ID_VIEW_CAPTIONBAR, OnViewCaptionbar)
ON_UPDATE_COMMAND_UI(ID_VIEW_CAPTIONBAR, OnUpdateViewCaptionbar)
ON_COMMAND(ID_VIEW_FOLDER_LIST, OnViewFolderList)
ON_UPDATE_COMMAND_UI(ID_VIEW_FOLDER_LIST, OnUpdateViewFolderList)
ON_COMMAND(ID_VIEW_OUTLOOKBAR, OnViewOutlookbar)
ON_UPDATE_COMMAND_UI(ID_VIEW_OUTLOOKBAR, OnUpdateViewOutlookbar)
ON_COMMAND(ID_VIEW_CUSTOMIZE, OnViewCustomize)
ON_REGISTERED_MESSAGE(AFX_WM_RESETTOOLBAR, OnToolbarReset)
ON_REGISTERED_MESSAGE(AFX_WM_TOOLBARMENU, OnToolbarContextMenu)
ON_REGISTERED_MESSAGE(AFX_WM_CREATETOOLBAR, OnToolbarCreateNew)
ON_COMMAND_RANGE(ID_VIEW_GOTO_HOME, ID_VIEW_GOTO_FAVORITES, OnViewWorkSpace)
ON_COMMAND(ID_VIEW_MY_COMPUTER, OnViewMyComputer)
ON_COMMAND(ID_SHOW_FOLDERS_POPUP, OnViewFoldersPopup)
ON_UPDATE_COMMAND_UI(ID_INDICATOR_ANIMATION, OnUpdateIndicatorSendReceive)
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_ANIMATION, // status icon
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction
CMainFrame::CMainFrame() : m_wndFolderList(m_lstWorkspaces, m_ImagesSmall)
{
m_uiHilightedPage = (UINT)-1;
m_pCurrWorkSpace = NULL;
m_pCurrOutlookWnd = NULL;
m_pCurrOutlookPage = NULL;
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOffice2003));
CMFCOutlookBarTabCtrl::EnableAnimation(TRUE);
m_bOutlookBar2003 = FALSE;
}
CMainFrame::~CMainFrame()
{
while (!m_lstWorkspaces.IsEmpty())
{
delete m_lstWorkspaces.RemoveHead();
}
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
CWindowDC dc(NULL);
const BOOL bIsHiColor = dc.GetDeviceCaps(BITSPIXEL) > 16;
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// Load toolbar user images:
if (m_UserImages.Load(_T(".\\Userimages.bmp")))
{
CMFCToolBar::SetUserImages(&m_UserImages);
}
CMFCToolBar::EnableQuickCustomization();
CMFCToolBarComboBoxButton::SetFlatMode();
CMFCToolBar::AddToolBarForImageCollection(IDR_MENU_IMAGES);
// Define basic commands. These commands will appear in
// the menu by default:
SetBasicCommands();
// Create menu bar:
if (!m_wndMenuBar.Create(this))
{
TRACE0("Failed to create menubar\n");
return -1; // fail to create
}
m_wndMenuBar.SetPaneStyle(m_wndMenuBar.GetPaneStyle() | CBRS_SIZE_DYNAMIC);
// Create main toolbar:
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
BOOL bValidString;
CString strMainToolbarTitle;
bValidString = strMainToolbarTitle.LoadString(IDS_MAIN_TOOLBAR);
m_wndToolBar.SetWindowText(strMainToolbarTitle);
// Create advanced toolbar:
if (!m_wndToolBarAdvanced.Create(this, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, ID_VIEW_ADVANCED_TOOLBAR) ||
!m_wndToolBarAdvanced.LoadToolBar(IDR_ADVANCED))
{
TRACE0("Failed to create advanced toolbar\n");
return -1; // fail to create
}
CString strAdvToolbarTitle;
bValidString = strAdvToolbarTitle.LoadString(IDS_ADV_TOOLBAR);
m_wndToolBarAdvanced.SetWindowText(strAdvToolbarTitle);
// Create Web toolbar:
if (!m_wndToolBarWeb.Create(this, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, ID_VIEW_WEB_TOOLBAR) ||
!m_wndToolBarWeb.LoadToolBar(IDR_WEB))
{
TRACE0("Failed to create web toolbar\n");
return -1; // fail to create
}
CString strWebToolbarTitle;
bValidString = strWebToolbarTitle.LoadString(IDS_WEB_TOOLBAR);
m_wndToolBarWeb.SetWindowText(strWebToolbarTitle);
// Create status bar:
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
}
CBitmap bmpAni;
if (bmpAni.LoadBitmap(bIsHiColor ? IDB_ANIMATION_HC : IDB_ANIMATION))
{
m_imlStatusAnimation.Create(16, 16,
(bIsHiColor ? ILC_COLOR8 : ILC_COLOR4) | ILC_MASK, 10, 0);
m_imlStatusAnimation.Add(&bmpAni, RGB(255, 0, 255));
m_wndStatusBar.SetPaneAnimation(1, m_imlStatusAnimation);
m_wndStatusBar.SetPaneStyle(1, SBPS_NOBORDERS);
}
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBarAdvanced.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBarWeb.EnableDocking(CBRS_ALIGN_ANY);
// Outlook bar will be created at left, so temporary disable docking
// at the left side:
EnableDocking(CBRS_ALIGN_TOP | CBRS_ALIGN_BOTTOM | CBRS_ALIGN_RIGHT);
m_wndBarOutlook2003.SetMode2003();
// Create and setup "Outlook" shortcuts bar:
if (!CreateOutlookBar( m_wndBarOutlook, ID_VIEW_OUTLOOKBAR, m_wndOutlookPane1, m_wndOutlookPane2, m_wndTree, m_wndCalendar, 100) ||
!CreateOutlookBar(m_wndBarOutlook2003, ID_VIEW_OUTLOOKBAR2003, m_wndOutlookPane12003, m_wndOutlookPane22003, m_wndTree2003, m_wndCalendar2003, 200))
{
TRACE0("Failed to create outlook bar\n");
return -1; // fail to create
}
m_wndBarOutlook2003.SetButtonsFont(&afxGlobalData.fontBold);
m_wndBarOutlook2003.ShowWindow(SW_HIDE);
CImageList images;
CBitmap bmp;
if (!bmp.LoadBitmap(bIsHiColor ? IDB_OUTLOOK_SMALL_HC : IDB_OUTLOOK_SMALL))
{
return FALSE;
}
BITMAP bm;
bmp.GetBitmap(&bm);
UINT nFlags = ILC_MASK;
if (bIsHiColor)
{
nFlags |= ILC_COLOR24;
}
else
{
nFlags |= ILC_COLOR;
}
m_ImagesSmall.Create(16, bm.bmHeight, nFlags, 0, 0);
m_ImagesSmall.Add(&bmp, RGB(255, 0, 255));
// Create a caption bar:
if (!CreateCaptionBar())
{
TRACE0("Fai
没有合适的资源?快使用搜索试试~ 我知道了~
CMFCOutlookBar
共68个文件
bmp:24个
h:17个
cpp:15个
需积分: 15 18 下载量 155 浏览量
2018-05-25
09:40:54
上传
评论
收藏 2.42MB RAR 举报
温馨提示
很好用的CMFCOutlookBar例子,风格类似vs2008和outlook
资源推荐
资源详情
资源评论
收起资源包目录
OutlookDemo.rar (68个子文件)
OutlookDemo
PreviewPane.cpp 3KB
MailView.h 2KB
AppLookDlg.cpp 4KB
FoldersTree.cpp 2KB
AppLookDlg.h 1KB
UserImages.bmp 8KB
FolderListBar.h 1KB
OutlookDemoDoc.h 2KB
res
mail.bmp 2KB
OutlookDemoDoc.ico 5KB
mail.ico 5KB
outlookl_hc.bmp 33KB
header.bmp 430B
outlooks.bmp 1KB
pages_small_hc.bmp 3KB
pin.bmp 190B
menu_image_hc.bmp 11KB
adnanced.bmp 1KB
OutlookDemo.rc2 407B
OutlookDemo.ico 66KB
list.bmp 5KB
pages1.bmp 630B
outlookl.bmp 6KB
Toolbar.bmp 886B
web_hc.bmp 5KB
web.bmp 1014B
pages_hc.bmp 7KB
animation.bmp 1016B
mail_hc.bmp 12KB
toolbar_hc.bmp 5KB
pages.bmp 1KB
animation_hc.bmp 4KB
outlooks_hc.bmp 8KB
menu_image.bmp 2KB
advanced_hc.bmp 6KB
stdafx.h 2KB
PreviewPane.h 1KB
WorkspaceObj.h 734B
OutlookDemo.sln 4KB
MailBar.h 1KB
MailFrame.h 1KB
CalendarBar.h 1KB
MailBar.cpp 2KB
targetver.h 287B
OutlookDemo.suo 12KB
FoldersTree.h 1KB
OutlookDemo.sdf 10.46MB
OutlookDemo.vcxproj 47KB
OutlookDemo.rc 33KB
OutlookDemoDoc.cpp 6KB
OutlookDemoView.cpp 5KB
FolderListBar.cpp 2KB
WorkspaceObj.cpp 1KB
OutlookDemoView.h 2KB
MailView.cpp 4KB
StdAfx.cpp 209B
MainFrm.cpp 31KB
resource.h 8KB
OutlookDemo.cpp 6KB
MainFrm.h 5KB
MailFrame.cpp 6KB
FolderListPopupWnd.cpp 5KB
FolderListPopupWnd.h 2KB
OutlookDemo.h 1KB
OutlookDemo.vcxproj.filters 6KB
CalendarBar.cpp 4KB
ReadMe.htm 8KB
OutlookDemo.vcxproj.user 143B
共 68 条
- 1
资源评论
Ilson_
- 粉丝: 419
- 资源: 23
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Docker容器配置进阶
- tensorflow-gpu-2.7.4-cp37-cp37m-manylinux2010-x86-64.whl
- 多段线、 圆、弧转多段线(仅我可见)
- tensorflow-2.7.2-cp38-cp38-manylinux2010-x86-64.whl
- yeyue-p8Yi4-ve4a83792.apk
- tensorflow-gpu-2.7.3-cp38-cp38-manylinux2010-x86-64.whl
- 五相感应电机矢量控制模型MATLAB
- RGLED (1) (1).circ
- IMG_20240427_215747.jpg
- python下前端WEB学习笔记
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功