📄 aboutgame.cpp
字号:
// AboutGame.cpp : implementation file
//
#include "stdafx.h"
#include "SkyRiver.h"
#include "AboutGame.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutGame dialog
CAboutGame::CAboutGame(CWnd* pParent /*=NULL*/)
: CDialog(CAboutGame::IDD, pParent)
{
//{{AFX_DATA_INIT(CAboutGame)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CAboutGame::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutGame)
DDX_Control(pDX, IDC_EDIT1, m_Edit);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutGame, CDialog)
//{{AFX_MSG_MAP(CAboutGame)
ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAboutGame message handlers
BOOL CAboutGame::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_Edit.SetWindowText((char*)GetHelp());
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
LPVOID CAboutGame::GetHelp()
{
HRSRC hRsrc = FindResource(NULL, MAKEINTRESOURCE(IDR_HELP), TEXT("Help"));
DWORD dwSize = SizeofResource(NULL, hRsrc);
HGLOBAL hGlobal = LoadResource(NULL, hRsrc);
LPVOID pBuffer = LockResource(hGlobal);
return pBuffer;
}
void CAboutGame::OnClose()
{
// TODO: Add your message handler code here and/or call default
int result=AfxMessageBox(_T("导出(天河传说攻略.txt)?"),MB_YESNOCANCEL);
if(result==IDYES)
{
CFile file;
if(!file.Open(_T("天河传说攻略.txt"),CFile::modeWrite))
{
file.Open(_T("天河传说攻略.txt"),CFile::modeWrite|CFile::modeCreate);
}
file.SeekToBegin();
char* pStr=(char*)GetHelp();
file.Write(pStr,strlen(pStr));
file.Close();
CDialog::OnClose();
}
else if(result==IDNO)
{
CDialog::OnClose();
}
else if(result==IDCANCEL)
{
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -