⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 docomputer.cpp

📁 memory management
💻 CPP
字号:
// Docomputer.cpp : implementation file
//

#include "stdafx.h"
#include "Memory.h"
#include "Docomputer.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDocomputer dialog


CDocomputer::CDocomputer(CWnd* pParent /*=NULL*/)
	: CDialog(CDocomputer::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDocomputer)
	m_doComputer = 0;
	//}}AFX_DATA_INIT
}


void CDocomputer::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDocomputer)
	DDX_Control(pDX, IDC_LINE, m_line);
	DDX_Radio(pDX, IDC_RESTART, m_doComputer);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDocomputer, CDialog)
	//{{AFX_MSG_MAP(CDocomputer)
	ON_BN_CLICKED(ID_START, OnStart)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDocomputer message handlers

void CDocomputer::OnStart() 
{
	UpdateData(true);
	Doid=GetCheckedRadioButton(IDC_RESTART,IDC_UNREG);
	switch(Doid)
	{
	case IDC_RESTART:
		ExitWindowsEx(EWX_REBOOT,0);
		break;
	case IDC_CANCLOSE:
		ExitWindowsEx(EWX_SHUTDOWN,0);
		break;
	case IDC_CLOSE:
		ExitWindowsEx(EWX_FORCE,0);
		break;
	case IDC_UNREG:
		ExitWindowsEx(EWX_LOGOFF,0);
		break;
	}

}

BOOL CDocomputer::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	//CheckRadioButton(IDC_RESTART,IDC_UNREG,IDC_RESTART);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDocomputer::OnPaint() 
{
	//CDialog::OnPaint(); // device context for painting
	
	CPaintDC dc(&m_line);
	COLORREF clrHilight=GetSysColor(COLOR_BTNHILIGHT);
	COLORREF clrShadow=GetSysColor(COLOR_BTNSHADOW);
	CRect rect;
	m_line.GetClientRect(&rect);
	rect.top=rect.bottom/2;
	rect.bottom=rect.top+3;
	//dc.MoveTo(rect.left,rect.top);
	//dc.LineTo(rect.right,rect.top);
	dc.Draw3dRect(rect,clrShadow,clrHilight);
	// Do not call CDialog::OnPaint() for painting messages
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -