Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
MyDlgBar.cpp
Package: NoPassword.rar [view]
Upload User: chenhai826
Upload Date: 2007-04-11
Package Size: 72k
Code Size: 2k
Category:
Crack_Hack
Development Platform:
Visual C++
- // MyDlgBar.cpp : implementation file
- //
- #include "stdafx.h"
- #include "nopassword.h"
- #include "MyDlgBar.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CMyDlgBar
- IMPLEMENT_DYNCREATE(CMyDlgBar, CDialogBar)
- CMyDlgBar::CMyDlgBar()
- {
- memset(m_Speed,0,100);
- m_Pos = 0;
- }
- CMyDlgBar::~CMyDlgBar()
- {
- }
- void CMyDlgBar::Add()
- {
- m_Speed[m_Pos] ++;
- }
- void CMyDlgBar::OnTimer(UINT nIDEvent)
- {
- static count = 0;
- if(count++ % CNPApp::m_Sampling)
- return;
- CClientDC dc(this);
- DrawWave(&dc);
- if(++m_Pos >= 100) m_Pos = 0;
- m_Speed[m_Pos] = 0;
- }
- void CMyDlgBar::DrawWave(CDC *pDC)
- {
- int i,count;
- CRect r1,r2;
- CBrush brush;
- GetClientRect(r1);
- GetDlgItem(IDC_THREAD)->GetWindowRect(r2);
- r1.left = r1.left + r2.Width() + 5;
- r1.top += 2;
- r1.bottom -= 2;
- r1.right -= 5;
- brush.CreateSolidBrush(RGB(0,255,0));
- pDC->FillRect(r1,&CBrush(RGB(0,0,0)));
- r2.bottom = r1.bottom;
- for(i=m_Pos,count = 0;count<100;i--,count++)
- {
- if(i == -1) i = 99;
- r2.left = r1.left + count*4+count;
- if(r2.left > r1.right) break;
- r2.right = r2.left + 4;
- r2.top = r2.bottom - (m_Speed[i]*r1.Height()/
- (CNPApp::m_Scale * CNPApp::m_Sampling));
- pDC->FillRect(r2,&brush);
- }
- CString msg; msg.Format("%.2f",m_Speed[m_Pos]/(float)CNPApp::m_Sampling);
- pDC->SetTextColor(RGB(255,255,0));
- pDC->SetBkMode(0);
- pDC->DrawText(msg,r1,DT_CENTER);
- }
- void CMyDlgBar::OnPaint()
- {
- CPaintDC dc(this);
- DrawWave(&dc);
- }
- void CMyDlgBar::OnCreate()
- {
- m_Timer = SetTimer(0,1000,NULL);
- }
- void CMyDlgBar::OnClose()
- {
- KillTimer(m_Timer);
- }
- BEGIN_MESSAGE_MAP(CMyDlgBar, CDialogBar)
- ON_WM_PAINT()
- ON_WM_TIMER()
- ON_WM_CREATE()
- ON_WM_CLOSE()
- END_MESSAGE_MAP()