NumCon64 V0.1

A simple but sophisticated utility to convert between binary, octal, decimal and hexadecimal.
The numbers are limited to 64 bits due to lack of functions to convert variables larger than "long long int".

I wrote this as I've used Number Converter v1.0 (Numvert) from Alpha-II Productions (www.alpha-ii.com) for decades and got more and more annoyed over the shortcomings (like the Endian switch is useless) and other quirks (fucking Ctrl+C and Ctrl+V doesn't work).
Otherwise it was good and lightweight considering the filesize of 64KB.
But in recent years after getting a good grip on WinAPI programming, it made more sense to me to write my own replacement with the features that I want.
However, I left out floating point support as I didn't needed it and 64 bits seems good enough for me.
Also transparency is also not implemented as I don't need that crap.


This comes in two variants:
NumCon16 is Win16 for Windows 3.0 and newer and will run in real mode (also on anything 8086 and newer).
NumCon32 is Win32 for Windows NT 3.50 and newer and will work on Windows 9x/ME. 



The basic usage is quite simple. 
You just write put the value in applicable number field in and that will be automatically converted to other formats.

All number fields by default filter unsupported characters, pressing the minus key on decimal field will automatically add or remove the minus in that field.

AutoOffset is a number that can be easily added or subtracted to the end result by pressing the Enter key.
It will be only applied once and can be undone with Ctrl+Enter, the state will be retained if the number wasn't changed afterwards.
The state will be shown in the main dialog right above the '?' (About) button as the grayed out text "with AutoOffset".

The clipboard can be watched to automate pasting the value in, the AutoOffset will be automatically applied afterwards if enabled.

And at last the dialog can be resized but only horizontally.
You may need to do this to type in longer numbers or read the entire status bar.
The default size is enough for 34 bits.

Also the status bar will show the position of the cursor and which digits are selected.


--- The functions on the main dialog ---

[ ] AutoSpacer
This will add spaces to the binary value if either octal or hexadecimal field is focused, the decimal field will always remove it.

[ ? ]
Just the about dialog.

Bits: [0   ]
This shows the number of required bits to describe the number, in Negative mode the trailing 1s are ignored except for the last.
(a signed 2-bit value could be either 00=0; 01=1; 11=-1; 10=-2, so it makes sense that way in my mind)

[ ] Negative
This will fill in the remaining binary bits with ones and make the decimal number a negative number.

[ ] AutoOffset
Brings up a dialog to set the AutoOffset value and the operation, the format depends the last focused number field.
Clicking Cancel or Ok with a value of 0 will turn it off which will be shown by the lack of tickmark.
The default number is the last value, which is 0 if disabled.

[ ] Always on top
Makes the dialog above all other windows. Not available in Windows 3.0

[ ] Watch Clipboard
This will automatically paste the contents of the Clipboard into the specified number field if the text matches the number format.
The mouse cursor will turn into a cross and from there just click the number field you want to target.
You can also navigate with the Tab key to the number field and press Enter, this also works.
A '>' will appear on before the number label to show that AutoPaste is enabled for that field.
Unticking this will disable it.
For Hexadecimal all 'x','h',',' will be ignored and any "0x" will be correctly omitted. 

(#) Big Endian		( ) Little Endian
This will affect the hexadecimal field only and swaps the order of the bytes.


--- Settings in the window menu ---
(click icon in the upper left corner)

Lowercase Hex
This will output the hexadecimal value in lowercase.

Pad Hex
This will pad out the hexadecimal value to whole bytes.

Pad Binary
This will pad out the binary value to whole nybbles or octets if either field is focused.

Space Bytes
This will add spaces between the bytes in hexadecimal field.

Full AutoOffset
This will cause the AutoOffset to be applied if the number field loses focus.

AutoNegative
This will automatically tick the Negative checkbox if 64th bit is set. (Useful if AutoOffset caused a underflow)
It will also untick that if the bit is cleared.



--- The Files in this package ---

main.c - The entire program
main.h - Contains the resource IDs and most global variables and definitions
numcon.ico - The icon I drew for this program
main.rc - Resource code for Win32
main16.rc - Resource code for Win16
incmf.rc - Resource code to include manifest.xml for Win32
manifest.xml - Enables GUI themes on Windows XP and newer
numcon.wpj - Watcom project file
win2and1.txt - Notes for targeting Windows2.x and 1.x
COPYING - WTFPL license
win32\numcon32.exe - Compiled Win32 executable
win32\numcon32.tgt - Watcom target file for Win32
win16\numcon16.exe - Compiled Win16 executable
win16\numcon16.tgt - Watcom target file for Win16


The code got a bit out of hand as I didn't felt like packing dozen of snippets into functions, and passing pointers around and thinking of how I could wedge in another if() to reuse the code better.
So it contains a high amount of copypasted code.
I might refactor the codebase a bit in the next version or so, I guess when I'm bored enough to do so....

Also MODERNIZE_GUICOLOR is defined which adds extra code to change the colors to make the Win16 version match the Win32 counterpart.
This will also make the background of the read-only Bits fields grey on both Win16 and Win32.


T. Sosnow. <t-sosnow@posteo.com>
Visit QWERTZ-tek at http://qwertz.w10.site/ for my other stuff
November 7, 2026
