CMFCOutlookBar


很好用的CMFCOutlookBar例子,风格类似vs2008和outlook
资源截图
代码片段和文件信息
// 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 “AppLookDlg.h“
#include “MainFrm.h“

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

/////////////////////////////////////////////////////////////////////////////
// CAppLookDlg dialog

CAppLookDlg::CAppLookDlg(BOOL bStartup CWnd* pParent /*=NULL*/) :
CDialog(CAppLookDlg::IDD pParent) m_bStartup(bStartup)
{
m_nAppLook = 1;
m_bShowAtStartup = FALSE;
m_bOutlookBar2003 = FALSE;
m_nstyle2007 = 0;

m_nAppLook = theApp.GetInt(_T(“AppLook“) 2);
m_bShowAtStartup = theApp.GetInt(_T(“ShowAppLookAtStartup“) TRUE);
m_nstyle2007 = theApp.GetInt(_T(“style2007“) 0);
m_bOutlookBar2003 = theApp.GetInt(_T(“OutlookBar2003“) m_nAppLook == 2);
}

void CAppLookDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX IDC_style2007 m_wndstyle2007);
DDX_Control(pDX IDC_OUTLOOKBAR2003 m_wndOutlookBar2003);
DDX_Control(pDX IDOK m_wndOK);
DDX_Control(pDX IDCANCEL m_wndCancel);
DDX_Radio(pDX IDC_APP_LOOK1 m_nAppLook);
DDX_Check(pDX IDC_SHOW_AT_STARTUP m_bShowAtStartup);
DDX_Check(pDX IDC_OUTLOOKBAR2003 m_bOutlookBar2003);
DDX_CBIndex(pDX IDC_style2007 m_nstyle2007);
}

BEGIN_MESSAGE_MAP(CAppLookDlg CDialog)
ON_BN_CLICKED(IDC_APPLY OnApply)
ON_BN_CLICKED(IDC_APP_LOOK1 OnAppLook)
ON_BN_CLICKED(IDC_APP_LOOK2 OnAppLook)
ON_BN_CLICKED(IDC_APP_LOOK3 OnAppLook)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAppLookDlg message handlers

BOOL CAppLookDlg::OnInitDialog()
{
CDialog::OnInitDialog();

SetLook();

m_wndstyle2007.EnableWindow(m_nAppLook == 2);

if (m_bStartup)
{
if (!m_bShowAtStartup)
{
EndDialog(IDCANCEL);
return TRUE;
}

CRect rectBtn;

// Hide “Cancel“ button:
m_wndCancel.GetWindowRect(rectBtn);
ScreenToClient(rectBtn);

m_wndOK.MoveWindow(rectBtn);

m_wndCancel.ShowWindow(SW_HIDE);
}

return TRUE;  // return TRUE unless you set the focus to a control
}

void CAppLookDlg::OnOK()
{
CDialog::OnOK();
SetLook();
}

void CAppLookDlg::OnApply()
{
SetLook();

if (!m_bStartup)
{
m_wndCancel.SetWindowText(_T(“Close“));
}
}

void CAppLookDlg::SetLook()
{
UpdateData();
OnAppLook();

switch (m_nAppLook)
{
case 0:
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOfficeXP));
break;

case 1:
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerOffice2003));

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       4228  2010-03-19 10:34  OutlookDemoAppLookDlg.cpp

     文件       1233  2010-03-19 10:34  OutlookDemoAppLookDlg.h

     文件       4008  2010-03-19 10:34  OutlookDemoCalendarBar.cpp

     文件       1097  2010-03-19 10:34  OutlookDemoCalendarBar.h

     文件       2533  2010-03-19 10:34  OutlookDemoFolderListBar.cpp

     文件       1405  2010-03-19 10:34  OutlookDemoFolderListBar.h

     文件       5379  2010-03-19 10:34  OutlookDemoFolderListPopupWnd.cpp

     文件       1731  2010-03-19 10:34  OutlookDemoFolderListPopupWnd.h

     文件       2290  2010-03-19 10:34  OutlookDemoFoldersTree.cpp

     文件       1180  2010-03-19 10:34  OutlookDemoFoldersTree.h

     文件       2457  2010-03-19 10:34  OutlookDemoMailBar.cpp

     文件       1123  2010-03-19 10:34  OutlookDemoMailBar.h

     文件       6096  2010-03-19 10:34  OutlookDemoMailframe.cpp

     文件       1529  2010-03-19 10:34  OutlookDemoMailframe.h

     文件       4356  2010-03-19 10:34  OutlookDemoMailView.cpp

     文件       1770  2010-03-19 10:34  OutlookDemoMailView.h

     文件      31270  2010-03-19 10:34  OutlookDemoMainFrm.cpp

     文件       5342  2010-03-19 10:34  OutlookDemoMainFrm.h

     文件       6196  2010-03-19 10:34  OutlookDemoOutlookDemo.cpp

     文件       1178  2010-03-19 10:34  OutlookDemoOutlookDemo.h

     文件      33307  2010-03-19 10:34  OutlookDemoOutlookDemo.rc

     文件   10964992  2018-05-24 19:07  OutlookDemoOutlookDemo.sdf

     文件       4164  2010-03-19 10:34  OutlookDemoOutlookDemo.sln

    ..A..H.     12288  2018-05-24 19:07  OutlookDemoOutlookDemo.suo

     文件      48316  2010-03-19 10:34  OutlookDemoOutlookDemo.vcxproj

     文件       6611  2010-03-19 10:34  OutlookDemoOutlookDemo.vcxproj.filters

     文件        143  2018-01-04 15:40  OutlookDemoOutlookDemo.vcxproj.user

     文件       5698  2010-03-19 10:34  OutlookDemoOutlookDemoDoc.cpp

     文件       1629  2010-03-19 10:34  OutlookDemoOutlookDemoDoc.h

     文件       4912  2010-03-19 10:34  OutlookDemoOutlookDemoView.cpp

............此处省略43个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)