Click here to Skip to main content
11,712,792 members (82,180 online)
Click here to Skip to main content
Add your own
alternative version

Custom Control Graph and Process Bar

, 13 Dec 2006 69K 5.1K 41
An article on a Win32 custom graph control and process bar creation.
#include <windows.h>
#include <windowsx.h>
#include <stdio.h>

#define VER_LINE_GAP			2
#define NO_OF_GRAPH				4
#define	GRAPH_GAP				6
#define NO_OF_BAR_PARTS			4
#define CENTER_VAL				2.5
#define LINE_GAP_LEN			3
#define BUF_LEN					20
#define VER_MAX_MOV				20
#define GRAPH_HEADER_LOC		20
#define NO_OF_POINTS			30
#define DARK_GREEN				125
#define LIGHT_GREEN				255
#define WM_USER_GRAPH           0x0401
#define WM_USER_PROCESS_BAR		0x0402
#define CUST_GRAPH_CLASS_NAME	"Custom_Control"

struct Health_Graph
	long	RxBytes;
	long	TxBytes;

struct lp
	unsigned long RxValue;
	unsigned long TxValue;
	unsigned int  GraphNo;

struct Health_Graph GraphInfo[NO_OF_GRAPH][NO_OF_POINTS];
struct lp *User_Data;

LONG64 TotalRxBytes, TotalTxBytes;
unsigned int MaxRx, MaxTx;

void DrawGraph(HDC hdc, RECT Rect);
void UpdateGraph(HDC hdc, RECT Rect, unsigned long RxValue, unsigned long TxValue, int GraphNo);
void DrawBar(HDC hdc, RECT Rect, int Process_Value);

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Shanmuga Sundar.V
India India
Module Lead working in leading MNC company, india - bangalore.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150819.1 | Last Updated 13 Dec 2006
Article Copyright 2006 by Shanmuga Sundar.V
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid