Fix typos
[TortoiseGit.git] / src / TortoiseIDiff / AboutDlg.cpp
blobaf8b3e9f3b604d20a3aaf21039028ca93bf7f973
1 // TortoiseIDiff - an image diff viewer in TortoiseGit
3 // Copyright (C) 2023 - TortoiseGit
4 // Copyright (C) 2012-2013, 2020 - TortoiseSVN
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include "stdafx.h"
21 #include "resource.h"
22 #include "AboutDlg.h"
23 #include "registry.h"
24 #include "Theme.h"
25 #include "../version.h"
26 #include <string>
27 #include <Commdlg.h>
30 CAboutDlg::CAboutDlg(HWND hParent)
31 : m_hParent(hParent)
35 CAboutDlg::~CAboutDlg()
39 LRESULT CAboutDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
41 UNREFERENCED_PARAMETER(lParam);
42 switch (uMsg)
44 case WM_INITDIALOG:
46 InitDialog(hwndDlg, IDI_TORTOISEIDIFF);
47 // initialize the controls
48 wchar_t verbuf[1024] = { 0 };
49 wchar_t maskbuf[1024] = { 0 };
50 ::LoadString (hResource, IDS_VERSION, maskbuf, _countof(maskbuf));
51 swprintf_s(verbuf, maskbuf, TGIT_VERMAJOR, TGIT_VERMINOR, TGIT_VERMICRO, TGIT_VERBUILD);
52 SetDlgItemText(hwndDlg, IDC_ABOUTVERSION, verbuf);
53 CTheme::Instance().SetThemeForDialog(*this, CTheme::Instance().IsDarkTheme());
55 return TRUE;
56 case WM_COMMAND:
57 return DoCommand(LOWORD(wParam));
58 default:
59 return FALSE;
63 LRESULT CAboutDlg::DoCommand(int id)
65 switch (id)
67 case IDOK:
68 [[fallthrough]];
69 case IDCANCEL:
70 CTheme::Instance().SetThemeForDialog(*this, false);
71 EndDialog(*this, id);
72 break;
74 return 1;