[PR #17] [MERGED] Add runtime icon customization via View menu #23

Closed
opened 2026-03-03 12:01:46 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ForLoopCodes/legacy-notepad/pull/17
Author: @Copilot
Created: 2/4/2026
Status: Merged
Merged: 2/4/2026
Merged by: @ForLoopCodes

Base: mainHead: copilot/add-icon-change-feature


📝 Commits (5)

  • 263e83a Initial plan
  • 9b3d4e0 Add icon change feature with menu items and handlers
  • ef8431d Fix icon loading flags and update README documentation
  • 94f21af Address code review feedback: use static_cast instead of reinterpret_cast
  • 8ea227d Add runtime icon customization via View menu

📊 Changes

36 files changed (+2810 additions, -0 deletions)

View changed files

📝 README.md (+1 -0)
_codeql_build_dir/CMakeCache.txt (+353 -0)
_codeql_build_dir/CMakeFiles/3.31.6/CMakeCXXCompiler.cmake (+101 -0)
_codeql_build_dir/CMakeFiles/3.31.6/CMakeDetermineCompilerABI_CXX.bin (+0 -0)
_codeql_build_dir/CMakeFiles/3.31.6/CMakeSystem.cmake (+15 -0)
_codeql_build_dir/CMakeFiles/3.31.6/CompilerIdCXX/CMakeCXXCompilerId.cpp (+919 -0)
_codeql_build_dir/CMakeFiles/3.31.6/CompilerIdCXX/a.out (+0 -0)
_codeql_build_dir/CMakeFiles/CMakeConfigureLog.yaml (+294 -0)
_codeql_build_dir/CMakeFiles/CMakeDirectoryInformation.cmake (+16 -0)
_codeql_build_dir/CMakeFiles/Makefile.cmake (+114 -0)
_codeql_build_dir/CMakeFiles/Makefile2 (+125 -0)
_codeql_build_dir/CMakeFiles/Progress/1 (+1 -0)
_codeql_build_dir/CMakeFiles/Progress/count.txt (+1 -0)
_codeql_build_dir/CMakeFiles/TargetDirectories.txt (+3 -0)
_codeql_build_dir/CMakeFiles/cmake.check_cache (+1 -0)
_codeql_build_dir/CMakeFiles/legacy-notepad.dir/DependInfo.cmake (+32 -0)
_codeql_build_dir/CMakeFiles/legacy-notepad.dir/build.make (+246 -0)
_codeql_build_dir/CMakeFiles/legacy-notepad.dir/cmake_clean.cmake (+28 -0)
_codeql_build_dir/CMakeFiles/legacy-notepad.dir/compiler_depend.make (+2 -0)
_codeql_build_dir/CMakeFiles/legacy-notepad.dir/compiler_depend.ts (+2 -0)

...and 16 more files

📄 Description

Adds ability to change application icon to any .ico file at runtime, enabling use of classic Notepad icons or custom alternatives.

Implementation

  • Menu: View > Icon submenu with "Change Icon..." and "Reset to Default" options
  • State: Added customIconPath to AppState and g_hCustomIcon global for icon handle tracking
  • Dialog: File picker filtered to .ico files, loads via LoadImageW with LR_LOADFROMFILE
  • Application: Sets both ICON_BIG and ICON_SMALL via WM_SETICON message
  • Cleanup: Custom icons destroyed in WM_DESTROY; system default icons remain unmanaged

Usage

// User selects custom icon
ViewChangeIcon();  // Opens file dialog, loads and applies icon

// User resets to default
ViewResetIcon();   // Restores bundled icon resource

Resource IDs IDM_VIEW_ICON_CHANGE (40073) and IDM_VIEW_ICON_RESET (40074) added to maintain ID space continuity.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add feature to change icon</issue_title>
<issue_description>Please add a feature to change the program icon so we can choose one that looks like the classic Notepad.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ForLoopCodes/legacy-notepad/pull/17 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 2/4/2026 **Status:** ✅ Merged **Merged:** 2/4/2026 **Merged by:** [@ForLoopCodes](https://github.com/ForLoopCodes) **Base:** `main` ← **Head:** `copilot/add-icon-change-feature` --- ### 📝 Commits (5) - [`263e83a`](https://github.com/ForLoopCodes/legacy-notepad/commit/263e83a547e5659f17b3c2a762fee51ff0e955aa) Initial plan - [`9b3d4e0`](https://github.com/ForLoopCodes/legacy-notepad/commit/9b3d4e0fcd58339fa3c5c8a6fc294129a75946b2) Add icon change feature with menu items and handlers - [`ef8431d`](https://github.com/ForLoopCodes/legacy-notepad/commit/ef8431d2ace30cd787da0dd28a3b8365a8c1db0b) Fix icon loading flags and update README documentation - [`94f21af`](https://github.com/ForLoopCodes/legacy-notepad/commit/94f21af1824ae2c92702c0dae1e89d5bcb240d2a) Address code review feedback: use static_cast instead of reinterpret_cast - [`8ea227d`](https://github.com/ForLoopCodes/legacy-notepad/commit/8ea227db2e87cdbbeda450b114ac1d68646755b7) Add runtime icon customization via View menu ### 📊 Changes **36 files changed** (+2810 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -0) ➕ `_codeql_build_dir/CMakeCache.txt` (+353 -0) ➕ `_codeql_build_dir/CMakeFiles/3.31.6/CMakeCXXCompiler.cmake` (+101 -0) ➕ `_codeql_build_dir/CMakeFiles/3.31.6/CMakeDetermineCompilerABI_CXX.bin` (+0 -0) ➕ `_codeql_build_dir/CMakeFiles/3.31.6/CMakeSystem.cmake` (+15 -0) ➕ `_codeql_build_dir/CMakeFiles/3.31.6/CompilerIdCXX/CMakeCXXCompilerId.cpp` (+919 -0) ➕ `_codeql_build_dir/CMakeFiles/3.31.6/CompilerIdCXX/a.out` (+0 -0) ➕ `_codeql_build_dir/CMakeFiles/CMakeConfigureLog.yaml` (+294 -0) ➕ `_codeql_build_dir/CMakeFiles/CMakeDirectoryInformation.cmake` (+16 -0) ➕ `_codeql_build_dir/CMakeFiles/Makefile.cmake` (+114 -0) ➕ `_codeql_build_dir/CMakeFiles/Makefile2` (+125 -0) ➕ `_codeql_build_dir/CMakeFiles/Progress/1` (+1 -0) ➕ `_codeql_build_dir/CMakeFiles/Progress/count.txt` (+1 -0) ➕ `_codeql_build_dir/CMakeFiles/TargetDirectories.txt` (+3 -0) ➕ `_codeql_build_dir/CMakeFiles/cmake.check_cache` (+1 -0) ➕ `_codeql_build_dir/CMakeFiles/legacy-notepad.dir/DependInfo.cmake` (+32 -0) ➕ `_codeql_build_dir/CMakeFiles/legacy-notepad.dir/build.make` (+246 -0) ➕ `_codeql_build_dir/CMakeFiles/legacy-notepad.dir/cmake_clean.cmake` (+28 -0) ➕ `_codeql_build_dir/CMakeFiles/legacy-notepad.dir/compiler_depend.make` (+2 -0) ➕ `_codeql_build_dir/CMakeFiles/legacy-notepad.dir/compiler_depend.ts` (+2 -0) _...and 16 more files_ </details> ### 📄 Description Adds ability to change application icon to any `.ico` file at runtime, enabling use of classic Notepad icons or custom alternatives. ## Implementation - **Menu**: View > Icon submenu with "Change Icon..." and "Reset to Default" options - **State**: Added `customIconPath` to `AppState` and `g_hCustomIcon` global for icon handle tracking - **Dialog**: File picker filtered to `.ico` files, loads via `LoadImageW` with `LR_LOADFROMFILE` - **Application**: Sets both `ICON_BIG` and `ICON_SMALL` via `WM_SETICON` message - **Cleanup**: Custom icons destroyed in `WM_DESTROY`; system default icons remain unmanaged ## Usage ```cpp // User selects custom icon ViewChangeIcon(); // Opens file dialog, loads and applies icon // User resets to default ViewResetIcon(); // Restores bundled icon resource ``` Resource IDs `IDM_VIEW_ICON_CHANGE` (40073) and `IDM_VIEW_ICON_RESET` (40074) added to maintain ID space continuity. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Add feature to change icon</issue_title> > <issue_description>Please add a feature to change the program icon so we can choose one that looks like the classic Notepad.</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes ForLoopCodes/legacy-notepad#16 <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 12:01:46 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/legacy-notepad#23
No description provided.