15,979
社区成员
发帖
与我相关
我的任务
分享
// Controls.h : main header file for the CONTROLS application
//
#if !defined(AFX_CONTROLS_H__D49F90D2_7DED_447E_941B_B556B714C9D2__INCLUDED_)
#define AFX_CONTROLS_H__D49F90D2_7DED_447E_941B_B556B714C9D2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CControlsApp:
// See Controls.cpp for the implementation of this class
//
class CControlsApp : public CWinApp
{
public:
CControlsApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CControlsApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CControlsApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CONTROLS_H__D49F90D2_7DED_447E_941B_B556B714C9D2__INCLUDED_)
// Controls.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "Controls.h"
#include "PageButton.h"
#include "PageEdit.h"
#include "PageComboBox.h"
#include "PageScrollBar.h"
#include "PageProgressBar.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CControlsApp
BEGIN_MESSAGE_MAP(CControlsApp, CWinApp)
//{{AFX_MSG_MAP(CControlsApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CControlsApp construction
CControlsApp::CControlsApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
XTPPaintManager()->SetTheme(xtpThemeOffice2003);
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CControlsApp object
CControlsApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CControlsApp initialization
BOOL CControlsApp::InitInstance()
{
AfxEnableControlContainer();
CXTPWinDwmWrapper().SetProcessDPIAware();
AfxOleInit();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#if _MSC_VER <= 1200 // MFC 6.0 or earlier
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
#endif // MFC 6.0 or earlier
CXTPResizePropertySheet dlg(AFX_IDS_APP_TITLE, 0, 0, xtpResizeNoVertical);
dlg.m_psh.dwFlags |= PSH_NOAPPLYNOW;
CPageButton pageButtons;
dlg.AddPage(&pageButtons);
CPageEdit pageEdit;
dlg.AddPage(&pageEdit);
CPageComboBox pageComboBox;
dlg.AddPage(&pageComboBox);
CPageProgressBar pageProgressBar;
dlg.AddPage(&pageProgressBar);
CPageScrollBar pageScrollBar;
dlg.AddPage(&pageScrollBar);
m_pMainWnd = &dlg;
int nResponse = (int)dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}