📄 example1dlg.cpp
字号:
// example1Dlg.cpp : implementation file
//
#include "stdafx.h"
#include "example1.h"
#include "example1Dlg.h"
#include "WANG.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CExample1Dlg dialog
CExample1Dlg::CExample1Dlg(CWnd* pParent /*=NULL*/)
: CDialog(CExample1Dlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CExample1Dlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CExample1Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CExample1Dlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CExample1Dlg, CDialog)
//{{AFX_MSG_MAP(CExample1Dlg)
ON_BN_CLICKED(IDC_zhuan, Onzhuan)
ON_BN_CLICKED(IDC_EXIT, OnExit)
ON_BN_CLICKED(IDC_HORIZON, OnHorizon)
ON_BN_CLICKED(IDC_ENTERW, OnEnterw)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CExample1Dlg message handlers
BOOL CExample1Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
CenterWindow(GetDesktopWindow()); // center to the hpc screen
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
void CExample1Dlg::Onzhuan()
{
// TODO: Add your control notification handler code here
DEVMODE DevMode;
memset(&DevMode, 0, sizeof (DevMode));
DevMode.dmSize = sizeof (DevMode);
DevMode.dmFields = DM_DISPLAYORIENTATION;
//DevMode.dmDisplayOrientation = NewAngle;
DevMode.dmDisplayOrientation = DMDO_270;
ChangeDisplaySettingsEx(NULL, &DevMode, NULL, CDS_RESET, NULL);
//ChangeDisplaySettingsEx(NULL, &DevMode, NULL, 0, NULL);
//if (DISP_CHANGE_SUCCESSFUL == ChangeDisplaySettingsEx(NULL, &DevMode, NULL, CDS_RESET, NULL))
//{
//RETAILMSG(1, (L"ChangeDisplaySettingsEx changed rotation angle to %d", NewAngle));
//}
//else
//{
//RETAILMSG(1, (L"ChangeDisplaySettingsEx failed to change the rotation angle to %d", NewAngle));
//}
}
void CExample1Dlg::OnExit()
{
// TODO: Add your control notification handler code here
OnOK();
}
void CExample1Dlg::OnHorizon()
{
// TODO: Add your control notification handler code here
DEVMODE DevMode;
memset(&DevMode, 0, sizeof (DevMode));
DevMode.dmSize = sizeof (DevMode);
DevMode.dmFields = DM_DISPLAYORIENTATION;
//DevMode.dmDisplayOrientation = NewAngle;
DevMode.dmDisplayOrientation = DMDO_0;
ChangeDisplaySettingsEx(NULL, &DevMode, NULL, CDS_RESET, NULL);
}
void CExample1Dlg::OnEnterw()
{
// TODO: Add your control notification handler code here
WANG wang;
wang.DoModal();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -