Release v1

This commit is contained in:
acidburn
2025-12-03 14:04:56 -05:00
parent b7f9692e30
commit bd6a229b40
6 changed files with 104 additions and 12 deletions
+9
View File
@@ -0,0 +1,9 @@
# Build outputs
ClassicNotepad.exe
notepad.exe
ClassicNotepad.res
ClassicNotepadSetup.exe
# IDE artifacts
*.code-workspace
.vscode/
+5 -5
View File
@@ -76,7 +76,7 @@ static void UpdateTitle(HWND hwnd)
} }
WCHAR title[512]; WCHAR title[512];
swprintf_s(title, ARRAYSIZE(title), L"%s - ClasicNotepad", name); swprintf_s(title, ARRAYSIZE(title), L"%s - ClassicNotepad", name);
SetWindowTextW(hwnd, title); SetWindowTextW(hwnd, title);
} }
@@ -158,7 +158,7 @@ static HMENU BuildMenu(void)
AppendMenuW(hFormat, MF_STRING, IDM_FORMAT_FONT, L"&Font..."); AppendMenuW(hFormat, MF_STRING, IDM_FORMAT_FONT, L"&Font...");
HMENU hHelp = CreatePopupMenu(); HMENU hHelp = CreatePopupMenu();
AppendMenuW(hHelp, MF_STRING, IDM_HELP_ABOUT, L"&About ClasicNotepad"); AppendMenuW(hHelp, MF_STRING, IDM_HELP_ABOUT, L"&About ClassicNotepad");
AppendMenuW(hMenu, MF_POPUP, (UINT_PTR)hFile, L"&File"); AppendMenuW(hMenu, MF_POPUP, (UINT_PTR)hFile, L"&File");
AppendMenuW(hMenu, MF_POPUP, (UINT_PTR)hEdit, L"&Edit"); AppendMenuW(hMenu, MF_POPUP, (UINT_PTR)hEdit, L"&Edit");
@@ -428,7 +428,7 @@ static void ChooseFontAndApply(HWND hwnd)
static void ShowAbout(HWND hwnd) static void ShowAbout(HWND hwnd)
{ {
MessageBoxW(hwnd, L"ClasicNotepad\nBuilt with Win32 API in C.", L"About", MB_OK | MB_ICONINFORMATION); MessageBoxW(hwnd, L"ClassicNotepad\nBuilt with Win32 API in C.\ngithub.com/acidburnmonkey/ClassicNotepad", L"About", MB_OK | MB_ICONINFORMATION);
} }
static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -552,7 +552,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
wc.hIcon = hIconLarge; wc.hIcon = hIconLarge;
wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wc.lpszClassName = L"ClasicNotepadClass"; wc.lpszClassName = L"ClassicNotepadClass";
wc.hIconSm = hIconSmall; wc.hIconSm = hIconSmall;
if (!RegisterClassExW(&wc)) if (!RegisterClassExW(&wc))
@@ -561,7 +561,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
return -1; return -1;
} }
HWND hwnd = CreateWindowExW(0, wc.lpszClassName, L"ClasicNotepad", WS_OVERLAPPEDWINDOW, HWND hwnd = CreateWindowExW(0, wc.lpszClassName, L"ClassicNotepad", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, NULL, NULL, hInstance, NULL); CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, NULL, NULL, hInstance, NULL);
if (!hwnd) if (!hwnd)
+39
View File
@@ -0,0 +1,39 @@
[Setup]
AppId={{B7CBF4E7-9E8F-4A5B-9B73-7B7E5D5D5E6A}}
AppName=ClassicNotepad
AppVersion=1.0.0
AppPublisher=ClassicNotepad
DefaultDirName={autopf}\ClassicNotepad
DefaultGroupName=ClassicNotepad
OutputBaseFilename=ClassicNotepadSetup
SetupIconFile=app.ico
UninstallDisplayIcon={app}\ClassicNotepad.exe
ArchitecturesAllowed=x86 x64
ArchitecturesInstallIn64BitMode=x64
PrivilegesRequired=lowest
ChangesAssociations=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "Create a &desktop icon"; Flags: unchecked
Name: "assoc"; Description: "Set ClassicNotepad as the default for .txt files"; Flags: unchecked
[Files]
Source: "ClassicNotepad.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "notepad.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "app.ico"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
Name: "{autoprograms}\ClassicNotepad"; Filename: "{app}\ClassicNotepad.exe"; IconFilename: "{app}\app.ico"
Name: "{autoprograms}\Notepad (ClassicNotepad)"; Filename: "{app}\ClassicNotepad.exe"; IconFilename: "{app}\app.ico"
Name: "{autoprograms}\Notepad"; Filename: "{app}\notepad.exe"; IconFilename: "{app}\app.ico"
Name: "{autodesktop}\ClassicNotepad"; Filename: "{app}\ClassicNotepad.exe"; Tasks: desktopicon; IconFilename: "{app}\app.ico"
[Registry]
; Associate .txt with ClassicNotepad (per-user)
Root: HKCU; Subkey: "Software\Classes\.txt"; ValueType: string; ValueName: ""; ValueData: "ClassicNotepad.txt"; Tasks: assoc; Flags: uninsdeletevalue
Root: HKCU; Subkey: "Software\Classes\ClassicNotepad.txt"; ValueType: string; ValueData: "Text Document"; Tasks: assoc; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\Classes\ClassicNotepad.txt\DefaultIcon"; ValueType: string; ValueData: "{app}\ClassicNotepad.exe,0"; Tasks: assoc; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\Classes\ClassicNotepad.txt\shell\open\command"; ValueType: string; ValueData: """{app}\ClassicNotepad.exe"" ""%1"""; Tasks: assoc; Flags: uninsdeletekey
+3
View File
@@ -0,0 +1,3 @@
#include <windows.h>
IDI_APP ICON "app.ico"
+25 -7
View File
@@ -1,8 +1,16 @@
SHELL = cmd
.SHELLFLAGS = /C
CC = gcc CC = gcc
WINDRES = windres WINDRES = windres
TARGET = ClasicNotepad.exe TARGET = ClassicNotepad.exe
SRC = ClasicNotepad.c SRC = ClassicNotepad.c
RES = ClasicNotepad.res RES = ClassicNotepad.res
ALIAS = notepad.exe
ISCC = iscc
INSTALLER = ClassicNotepadSetup.exe
CP = copy /y
RM = del /f /q
CFLAGS = -Wall -Wextra -std=c11 -mwindows CFLAGS = -Wall -Wextra -std=c11 -mwindows
LDLIBS = -luser32 -lgdi32 -lcomdlg32 LDLIBS = -luser32 -lgdi32 -lcomdlg32
@@ -10,9 +18,19 @@ LDLIBS = -luser32 -lgdi32 -lcomdlg32
$(TARGET): $(SRC) $(RES) $(TARGET): $(SRC) $(RES)
$(CC) $(CFLAGS) -o $@ $(SRC) $(RES) $(LDLIBS) $(CC) $(CFLAGS) -o $@ $(SRC) $(RES) $(LDLIBS)
$(RES): ClasicNotepad.rc app.ico $(ALIAS): $(TARGET)
$(WINDRES) -O coff ClasicNotepad.rc $(RES) $(CP) $(TARGET) $(ALIAS) >NUL
$(RES): ClassicNotepad.rc app.ico
$(WINDRES) -O coff ClassicNotepad.rc $(RES)
.PHONY: all clean install
all: $(TARGET) $(ALIAS)
install: $(INSTALLER)
$(INSTALLER): ClassicNotepad.iss $(TARGET) $(ALIAS) app.ico
$(ISCC) ClassicNotepad.iss
.PHONY: clean
clean: clean:
del /f /q $(TARGET) $(RES) 2>NUL || true -$(RM) $(TARGET) $(RES) $(ALIAS) $(INSTALLER) 2>NUL
+23
View File
@@ -0,0 +1,23 @@
# ClassicNotepad
Lightweight Win32 notepad-like editor with word wrap toggle, font picker, and custom icon.
## Build
Prereqs: MinGW toolchain on PATH (`gcc`, `windres`, `mingw32-make`).
```bash
mingw32-make all
```
Outputs:
- `ClassicNotepad.exe` — main executable
- `notepad.exe` — alias for quick search
Clean build artifacts:
```bash
mingw32-make clean
```
## Run
Launch `ClassicNotepad.exe` (or `notepad.exe`) from the build directory.