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

📄 progresswnd.cpp

📁 添加
💻 CPP
字号:
// ProgressWnd.cpp : implementation file
//

#include "stdafx.h"
#include "tbvc.h"
#include "ProgressWnd.h"

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

/////////////////////////////////////////////////////////////////////////////
// CProgressWnd

CProgressWnd::CProgressWnd()
{
	x=20;
}

CProgressWnd::~CProgressWnd()
{
}


BEGIN_MESSAGE_MAP(CProgressWnd, CWnd)
	//{{AFX_MSG_MAP(CProgressWnd)
	ON_WM_PAINT()
	ON_WM_TIMER()
	ON_WM_CREATE()
	ON_WM_CLOSE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()




void CProgressWnd::OnPaint() 
{
	CPaintDC dc(this); 

	CBrush m_bkBrush;
	m_bkBrush.CreateSolidBrush(RGB(255,0,0));

	CPen   m_oldpen(PS_SOLID,1,RGB(255,0,0)),m_pen(PS_SOLID,1,RGB(0,0,255));
    
	dc.SelectObject(&m_pen);
	dc.Rectangle(20,20,230,45);

    dc.SelectObject(&m_oldpen);
    dc.SelectObject(&m_bkBrush);
	dc.Rectangle(21,21,x,44);
	//dc.MoveTo(x,20);
	//dc.LineTo(x,50);
	
}

void CProgressWnd::OnTimer(UINT nIDEvent) 
{
    x+=3;
	if(x>=229) x=21;
	InvalidateRect(CRect(21,21,229,44),FALSE);
	CWnd::OnTimer(nIDEvent);
}

int CProgressWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	SetTimer(1,100,0);
	return 0;
}

void CProgressWnd::OnClose() 
{
	// TODO: Add your message handler code here and/or call default
	
	CWnd::OnClose();
}

⌨️ 快捷键说明

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