Hi all

Here is my attemt to make a hex edit custom control.
Please help me test it.



07-13-2003, 26 dl, Fixed a memory size calculation bug, added cut, copy and paste.
07-14-2003, 21 dl, Fixed several bugs, added undo / redo.
07-15-2003,19 dl, Fixed bugs, added bookmarks, included full source.
07-18-2003,36 dl, Fixed a copy bug.
07-18-2003,8 dl, Fixed an insert mode bug. Added messages to set linenumber and selectionbar widths.
07-22-2003,18 dl, Can now be used on dialogs. Setting system fixed font if non monospaced font.
07-24-2003,18 dl, Fixed serious bug in EM_STREAMOUT. Added lost focus selection color. Added EN_SETFOCUS/EN_KILLFOCUS notification messages.
08-14-2003,35 dl, Added a few edit messages. Fixed a minor bug.
Posted on 2003-07-12 09:56:39 by KetilO

your attempt is good!

1) would like double click in address to select line
2) would like msg to lock size of hex file (no delete/insert)
3) would like ability to colour individual cells. (cant do this atm, cos whole line is created as text?)
(to colour asm instructions etc, or record types)
4) would like to use system colours for control
5) trying to open pagefile.sys (no access), msgbox appears showing can not open file. but caption is set to filename
6) tried to open 97MB file, hexed died, left it 10 minutes (in a frenzy of globalrealloc?!)
near where u did, cmp edx, eax, je ... add eax, 4096.
i suspect an add <??>, eax value is looping

Posted on 2003-07-12 16:14:49 by X05
Hi KetilO,

thanks for posting this. Looks good.

My questions are:

1. Since this is supposed to be a hex edit CONTROL, wouldn't it be usefull to add an include file where these symbolic constants (STYLE_NOADDRESS, HEM_SETFONT) are defined. Possibly the window class is usefull as well.
2. A source code sample demonstrating how to create a hex edit window would be great
3. Is your control free to use?

Posted on 2003-07-13 02:37:38 by japheth
Hi X05

Thanks for your feedback and suggestions.

The memory allocation bug is fixed.

Posted on 2003-07-13 03:45:37 by KetilO
Hi japheth

1. RAHexEd.inc included
2. All sources will be released when I'm done.
3. Sure.


RAHexEd.dll is also a RadASM costom control, meaning you can use it in visual dialog design.

In RadASM.ini section add:


Where xx is next free number.

Posted on 2003-07-13 03:52:44 by KetilO

Select HexEdit Font -> Terminal
Type Bold
Size 9

And select something in Hex numbers are weird.

Is this a bug or?

Posted on 2003-07-13 06:53:21 by RvaZero
Hi RvaZero

I will fix it.

Posted on 2003-07-13 08:45:26 by KetilO
Very good and useful !

Could you add to your todo list the ability of editing on ascii panel?

Posted on 2003-07-14 02:59:24 by pelaillo
Hi pelaillo


Very good idea, I,ll see wat I can do.

Posted on 2003-07-14 09:36:40 by KetilO
Hi all

New upload at the top.

Posted on 2003-07-14 10:37:08 by KetilO
Hi all

New upload at the top.

Fixed a few bugs.
Added bookmarks.
Included full source.

Please report any bugs and suggestions on how to improve.

Posted on 2003-07-15 06:20:38 by KetilO
i think you have aproblem while copying or cutting from the text .
it take the first bytes and not the selected ones .

Posted on 2003-07-17 20:40:28 by eko
Hi eko

New upload at the top.

Posted on 2003-07-18 02:02:01 by KetilO
Hi Ketil,

Cool control :alright:

It would be nice to be able to select from the ascii pane and when selecting hex to hilite the selection in the ascii pane as well.
Posted on 2003-07-18 02:19:35 by donkey
Hi KetilO,

Ive integrated your control in one of my apps (IStorage interface viewer) and it does a good job. Thanks again.

I know, we have source code available, but if you feel bored over the weekend (;) ), I have some suggestions:

1. my dialog boxes all use MS Sans Serif as default font. HexEdit accepts this font, but since it is not a fixed one it has problems to calculate caret position. So possible it would be a good idea to refuse setting non-fixed fonts and use the system default fixed one instead.

2. as well as donkey I would appreciate to be able to select in ascii pane

3. context menu (like edit control) would be not bad

4. ability to totally suppress first pane (line numbers)

Posted on 2003-07-18 07:42:49 by japheth
Hi japheth

1. Should not be too hard.
2. Nice feature but lots of work. I will see if I can find the time.
3. Most of the time I want to create my own context menu. Don't think I will bloat the dll.
4. Messages to set linenumber and selectionbar widths added.

Posted on 2003-07-18 09:25:54 by KetilO
Hi KetilO,

to make your control to work fine in dialog boxes, you should possibly handle WM_GETDLGCODE in RAHexEdProc, for example

.elseif eax == WM_GETDLGCODE

jmp Ex

Posted on 2003-07-22 12:14:13 by japheth
Hi japheth

Was unaware of that window message.

New upload at the top.

Posted on 2003-07-22 13:10:01 by KetilO
Where do you find the time for all these project you pump out by the megabyte?

Posted on 2003-07-22 22:19:00 by _Shawn

my last suggestion was incomplete, it has to be

.elseif eax == WM_GETDLGCODE

Without that your control wont get WM_CHAR messages in dialog boxes

Sorry for causing problems. I havent downloaded your last version to see if you have found out that by yourself.

Posted on 2003-07-23 05:09:30 by japheth