📄 gamethread.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 + -