Save and load preferences using the registry

Preferences are now saved and loaded using the registry. They are loaded at application startup and written to the registry every time a change is made. If no preferences are present in the registry yet, the current display mode is used for both battery and AC power.
This commit is contained in:
2025-08-09 11:56:59 -04:00
parent 046e8fd2eb
commit 4b46eafd35
2 changed files with 76 additions and 26 deletions

View File

@ -7,10 +7,10 @@ Currently a work in progress. Not very useful yet since it doesn't save your pre
This is a simple C program written using Visual Studio 2022 that has no external dependencies. It should support Windows Vista or higher, but this hasn't been tested yet.
## TODO
- [ ] Save preferences to the Windows registry.
- [x] Save preferences to the Windows registry.
- [ ] Add a checkbox to preferences for starting at login.
- [ ] Add an icon.
- [ ] Add behavior for when multiple displays are connected.
- [ ] Block program from running when the system has no battery.
- [ ] Make the default display mode the current one instead of the highest resolution if there are no preferences set.
- [x] Make the default display mode the current one instead of the highest resolution if there are no preferences set.
- [ ] Make an actual about dialog.