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

📄 gamethread.cpp

📁 传奇的脱机源代码 非常的好 供大家学习 谢谢
💻 CPP
字号:
// GameThread.cpp : implementation file
//

#include "stdafx.h"
#include "MirRobot.h"
#include "GameThread.h"
#include "LoginDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CGameThread

IMPLEMENT_DYNCREATE(CGameThread, CWinThread)

CGameThread::CGameThread()
{
	m_pWnd=NULL;
}

CGameThread::~CGameThread()
{
	SendMessage(AfxGetMainWnd()->m_hWnd,WM_LOGOUT,NULL,NULL);
}

BOOL CGameThread::InitInstance()
{
	// TODO:  perform and per-thread initialization here
	m_pWnd=new CGameFrm();
	m_pWnd->Create(NULL,"Hello Mir",WS_OVERLAPPEDWINDOW,CRect(0,0,100,100),
		NULL,NULL);
	//m_pMainWnd->ShowWindow(SW_SHOW);
	//m_pMainWnd->UpdateWindow();
	return TRUE;
}

int CGameThread::ExitInstance()
{
	// TODO:  perform any per-thread cleanup here
	SendMessage(AfxGetMainWnd()->m_hWnd,WM_LOGOUT,NULL,NULL);
	return CWinThread::ExitInstance();
}

BEGIN_MESSAGE_MAP(CGameThread, CWinThread)
	//{{AFX_MSG_MAP(CGameThread)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGameThread message handlers

int CGameThread::Run() 
{
	// TODO: Add your specialized code here and/or call the base class
	
	int retval= CWinThread::Run();
	SendMessage(AfxGetMainWnd()->m_hWnd,WM_LOGOUT,NULL,NULL);
	return retval;
}

⌨️ 快捷键说明

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