-
Notifications
You must be signed in to change notification settings - Fork 78
/
TDataEditor.h
78 lines (58 loc) · 3.1 KB
/
TDataEditor.h
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
/*****************************************************************************/
/* TDataEditor.h Copyright (c) Ladislav Zezula 2014 */
/*---------------------------------------------------------------------------*/
/* Description : */
/*---------------------------------------------------------------------------*/
/* Date Ver Who Comment */
/* -------- ---- --- ------- */
/* 18.03.14 1.00 Lad The first version of TDataEditor.h */
/*****************************************************************************/
#ifndef __TDATAEDITOR_H__
#define __TDATAEDITOR_H__
//-----------------------------------------------------------------------------
// Defines
#define DATAEDIT_COLOR_NORMAL_FG RGB(0, 0, 0)
#define DATAEDIT_COLOR_NORMAL_BG RGB(255, 255, 255)
#define DATAEDIT_COLOR_SELECTION_FG RGB(255, 255, 255)
#define DATAEDIT_COLOR_SELECTION_BG RGB(49, 106, 197)
#define DATAEDIT_TEXT_INDENT 2 // Number of pixels before the first character
// Data Editor styles
#define DES_HSCROLL 0x00000010
#define DES_VSCROLL 0x00000020
enum TPointerFormat
{
PtrPlatformSpecific = 0,
PtrPointer32Bit,
PtrPointer64Bit
};
//-----------------------------------------------------------------------------
// Messages for data editor (via WM_NOTIFY)
#define DEN_EXCEPTION (WM_USER + 0x1000)
typedef struct _DTE_EXCEPTION_DATA
{
NMHDR hdr; // Common header
PVOID ExceptionAddress; // Address where the exception happened
ULONG ExceptionCode;
BOOL WriteOperation;
} DTE_EXCEPTION_DATA, *PDTE_EXCEPTION_DATA;
#define DEN_PASTE (WM_USER + 0x1001)
typedef struct _DTE_PASTE_DATA
{
NMHDR hdr; // Common header
LPCSTR szPasteText; // Pointer to the text to be pasted
SIZE_T PasteOffset; // Offset in the data corresponding to the current cursor position
SIZE_T PasteLength; // Length of the text being pasted
BOOL bHandled; // If someone sets this to TRUE, then data editor will not process it fuhrter
} DTE_PASTE_DATA, *PDTE_PASTE_DATA;
//-----------------------------------------------------------------------------
// Class name of the data editor
extern const LPTSTR szDataEditClassName;
//-----------------------------------------------------------------------------
// Data Editor interface
// Registers the data editor
int RegisterDataEditor(HINSTANCE hInst);
// Applies the new data
int DataEditor_SetData(HWND hWndDataEdit, ULONGLONG BaseAddress, LPVOID pvData, SIZE_T cbData);
// Sets the pointer format
int DataEditor_SetDataFormat(HWND hWndDataEdit, TPointerFormat PtrFormat, SIZE_T cbBytesPerLine);
#endif // __TDATAEDITOR_H__