Files
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

102 lines
2.4 KiB
C++

// AboutTwtDlg.cpp : implementation file
//
#include "stdafx.h"
#include "AboutTWTDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//extern TARCH_IMPEXP BOOL g_szArxContext;
/////////////////////////////////////////////////////////////////////////////
// CAboutTwtDlg dialog
void AboutTwt()
{
CTemporaryResourceOverride vTemp;
CAboutTwtDlg dlg;
dlg.DoModal();
}
CAboutTwtDlg::CAboutTwtDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAboutTwtDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CAboutTwtDlg)
m_csVersionType = _T("预发行版");
m_csTitle = _T("");
m_csVersion = _T("");
//}}AFX_DATA_INIT
XString sTchIni;
if(FindFile(_T("tch.ini"), sTchIni)) {
INI_struct *inis=NULL;
if(CT_get_INIs(sTchIni, _T("Product"), &inis)) {
TCHAR *cName=CT_get_INI2(inis, _T("About"));
if(cName)
m_csTitle=cName;
TCHAR *pVer=CT_get_INI2(inis, _T("NewVersion"));
if(pVer)
m_csVersion=pVer;
TCHAR *pSubVer=CT_get_INI2(inis, _T("SubVer"));
if(pSubVer)
m_csSubVer=pSubVer;
CT_free_INIs(inis);
}
}
m_csVersion = m_csVersion + _T(" ") + m_csSubVer;
}
void CAboutTwtDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutTwtDlg)
DDX_Text(pDX, IDC_STATIC_TYPE, m_csVersionType);
DDX_Text(pDX, IDC_TITLE, m_csTitle);
DDX_Text(pDX, IDC_STATIC_VERSION, m_csVersion);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutTwtDlg, CDialog)
//{{AFX_MSG_MAP(CAboutTwtDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAboutTwtDlg message handlers
BOOL CAboutTwtDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CRegProperty reg(GetRegLocation(), _T("License"));
reg.SetTopRootKey(HKEY_LOCAL_MACHINE);
int iMode(0);
if(!reg.GetValue(_T("Mode"), iMode))
iMode = 0;
if(iMode == 0)
m_csVersionType = _T("试用版");
else if(iMode == 1)
m_csVersionType = _T("单机版");
else if(iMode == 2)
m_csVersionType = _T("网络版");
else if(iMode == 3)
m_csVersionType = _T("授权版");
// if(!g_szArxContext)
// m_csVersionType = _T("测试版");
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}