-
Notifications
You must be signed in to change notification settings - Fork 8
/
AboutDlg.cpp
70 lines (56 loc) · 1.69 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// AboutDlg.cpp : implementation file
//
#include "StdAfx.h"
#include "FLCompanion.h"
#include "FLCompanionDlg.h"
#include "AboutDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog
CAboutDlg::CAboutDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAboutDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CAboutDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
DDX_Control(pDX, IDC_ABOUTICON, m_icon);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg message handlers
BOOL CAboutDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_icon.SetWindowPos(NULL, 0, 0, 48, 48, SWP_NOMOVE|SWP_NOZORDER);
m_icon.SetIcon((HICON) LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(IDR_MAINFRAME),IMAGE_ICON,48,48,LR_SHARED));
CString text;
GetDlgItemText(IDC_ABOUTTEXT, text);
text.Format(text + '\0', g_mainDlg->m_version);
SetDlgItemText(IDC_ABOUTTEXT, text);
return TRUE; // return TRUE unless you set the focus to a control
}
BOOL CAboutDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
switch (reinterpret_cast<LPNMHDR>(lParam)->code)
{
case NM_RETURN:
case NM_CLICK:
ShellExecute(*this, L"open", reinterpret_cast<PNMLINK>(lParam)->item.szUrl, NULL, NULL, SW_SHOWNORMAL);
return 1;
default:
return CDialog::OnNotify(wParam, lParam, pResult);
}
}