A Petzold-style Win32 Notepad clone written in mostly plain C. It keeps the classic menus, accelerators, word wrap toggle, status bar, find/replace, font picker, time/date insertion, and BOM-aware load/save. Printing is intentionally omitted.
- Git
- Visual Studio 2022 (or Build Tools) with the "Desktop development with C++" workload
- Use a "x64 Native Tools Command Prompt for VS 2022" (or any Developer Command Prompt) so
cl,rc, andnmakeare on yourPATH.
Optional: MinGW-w64 for make + gcc (a separate POSIX-style Makefile is included).
git clone https://github.com/your/repo.git retropad
cd retropadFrom a Developer Command Prompt:
nmake /f makefileThis runs rc then cl and produces retropad.exe in the repo root. Clean with:
nmake /f makefile cleanIf you have gcc, windres, and make on PATH:
makeArtifacts end up in the repo root (retropad.exe, object files, and retropad.res). Clean with make clean.
Double-click retropad.exe or start from a prompt:
.\retropad.exe- Menus/accelerators: File, Edit, Format, View, Help; classic Notepad key bindings (Ctrl+N/O/S, Ctrl+F, F3, Ctrl+H, Ctrl+G, F5, etc.).
- Word Wrap toggles horizontal scrolling; status bar auto-hides while wrapped, restored when unwrapped.
- Find/Replace dialogs (standard
FINDMSGSTRING), Go To (disabled when word wrap is on). - Font picker (ChooseFont), time/date insertion, drag-and-drop to open files.
- File I/O: detects UTF-8/UTF-16 BOMs, falls back to UTF-8/ANSI heuristic; saves with UTF-8 BOM by default.
- Printing/page setup menu items show a “not implemented” notice by design.
- Icon: linked as the main app icon from
res/retropad.icoviaretropad.rc.
retropad.c— WinMain, window proc, UI logic, find/replace, menus, layout.file_io.c/.h— file open/save dialogs and encoding-aware load/save helpers.resource.h— resource IDs.retropad.rc— menus, accelerators, dialogs, version info, icon.res/retropad.ico— application icon.makefile— MSVCnmakebuild script.Makefile— MinGW/GNU make build script.
- If
nmakeis missing, use a Developer Command Prompt (it sets upPATH). - If you see RC4204 warnings about ASCII/virtual keys, they’re benign and come from control-key accelerator lines.
- If
rc/claren’t found, rerunvcvarsall.bator reopen the Developer Command Prompt.