-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathMDIClientWnd.cpp
51 lines (33 loc) · 970 Bytes
/
MDIClientWnd.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
#include "stdafx.h"
#include "MUSHclient.h"
#include "mainfrm.h"
#include "MDIClientWnd.h"
// CMDIClientWnd
IMPLEMENT_DYNAMIC(CMDIClientWnd, CWnd)
CMDIClientWnd::CMDIClientWnd()
{
}
CMDIClientWnd::~CMDIClientWnd()
{
}
BEGIN_MESSAGE_MAP(CMDIClientWnd, CWnd)
ON_WM_ERASEBKGND()
END_MESSAGE_MAP()
// CMDIClientWnd message handlers
// utils.setbackgroundcolour (ColourNameToRGB ("yellow") )
BOOL CMDIClientWnd::OnEraseBkgnd(CDC* pDC)
{
// if colour is 0xFFFFFFFF then use Windows default (same as before)
if (Frame.m_backgroundColour == 0xFFFFFFFF)
return CWnd::OnEraseBkgnd(pDC);
// Set brush to desired background color
CBrush backBrush(Frame.m_backgroundColour);
// Save old brush
CBrush* pOldBrush = pDC->SelectObject(&backBrush);
CRect rect;
pDC->GetClipBox(&rect); // Erase the area needed
pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY);
// put brush back
pDC->SelectObject(pOldBrush);
return TRUE;
}