1.resource.h
#define IDB_BITMAP_DONATE 1100
#define IDC_STATIC_DESC 1101
#define IDC_STATIC_RIGHTS 1102
#define IDC_STATIC_DONATE 1103
#define IDC_BUTTON_DONATE 1104
#define IDC_STATIC_FEEDBACK 1105
2.xxx.rc
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDB_BITMAP_DONATE BITMAP "res\\donate.bmp"
IDD_ABOUTBOX DIALOGEX 0, 0, 397, 210
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "About PlyAutoTool"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,14,14,20,20
LTEXT "PlyAutoTool, Version 1.0",IDC_STATIC_DESC,42,14,264,8,SS_NOPREFIX
LTEXT "Copyright (C) 2021",IDC_STATIC_RIGHTS,42,26,287,8
LTEXT "Donate:",IDC_STATIC_DONATE,7,42,54,8
LTEXT "Feedback:",IDC_STATIC_FEEDBACK,276,42,107,8
CONTROL IDB_BITMAP_DONATE,IDC_STATIC,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_REALSIZEIMAGE,7,57,383,146
DEFPUSHBUTTON "OK",IDOK,340,7,50,14,WS_GROUP
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 390
TOPMARGIN, 7
BOTTOMMARGIN, 203
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// AFX_DIALOG_LAYOUT
//
IDD_ABOUTBOX AFX_DIALOG_LAYOUT
BEGIN
0
END
3.xxxdlg.cpp
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialogEx
{
public:
CAboutDlg();
// Dialog Data
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_ABOUTBOX };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnInitDialog();
// Implementation
protected:
DECLARE_MESSAGE_MAP()
public:
static const std::wstring& APP_OK_NAME()
{
static const std::wstring& G_APP_OK_NAME = L"确定";
return G_APP_OK_NAME;
}
static const std::wstring& APP_NAME()
{
static const std::wstring& G_APP_NAME = L"安卓手机自动化工具";
return G_APP_NAME;
}
static const std::wstring& APP_VERSION()
{
static const std::wstring& G_APP_VERSION = L"1.0";
return G_APP_VERSION;
}
static const std::wstring& APP_RIGHTS()
{
static const std::wstring& G_APP_RIGHTS = L"(C) No.Better 保留所有权利 2022";
return G_APP_RIGHTS;
}
static const std::wstring& APP_DONATE()
{
static const std::wstring& G_APP_DONATE = L"捐助方式:";
return G_APP_DONATE;
}
static const std::wstring& APP_FEEDBACK()
{
static const std::wstring& G_APP_FEEDBACK = L"反馈建议:523381005@qq.com";
return G_APP_FEEDBACK;
}
static const std::wstring& APP_TITLE_NAME()
{
static const std::wstring& G_APP_TITIE_NAME = APP_NAME() + L" (" + APP_BIT() + L"位)";
return G_APP_TITIE_NAME;
}
static const std::wstring& ABOUT_TITLE_NAME()
{
static const std::wstring& G_ABOUT_TITIE_NAME = L"关于" + APP_TITLE_NAME();
return G_ABOUT_TITIE_NAME;
}
static const std::wstring& ABOUT_TITLE_NAME_VERSION()
{
static const std::wstring& G_ABOUT_TITLE_NAME_VERSION = (ABOUT_TITLE_NAME() + L", 版本:V" + APP_VERSION());
return G_ABOUT_TITLE_NAME_VERSION;
}
static const std::wstring& APP_BIT()
{
static const std::wstring& G_APP_BIT = std::to_wstring(sizeof(void*) * sizeof(double));
return G_APP_BIT;
}
};
CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX)
{
EnableActiveAccessibility();
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx)
END_MESSAGE_MAP()
BOOL CAboutDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(GetParent()->GetIcon(TRUE), TRUE); // Set big icon
SetIcon(GetParent()->GetIcon(FALSE), FALSE); // Set small icon
// TODO: Add extra initialization here
SetWindowTextW(ABOUT_TITLE_NAME().c_str());
SetDlgItemTextW(IDC_STATIC_DESC, ABOUT_TITLE_NAME_VERSION().c_str());
SetDlgItemTextW(IDC_STATIC_RIGHTS, APP_RIGHTS().c_str());
SetDlgItemTextW(IDC_STATIC_DONATE, APP_DONATE().c_str());
SetDlgItemTextW(IDC_STATIC_FEEDBACK, APP_FEEDBACK().c_str());
SetDlgItemTextW(IDOK, APP_OK_NAME().c_str());
return TRUE; // return TRUE unless you set the focus to a control
}
4.copy donate.bmp to res/ folder