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

📄 cpumsg.cpp

📁 VC开发的一个笔记本线上测试系统
💻 CPP
字号:
// CpuMsg.cpp : implementation file
//

#include "stdafx.h"
#include "NoteBook.h"
#include "CpuMsg.h"
#include "CbTestRlt.h"

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


CCpuMsg::CCpuMsg(CWnd* pParent /*=NULL*/)
	: CDialog(CCpuMsg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CCpuMsg)
	m_edit = _T("");
	//}}AFX_DATA_INIT
}


void CCpuMsg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCpuMsg)
	DDX_Text(pDX, IDC_EDIT1, m_edit);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCpuMsg, CDialog)
	//{{AFX_MSG_MAP(CCpuMsg)
	ON_BN_CLICKED(IDC_STARTTEST, OnStarttest)
	ON_BN_CLICKED(IDC_BATTERY, OnBattery)
	ON_BN_CLICKED(IDC_CPUMSG, OnCpumsg)
	ON_BN_CLICKED(IDC_FINISH, OnFinish)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCpuMsg message handlers


void CCpuMsg::OnStarttest() 
{
	// TODO: Add your control notification handler code here
	ShellExecute(NULL,"open","E:\\仝兆玉邮件\\BatteryMon\\BatteryMon.exe",NULL,NULL,SW_SHOW);
    Sleep(10000);
    if (::FindWindow(NULL,"BatteryMon - [交流电源]"))
	{
		Sleep(1000);
		CTestResult dlg;
		dlg.DoModal();
	}
	else
		MessageBox("测试故障,请重新测试!");
	while(!::FindWindow(NULL,"CPU-Z"))
	{
		Sleep(1000);
	}
	Sleep(1000);
	CCpuResult dlg;
	dlg.DoModal();
}

void CCpuMsg::OnBattery() 
{
	// TODO: Add your control notification handler code here
	ShellExecute(NULL,"open","E:\\仝兆玉邮件\\BatteryMon\\BatteryMon.exe",NULL,NULL,SW_SHOW);
    Sleep(10000);
    if (::FindWindow(NULL,"BatteryMon - [交流电源]"))
	{
		Sleep(1000);
		CCbTestRlt dlg;
		dlg.DoModal();
	}
	else
		MessageBox("测试故障,请重新测试!");
}

void CCpuMsg::OnCpumsg() 
{
	// TODO: Add your control notification handler code here
	ShellExecute(NULL,"open","D:\\测试工具\\CPU测试\\CPU信息检测\\cpuz\\cpuz.exe",
		NULL,NULL,SW_SHOW);
	Sleep(3000);
	if (::FindWindow(NULL,"CPU-Z"))
	{
		Sleep(1000);
		CCpuResult dlg;
		dlg.DoModal();
	}
	else
		MessageBox("测试故障,请重新测试!");
}

void CCpuMsg::OnFinish() 
{
	// TODO: Add your control notification handler code here
	SendMessage(WM_SYSCOMMAND,SC_CLOSE,0);
}

⌨️ 快捷键说明

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