-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathChildFrm.cpp
More file actions
80 lines (63 loc) · 1.64 KB
/
ChildFrm.cpp
File metadata and controls
80 lines (63 loc) · 1.64 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
#include "stdafx.h"
#include "ChildFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CChildFrame
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWndEx)
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWndEx)
END_MESSAGE_MAP()
// CChildFrame construction/destruction
CChildFrame::CChildFrame()
{
}
CChildFrame::~CChildFrame()
{
}
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
{
#if 0
return CMDIChildWndEx::OnCreateClient(lpcs, pContext);
#else
BOOL bRet = m_wndSplitter.Create(this,
2, 1,
CSize(10, 10),
pContext);
if (bRet)
m_wndSplitter.SetScrollStyle(0);
return bRet;
#endif
}
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIChildWndEx::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
// CChildFrame diagnostics
#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
CMDIChildWndEx::AssertValid();
}
void CChildFrame::Dump(CDumpContext& dc) const
{
CMDIChildWndEx::Dump(dc);
}
#endif //_DEBUG
// CChildFrame message handlers
void CChildFrame::OnUpdateFrameTitle(BOOL bAddToTitle)
{
if (GetIcon(FALSE) == NULL)
{
CDocument* pDoc = GetActiveDocument();
SHFILEINFO fi = {};
if (!pDoc->GetPathName().IsEmpty())
SHGetFileInfo(pDoc->GetPathName(), 0, &fi, sizeof(fi), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES);
if (fi.hIcon == NULL)
SHGetFileInfo(_T(".txt"), 0, &fi, sizeof(fi), SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES);
HICON hIcon = fi.hIcon;
DestroyIcon(SetIcon(hIcon, FALSE));
}
CMDIChildWndEx::OnUpdateFrameTitle(bAddToTitle);
}