-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyStatusBar.cpp
executable file
·72 lines (56 loc) · 1.44 KB
/
MyStatusBar.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
71
72
// MyStatusBar.cpp : implementation file
//
#include "stdafx.h"
#include "LaserScan.h"
#include "MyStatusBar.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyStatusBar
CMyStatusBar::CMyStatusBar()
{
}
CMyStatusBar::~CMyStatusBar()
{
}
BEGIN_MESSAGE_MAP(CMyStatusBar, CStatusBar)
//{{AFX_MSG_MAP(CMyStatusBar)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyStatusBar message handlers
void CMyStatusBar::OnPaint()
{
Default();
CClientDC cDC (this);
CPen pen(PS_SOLID, 1, ::GetSysColor (COLOR_3DSHADOW));
HPEN oldPen = (HPEN)cDC.SelectObject(pen);
CRect rcItem;
cDC.SelectObject (::GetStockObject (NULL_BRUSH));
for ( int i = 0; i < m_nCount; i++ )
{
GetItemRect (i, rcItem);
cDC.Rectangle (rcItem);
}
cDC.SelectObject (oldPen);
}
BOOL CMyStatusBar::SetIndicators (const UINT* lpIDArray, int nIDCount)
{
if ( !CStatusBar::SetIndicators (lpIDArray, nIDCount) )
{
return false;
}
SendMessage (SB_SETMINHEIGHT, 20);
for ( int i = 0; i < nIDCount; i++ )
{
UINT a, b;
int c;
GetPaneInfo (i, a, b, c);
SetPaneInfo (i, a, b|SBPS_NOBORDERS, c);
}
return true;
}