synced TortoiseIDiff with TortoiseSVN (rev. 22327)
[TortoiseGit.git] / src / TortoiseIDiff / AboutDlg.cpp
blob9c932e149021d04366e1f0a7510f94eaf5d4578d
1 #include "StdAfx.h"
2 #include "Resource.h"
3 #include "AboutDlg.h"
4 #include "Registry.h"
5 #include "..\version.h"
6 #include <string>
7 #include <Commdlg.h>
9 using namespace std;
11 CAboutDlg::CAboutDlg(HWND hParent)
13 m_hParent = hParent;
16 CAboutDlg::~CAboutDlg(void)
20 LRESULT CAboutDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
22 UNREFERENCED_PARAMETER(lParam);
23 switch (uMsg)
25 case WM_INITDIALOG:
27 InitDialog(hwndDlg, IDI_TORTOISEIDIFF);
28 // initialize the controls
29 m_link.ConvertStaticToHyperlink(hwndDlg, IDC_WEBLINK, _T("http://tortoisesvn.net"));
30 TCHAR verbuf[1024] = {0};
31 TCHAR maskbuf[1024] = {0};
32 if (!::LoadString (hResource, IDS_VERSION, maskbuf, _countof(maskbuf)))
34 SecureZeroMemory(maskbuf, sizeof(maskbuf));
36 _stprintf_s(verbuf, maskbuf, TGIT_VERMAJOR, TGIT_VERMINOR, TGIT_VERMICRO, TGIT_VERBUILD);
37 SetDlgItemText(hwndDlg, IDC_ABOUTVERSION, verbuf);
39 return TRUE;
40 case WM_COMMAND:
41 return DoCommand(LOWORD(wParam));
42 default:
43 return FALSE;
47 LRESULT CAboutDlg::DoCommand(int id)
49 switch (id)
51 case IDOK:
52 // fall through
53 case IDCANCEL:
54 EndDialog(*this, id);
55 break;
57 return 1;