forked from zodiacon/TotalRegistry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AboutDlg.cpp
34 lines (28 loc) · 997 Bytes
/
AboutDlg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "pch.h"
#include "resource.h"
#include "AboutDlg.h"
#include "VersionResourceHelper.h"
LRESULT CAboutDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
CenterWindow(GetParent());
SetDialogIcon(IDR_MAINFRAME);
WCHAR path[MAX_PATH];
::GetModuleFileName(nullptr, path, _countof(path));
VersionResourceHelper vr(path);
auto version = vr.GetValue(L"ProductVersion");
auto copyright = vr.GetValue(L"LegalCopyright");
SetDlgItemText(IDC_VERSION, L"Total Registry v" + version);
SetDlgItemText(IDC_COPYRIGHT, copyright);
return TRUE;
}
LRESULT CAboutDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
EndDialog(wID);
return 0;
}
LRESULT CAboutDlg::OnClickSyslink(int, LPNMHDR hdr, BOOL&) const {
CString text;
GetDlgItem(IDC_LINK).GetWindowText(text);
text.Replace(L"<a>", L"");
text.Replace(L"</a>", L"");
::ShellExecute(nullptr, L"open", text, nullptr, nullptr, SW_SHOWDEFAULT);
return 0;
}