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

📄 dalltimedlg.cpp

📁 计算机管理系统可以实现开机时自动运行
💻 CPP
字号:
// dalltimeDlg.cpp : implementation file
//

#include "stdafx.h"
#include "System.h"
#include "dalltimeDlg.h"
#include "utime.h"

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

/////////////////////////////////////////////////////////////////////////////
// dalltimeDlg dialog


dalltimeDlg::dalltimeDlg(CWnd* pParent /*=NULL*/)
	: CDialog(dalltimeDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(dalltimeDlg)
	m_dalltime = 0;
	m_dalltimesno = _T("");
	//}}AFX_DATA_INIT
}


void dalltimeDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(dalltimeDlg)
	DDX_Text(pDX, IDC_DALLTIME, m_dalltime);
	DDX_Text(pDX, IDC_DALLTIMESNO, m_dalltimesno);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(dalltimeDlg, CDialog)
	//{{AFX_MSG_MAP(dalltimeDlg)
	ON_BN_CLICKED(ID_CHAALLTIME, OnChaalltime)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// dalltimeDlg message handlers

void dalltimeDlg::OnChaalltime() 
{
	int temp;
	temp=0;
	utime utime;
	UpdateData();
	utime.Open();
	utime.MoveFirst();
	while(!utime.IsEOF())
	{
		if(m_dalltimesno==utime.m_usno)
			temp+=utime.m_total;
		utime.MoveNext();

	}
	utime.Close();
	m_dalltime=temp;
	UpdateData(false);
	// TODO: Add your control notification handler code here
	
}

void dalltimeDlg::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	CRect client_rect;
	GetClientRect(client_rect);
	// 取得文本
	CString szText;
	GetWindowText(szText);
	// 取得字体,并选入设备文件
	CFont *pFont, *pOldFont;
	pFont = GetFont();
	pOldFont = dc.SelectObject(pFont);
	// 用透明背景填充设备文件
	dc.SetBkMode(TRANSPARENT);
	// 显示文字
	dc.DrawText(szText, client_rect, 0);
	// 清除字体
	dc.SelectObject(pOldFont);

	
	
	
	CBitmap bmp;
	bmp.LoadBitmap(IDB_BITMAP2);// Get the size of the bitmap
	BITMAP bmpInfo;
	bmp.GetBitmap(&bmpInfo);
	// Create an in-memory DC compatible with the
	// display DC we're using to paint
	CDC dcMemory;
	dcMemory.CreateCompatibleDC(&dc);
	// Select the bitmap into the in-memory DC
	CBitmap *pOldBmp=dcMemory.SelectObject(&bmp);
	// Copy the bits from the in-memory DC into the on-	// screen DC to actually do the painting
     dc.BitBlt(0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight, &dcMemory, 0, 0, SRCCOPY);
	// TODO: Add your message handler code here
}

⌨️ 快捷键说明

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