-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCDlgMsg.cpp
More file actions
93 lines (67 loc) · 1.79 KB
/
Copy pathCDlgMsg.cpp
File metadata and controls
93 lines (67 loc) · 1.79 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// CDlgMsg.cpp: 구현 파일
//
#include "pch.h"
#include "BatchNamer.h"
#include "CDlgMsg.h"
#include "afxdialogex.h"
// CDlgMsg 대화 상자
IMPLEMENT_DYNAMIC(CDlgMsg, CDialogEx)
CDlgMsg::CDlgMsg(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_MSG, pParent)
{
}
CDlgMsg::~CDlgMsg()
{
}
void CDlgMsg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CDlgMsg, CDialogEx)
ON_WM_SIZE()
END_MESSAGE_MAP()
// CDlgMsg 메시지 처리기
void CDlgMsg::OnSize(UINT nType, int cx, int cy)
{
CDialogEx::OnSize(nType, cx, cy);
CWnd* pWnd = GetDlgItem(IDC_EDIT_MSG);
if (pWnd != NULL && ::IsWindow(pWnd->GetSafeHwnd())) ArrangeCtrl();
}
void CDlgMsg::ArrangeCtrl()
{
CRect rc, rcBtn;
GetClientRect(rc);
GetDlgItem(IDCANCEL)->GetWindowRect(rcBtn);
int BH = rcBtn.Height();
int LH = m_nLogFontHeight;
rc.DeflateRect(LH, LH, LH, LH);
rc.bottom = rc.bottom - BH - LH;
GetDlgItem(IDC_EDIT_MSG)->MoveWindow(rc);
rc.top = rc.bottom + LH;
rc.bottom = rc.top + BH;
GetDlgItem(IDCANCEL)->MoveWindow(rc);
}
BOOL CDlgMsg::OnInitDialog()
{
CDialogEx::OnInitDialog();
SetIcon(APP()->m_hIcon, TRUE); // Set big icon
SetIcon(APP()->m_hIcon, FALSE); // Set small icon
LOGFONT lf;
GetFont()->GetLogFont(&lf);
m_nLogFontHeight = abs(lf.lfHeight);
SetWindowText(m_strTitle);
SetDlgItemText(IDC_EDIT_MSG, m_strMsg);
ArrangeCtrl();
return TRUE; // return TRUE unless you set the focus to a control
// 예외: OCX 속성 페이지는 FALSE를 반환해야 합니다.
}
void CDlgMsg::OnCancel()
{
// TODO: 여기에 특수화된 코드를 추가 및/또는 기본 클래스를 호출합니다.
CDialogEx::OnCancel();
}
void CDlgMsg::OnOK()
{
// TODO: 여기에 특수화된 코드를 추가 및/또는 기본 클래스를 호출합니다.
CDialogEx::OnOK();
}