-
Notifications
You must be signed in to change notification settings - Fork 1
/
ExtMBInfoDlg.cpp
159 lines (113 loc) · 3.45 KB
/
ExtMBInfoDlg.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// ExtMBInfoDlg.cpp : implementation file
//
#include "stdafx.h"
#include "CPUBench2004.h"
#include "ExtMBInfoDlg.h"
#include "itembkdrawer.h"
#include "deviceinformations.h"
#include "cpuinformations.h"
#include "deviceslistdlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CExtMBInfoDlg dialog
CExtMBInfoDlg::CExtMBInfoDlg(CWnd* pParent /*=NULL*/)
: CDialog(CExtMBInfoDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CExtMBInfoDlg)
m_biosDate = _T("");
m_biosName = _T("");
m_biosVersion = _T("");
m_chipsetID = _T("");
m_chipsetVendor = _T("");
m_chipsetName = _T("");
m_fsbSpeed = _T("");
m_pciLatency = _T("");
m_busType = _T("");
//}}AFX_DATA_INIT
fntLbl.CreateFont(-11,0,0,0,FW_BOLD,FALSE,FALSE,0,ANSI_CHARSET,OUT_TT_PRECIS,
CLIP_TT_ALWAYS,ANTIALIASED_QUALITY,DEFAULT_PITCH | FF_SWISS, "TAHOMA");
}
void CExtMBInfoDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CExtMBInfoDlg)
DDX_Control(pDX, IDC_OTHERPCI, m_OtherPCI);
DDX_Text(pDX, IDC_BIOSDATE, m_biosDate);
DDX_Text(pDX, IDC_BIOSNAME, m_biosName);
DDX_Text(pDX, IDC_BIOSVERSION, m_biosVersion);
DDX_Text(pDX, IDC_CHIPSETID, m_chipsetID);
DDX_Text(pDX, IDC_CHIPSETVENDOR, m_chipsetVendor);
DDX_Text(pDX, IDC_NAME, m_chipsetName);
DDX_Text(pDX, IDC_FSBSPEED, m_fsbSpeed);
DDX_Text(pDX, IDC_PCILATENCY, m_pciLatency);
DDX_Text(pDX, IDC_BUSTYPE, m_busType);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CExtMBInfoDlg, CDialog)
//{{AFX_MSG_MAP(CExtMBInfoDlg)
ON_WM_ERASEBKGND()
ON_WM_CTLCOLOR()
ON_WM_PAINT()
ON_BN_CLICKED(IDC_OTHERPCI, OnOtherpci)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CExtMBInfoDlg message handlers
BOOL CExtMBInfoDlg::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
}
HBRUSH CExtMBInfoDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor == CTLCOLOR_STATIC){
pDC->SetBkMode(TRANSPARENT);
//pDC->SetTextColor(RGB(0,0x74,0xDC));
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
return hbr;
}
BOOL CExtMBInfoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CDeviceInformations devInfo;
CCPUInformations cpuInfo;
GetDlgItem(IDC_LBL)->SetFont(&fntLbl);
m_chipsetName=devInfo.GetChipsetName();
m_fsbSpeed=cpuInfo.GetFSBSpeed();
m_chipsetID=devInfo.GetChipsetID();
m_busType=cpuInfo.GetBusType();
m_chipsetVendor=devInfo.GetChipsetVendor();
m_pciLatency=devInfo.GetChipsetPCILatency();
m_biosName=devInfo.GetBIOSName();
m_biosVersion=devInfo.GetBIOSVersion();
m_biosDate=devInfo.GetBIOSDate();
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CExtMBInfoDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect r;
GetClientRect(&r);
CItemBkDrawer::DrawBk(&dc,&r);
// Do not call CDialog::OnPaint() for painting messages
}
void CExtMBInfoDlg::Update(){
CCPUInformations cpuInfo;
m_fsbSpeed="";
UpdateData(FALSE);
m_fsbSpeed=cpuInfo.GetFSBSpeed();
UpdateData(FALSE);
Invalidate();
}
void CExtMBInfoDlg::OnOtherpci()
{
CDevicesListDlg dlg;
dlg.DoModal();
}