Process Hacker
graph.h File Reference

Go to the source code of this file.

Data Structures

struct  _PH_GRAPH_DRAW_INFO
 
struct  _PH_GRAPH_OPTIONS
 
struct  _PH_GRAPH_GETDRAWINFO
 
struct  _PH_GRAPH_GETTOOLTIPTEXT
 
struct  _PH_GRAPH_MOUSEEVENT
 
struct  _PH_GRAPH_DRAWPANEL
 
struct  _PH_GRAPH_BUFFERS
 
struct  _PH_GRAPH_STATE
 

Macros

#define PH_GRAPH_USE_GRID   0x1
 
#define PH_GRAPH_USE_LINE_2   0x10
 
#define PH_GRAPH_OVERLAY_LINE_2   0x20
 
#define PH_GRAPH_CLASSNAME   L"PhGraph"
 
#define GC_STYLE_FADEOUT   0x1
 
#define GC_STYLE_DRAW_PANEL   0x2
 
#define GCM_GETDRAWINFO   (WM_USER + 1301)
 
#define GCM_SETDRAWINFO   (WM_USER + 1302)
 
#define GCM_DRAW   (WM_USER + 1303)
 
#define GCM_MOVEGRID   (WM_USER + 1304)
 
#define GCM_GETBUFFEREDCONTEXT   (WM_USER + 1305)
 
#define GCM_SETTOOLTIP   (WM_USER + 1306)
 
#define GCM_UPDATETOOLTIP   (WM_USER + 1307)
 
#define GCM_GETOPTIONS   (WM_USER + 1308)
 
#define GCM_SETOPTIONS   (WM_USER + 1309)
 
#define Graph_GetDrawInfo(hWnd, DrawInfo)   SendMessage((hWnd), GCM_GETDRAWINFO, 0, (LPARAM)(DrawInfo))
 
#define Graph_SetDrawInfo(hWnd, DrawInfo)   SendMessage((hWnd), GCM_SETDRAWINFO, 0, (LPARAM)(DrawInfo))
 
#define Graph_Draw(hWnd)   SendMessage((hWnd), GCM_DRAW, 0, 0)
 
#define Graph_MoveGrid(hWnd, Increment)   SendMessage((hWnd), GCM_MOVEGRID, (WPARAM)(Increment), 0)
 
#define Graph_GetBufferedContext(hWnd)   ((HDC)SendMessage((hWnd), GCM_GETBUFFEREDCONTEXT, 0, 0))
 
#define Graph_SetTooltip(hWnd, Enable)   ((HDC)SendMessage((hWnd), GCM_SETTOOLTIP, (WPARAM)(Enable), 0))
 
#define Graph_UpdateTooltip(hWnd)   ((HDC)SendMessage((hWnd), GCM_UPDATETOOLTIP, 0, 0))
 
#define Graph_GetOptions(hWnd, Options)   SendMessage((hWnd), GCM_GETOPTIONS, 0, (LPARAM)(Options))
 
#define Graph_SetOptions(hWnd, Options)   SendMessage((hWnd), GCM_SETOPTIONS, 0, (LPARAM)(Options))
 
#define GCN_GETDRAWINFO   (WM_USER + 1351)
 
#define GCN_GETTOOLTIPTEXT   (WM_USER + 1352)
 
#define GCN_MOUSEEVENT   (WM_USER + 1353)
 
#define GCN_DRAWPANEL   (WM_USER + 1354)
 
#define PH_GRAPH_DATA_COUNT(Width, Step)   (((Width) + (Step) - 1) / (Step) + 1)
 

Typedefs

typedef struct _PH_GRAPH_DRAW_INFO PH_GRAPH_DRAW_INFO
 
typedef struct
_PH_GRAPH_DRAW_INFO
PPH_GRAPH_DRAW_INFO
 
typedef struct _PH_GRAPH_OPTIONS PH_GRAPH_OPTIONS
 
typedef struct _PH_GRAPH_OPTIONSPPH_GRAPH_OPTIONS
 
typedef struct
_PH_GRAPH_GETDRAWINFO 
PH_GRAPH_GETDRAWINFO
 
typedef struct
_PH_GRAPH_GETDRAWINFO
PPH_GRAPH_GETDRAWINFO
 
typedef struct
_PH_GRAPH_GETTOOLTIPTEXT 
PH_GRAPH_GETTOOLTIPTEXT
 
typedef struct
_PH_GRAPH_GETTOOLTIPTEXT
PPH_GRAPH_GETTOOLTIPTEXT
 
typedef struct _PH_GRAPH_MOUSEEVENT PH_GRAPH_MOUSEEVENT
 
typedef struct
_PH_GRAPH_MOUSEEVENT
PPH_GRAPH_MOUSEEVENT
 
typedef struct _PH_GRAPH_DRAWPANEL PH_GRAPH_DRAWPANEL
 
typedef struct
_PH_GRAPH_DRAWPANEL
PPH_GRAPH_DRAWPANEL
 
typedef struct _PH_GRAPH_BUFFERS PH_GRAPH_BUFFERS
 
typedef struct _PH_GRAPH_BUFFERSPPH_GRAPH_BUFFERS
 
typedef struct _PH_GRAPH_STATE PH_GRAPH_STATE
 
typedef struct _PH_GRAPH_STATEPPH_GRAPH_STATE
 

Functions

BOOLEAN PhGraphControlInitialization (VOID)
 
PHLIBAPI VOID PhDrawGraph (_In_ HDC hdc, _In_ PPH_GRAPH_DRAW_INFO DrawInfo)
 Draws a graph.
 
PHLIBAPI VOID PhDrawGraphDirect (_In_ HDC hdc, _In_ PVOID Bits, _In_ PPH_GRAPH_DRAW_INFO DrawInfo)
 Draws a graph directly to memory.
 
PHLIBAPI VOID PhSetGraphText (_In_ HDC hdc, _Inout_ PPH_GRAPH_DRAW_INFO DrawInfo, _In_ PPH_STRINGREF Text, _In_ PRECT Margin, _In_ PRECT Padding, _In_ ULONG Align)
 Sets the text in a graphing information structure.
 
VOID PhInitializeGraphBuffers (_Out_ PPH_GRAPH_BUFFERS Buffers)
 Initializes a graph buffer management structure.
 
VOID PhDeleteGraphBuffers (_Inout_ PPH_GRAPH_BUFFERS Buffers)
 Frees resources used by a graph buffer management structure.
 
PHLIBAPI VOID PhGetDrawInfoGraphBuffers (_Inout_ PPH_GRAPH_BUFFERS Buffers, _Inout_ PPH_GRAPH_DRAW_INFO DrawInfo, _In_ ULONG DataCount)
 Sets up a graphing information structure with information from a graph buffer management structure.
 
PHLIBAPI VOID PhInitializeGraphState (_Out_ PPH_GRAPH_STATE State)
 
PHLIBAPI VOID PhDeleteGraphState (_Inout_ PPH_GRAPH_STATE State)
 
PHLIBAPI VOID PhGraphStateGetDrawInfo (_Inout_ PPH_GRAPH_STATE State, _In_ PPH_GRAPH_GETDRAWINFO GetDrawInfo, _In_ ULONG DataCount)
 

Variables

RECT PhNormalGraphTextMargin
 
RECT PhNormalGraphTextPadding
 

Macro Definition Documentation

#define GC_STYLE_DRAW_PANEL   0x2

Definition at line 90 of file graph.h.

#define GC_STYLE_FADEOUT   0x1

Definition at line 89 of file graph.h.

#define GCM_DRAW   (WM_USER + 1303)

Definition at line 96 of file graph.h.

#define GCM_GETBUFFEREDCONTEXT   (WM_USER + 1305)

Definition at line 98 of file graph.h.

#define GCM_GETDRAWINFO   (WM_USER + 1301)

Definition at line 94 of file graph.h.

#define GCM_GETOPTIONS   (WM_USER + 1308)

Definition at line 101 of file graph.h.

#define GCM_MOVEGRID   (WM_USER + 1304)

Definition at line 97 of file graph.h.

#define GCM_SETDRAWINFO   (WM_USER + 1302)

Definition at line 95 of file graph.h.

#define GCM_SETOPTIONS   (WM_USER + 1309)

Definition at line 102 of file graph.h.

#define GCM_SETTOOLTIP   (WM_USER + 1306)

Definition at line 99 of file graph.h.

#define GCM_UPDATETOOLTIP   (WM_USER + 1307)

Definition at line 100 of file graph.h.

#define GCN_DRAWPANEL   (WM_USER + 1354)

Definition at line 128 of file graph.h.

#define GCN_GETDRAWINFO   (WM_USER + 1351)

Definition at line 125 of file graph.h.

#define GCN_GETTOOLTIPTEXT   (WM_USER + 1352)

Definition at line 126 of file graph.h.

#define GCN_MOUSEEVENT   (WM_USER + 1353)

Definition at line 127 of file graph.h.

#define Graph_Draw (   hWnd)    SendMessage((hWnd), GCM_DRAW, 0, 0)

Definition at line 108 of file graph.h.

#define Graph_GetBufferedContext (   hWnd)    ((HDC)SendMessage((hWnd), GCM_GETBUFFEREDCONTEXT, 0, 0))

Definition at line 112 of file graph.h.

#define Graph_GetDrawInfo (   hWnd,
  DrawInfo 
)    SendMessage((hWnd), GCM_GETDRAWINFO, 0, (LPARAM)(DrawInfo))

Definition at line 104 of file graph.h.

#define Graph_GetOptions (   hWnd,
  Options 
)    SendMessage((hWnd), GCM_GETOPTIONS, 0, (LPARAM)(Options))

Definition at line 118 of file graph.h.

#define Graph_MoveGrid (   hWnd,
  Increment 
)    SendMessage((hWnd), GCM_MOVEGRID, (WPARAM)(Increment), 0)

Definition at line 110 of file graph.h.

#define Graph_SetDrawInfo (   hWnd,
  DrawInfo 
)    SendMessage((hWnd), GCM_SETDRAWINFO, 0, (LPARAM)(DrawInfo))

Definition at line 106 of file graph.h.

#define Graph_SetOptions (   hWnd,
  Options 
)    SendMessage((hWnd), GCM_SETOPTIONS, 0, (LPARAM)(Options))

Definition at line 120 of file graph.h.

#define Graph_SetTooltip (   hWnd,
  Enable 
)    ((HDC)SendMessage((hWnd), GCM_SETTOOLTIP, (WPARAM)(Enable), 0))

Definition at line 114 of file graph.h.

#define Graph_UpdateTooltip (   hWnd)    ((HDC)SendMessage((hWnd), GCM_UPDATETOOLTIP, 0, 0))

Definition at line 116 of file graph.h.

#define PH_GRAPH_CLASSNAME   L"PhGraph"

Definition at line 49 of file graph.h.

#define PH_GRAPH_DATA_COUNT (   Width,
  Step 
)    (((Width) + (Step) - 1) / (Step) + 1)

Definition at line 165 of file graph.h.

#define PH_GRAPH_OVERLAY_LINE_2   0x20

Definition at line 13 of file graph.h.

#define PH_GRAPH_USE_GRID   0x1

Definition at line 11 of file graph.h.

#define PH_GRAPH_USE_LINE_2   0x10

Definition at line 12 of file graph.h.

Typedef Documentation

typedef struct _PH_GRAPH_STATE * PPH_GRAPH_STATE

Function Documentation

VOID PhDeleteGraphBuffers ( _Inout_ PPH_GRAPH_BUFFERS  Buffers)

Frees resources used by a graph buffer management structure.

Parameters
BuffersThe buffer management structure.

Definition at line 1369 of file graph.c.

PHLIBAPI VOID PhDeleteGraphState ( _Inout_ PPH_GRAPH_STATE  State)

Definition at line 1431 of file graph.c.

PHLIBAPI VOID PhDrawGraph ( _In_ HDC  hdc,
_In_ PPH_GRAPH_DRAW_INFO  DrawInfo 
)

Draws a graph.

Parameters
hdcThe DC to draw to.
DrawInfoA structure which contains graphing information.
Remarks
This function is extremely slow. Use PhDrawGraphDirect() whenever possible.

Definition at line 99 of file graph.c.

PHLIBAPI VOID PhDrawGraphDirect ( _In_ HDC  hdc,
_In_ PVOID  Bits,
_In_ PPH_GRAPH_DRAW_INFO  DrawInfo 
)

Draws a graph directly to memory.

Parameters
hdcThe DC to draw to. This is only used when drawing text.
BitsThe bits in a bitmap.
DrawInfoA structure which contains graphing information.
Remarks
The following information is fixed:
  • The graph is fixed to the origin (0, 0).
  • The total size of the bitmap is assumed to be Width and Height in DrawInfo.
  • Step is fixed at 2.
  • If PH_GRAPH_USE_LINE_2 is specified in Flags, PH_GRAPH_OVERLAY_LINE_2 is never used.

Definition at line 413 of file graph.c.

PHLIBAPI VOID PhGetDrawInfoGraphBuffers ( _Inout_ PPH_GRAPH_BUFFERS  Buffers,
_Inout_ PPH_GRAPH_DRAW_INFO  DrawInfo,
_In_ ULONG  DataCount 
)

Sets up a graphing information structure with information from a graph buffer management structure.

Parameters
BuffersThe buffer management structure.
DrawInfoThe graphing information structure.
DataCountThe number of data points currently required. The buffers are resized if needed.

Definition at line 1386 of file graph.c.

BOOLEAN PhGraphControlInitialization ( VOID  )

Definition at line 66 of file graph.c.

PHLIBAPI VOID PhGraphStateGetDrawInfo ( _Inout_ PPH_GRAPH_STATE  State,
_In_ PPH_GRAPH_GETDRAWINFO  GetDrawInfo,
_In_ ULONG  DataCount 
)

Definition at line 1440 of file graph.c.

VOID PhInitializeGraphBuffers ( _Out_ PPH_GRAPH_BUFFERS  Buffers)

Initializes a graph buffer management structure.

Parameters
BuffersThe buffer management structure.

Definition at line 1354 of file graph.c.

PHLIBAPI VOID PhInitializeGraphState ( _Out_ PPH_GRAPH_STATE  State)

Definition at line 1421 of file graph.c.

PHLIBAPI VOID PhSetGraphText ( _In_ HDC  hdc,
_Inout_ PPH_GRAPH_DRAW_INFO  DrawInfo,
_In_ PPH_STRINGREF  Text,
_In_ PRECT  Margin,
_In_ PRECT  Padding,
_In_ ULONG  Align 
)

Sets the text in a graphing information structure.

Parameters
hdcThe DC to perform calculations from.
DrawInfoA structure which contains graphing information. The structure is modified to contain the new text information.
TextThe text.
MarginThe margins of the text box from the edges of the graph.
PaddingThe padding within the text box.
AlignThe alignment of the text box.

Definition at line 703 of file graph.c.

Variable Documentation

RECT PhNormalGraphTextMargin

Definition at line 63 of file graph.c.

RECT PhNormalGraphTextPadding

Definition at line 64 of file graph.c.