-
Notifications
You must be signed in to change notification settings - Fork 41
/
DlgInfomation.cpp
69 lines (48 loc) · 1.16 KB
/
DlgInfomation.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
// DlgInfomation.cpp : 实现文件
//
#include "stdafx.h"
#include "RemoteController.h"
#include "DlgInfomation.h"
#include "afxdialogex.h"
#define AUTO_KILL 0
// CDlgInfomation 对话框
IMPLEMENT_DYNAMIC(CDlgInfomation, CDialog)
CDlgInfomation::CDlgInfomation(const char *info, const char *details, int tm, CWnd* pParent)
: CDialog(CDlgInfomation::IDD, pParent)
, m_strTitle(info)
, m_strInfo(details)
, m_nTime(max(tm, 3333))
{
}
CDlgInfomation::~CDlgInfomation()
{
}
void CDlgInfomation::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDV_MaxChars(pDX, m_strInfo, 2048);
DDX_Text(pDX, IDC_INFOMATION, m_strInfo);
DDX_Control(pDX, IDC_INFOMATION, m_StaticInfo);
}
BEGIN_MESSAGE_MAP(CDlgInfomation, CDialog)
ON_WM_TIMER()
END_MESSAGE_MAP()
// CDlgInfomation 消息处理程序
BOOL CDlgInfomation::OnInitDialog()
{
CDialog::OnInitDialog();
SetTimer(AUTO_KILL, m_nTime, NULL);
SetWindowText(m_strTitle);
m_StaticInfo.SetWindowText(m_strInfo);
return TRUE;
}
void CDlgInfomation::OnTimer(UINT_PTR nIDEvent)
{
if (nIDEvent == AUTO_KILL)
{
KillTimer(AUTO_KILL);
SendMessage(WM_CLOSE, 0, 0);
return;
}
CDialog::OnTimer(nIDEvent);
}