📄 mythread.cpp
字号:
// myThread.cpp: implementation of the myThread class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ThreadDemo.h"
#include "myThread.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
myThread::myThread()
{
m_pProgress = NULL;
}
myThread::~myThread()
{
}
BOOL myThread::Work(CProgressCtrl *pProgress)
{
if(pProgress == NULL)
return FALSE;
m_pProgress = pProgress;
return StartThread();
}
UINT myThread::ThreadMain()
{
// init progress control
m_pProgress->SetRange(0, 100);
m_pProgress->SetPos(0);
for(int i=0; i<101; ++i)
{
if(ShouldDie())
return 1;
m_pProgress->SetPos(i);
Sleep(50);
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -