SyncDlg: Use "Close" instead of "OK"
[TortoiseGit.git] / src / TortoiseIDiff / AboutDlg.cpp
blobbdde58335efa15588fa12aabbc36b539c6e3d506
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 UNREFERENCED_PARAMETER(lParam);
42 switch (uMsg)
44 case WM_INITDIALOG:
46 InitDialog(hwndDlg, IDI_TORTOISEIDIFF);
47 // initialize the controls
48 TCHAR verbuf[1024] = {0};
49 TCHAR maskbuf[1024] = {0};
50 if (!::LoadString (hResource, IDS_VERSION, maskbuf, _countof(maskbuf)))
52 SecureZeroMemory(maskbuf, sizeof(maskbuf));
54 _stprintf_s(verbuf, maskbuf, TGIT_VERMAJOR, TGIT_VERMINOR, TGIT_VERMICRO, TGIT_VERBUILD);
55 SetDlgItemText(hwndDlg, IDC_ABOUTVERSION, verbuf);
57 return TRUE;
58 case WM_COMMAND:
59 return DoCommand(LOWORD(wParam));
60 default:
61 return FALSE;
65 LRESULT CAboutDlg::DoCommand(int id)
67 switch (id)
69 case IDOK:
70 // fall through
71 case IDCANCEL:
72 EndDialog(*this, id);
73 break;
75 return 1;