Use static method
[TortoiseGit.git] / src / TortoiseIDiff / AboutDlg.cpp
blobea57c3fa67ee2b4add986502828fdb722b37a376
1 // TortoiseIDiff - an image diff viewer in TortoiseSVN
3 // Copyright (C) 2012 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #include "stdafx.h"
20 #include "resource.h"
21 #include "AboutDlg.h"
22 #include "registry.h"
23 #include "..\version.h"
24 #include <string>
25 #include <Commdlg.h>
27 using namespace std;
29 CAboutDlg::CAboutDlg(HWND hParent)
30 : m_hParent(hParent)
31 , m_hHiddenWnd(0)
35 CAboutDlg::~CAboutDlg(void)
39 LRESULT CAboutDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM /*lParam*/)
41 switch (uMsg)
43 case WM_INITDIALOG:
45 InitDialog(hwndDlg, IDI_TORTOISEIDIFF);
46 // initialize the controls
47 TCHAR verbuf[1024] = {0};
48 TCHAR maskbuf[1024] = {0};
49 if (!::LoadString (hResource, IDS_VERSION, maskbuf, _countof(maskbuf)))
51 SecureZeroMemory(maskbuf, sizeof(maskbuf));
53 _stprintf_s(verbuf, maskbuf, TGIT_VERMAJOR, TGIT_VERMINOR, TGIT_VERMICRO, TGIT_VERBUILD);
54 SetDlgItemText(hwndDlg, IDC_ABOUTVERSION, verbuf);
56 return TRUE;
57 case WM_COMMAND:
58 return DoCommand(LOWORD(wParam));
59 default:
60 return FALSE;
64 LRESULT CAboutDlg::DoCommand(int id)
66 switch (id)
68 case IDOK:
69 // fall through
70 case IDCANCEL:
71 EndDialog(*this, id);
72 break;
74 return 1;