2019-05-02 15:29:04 -07:00
# Adding a Settings Property
1. Add to wincon.w
* THIS IS NOT IN OPENCONSOLE. Make sure you update
`.../console/published/wincon.w` in the OS repo when you submit the PR.
The branch won't build without it.
* For now, you can update winconp.h with your consumable changes.
2023-12-06 03:09:00 +05:30
* Define registry name (ex: `CONSOLE_REGISTRY_CURSORCOLOR` )
* Add the setting to `CONSOLE_STATE_INFO` .
2020-11-26 01:31:37 +05:30
* Define the property key ID and the property key itself.
2023-12-06 03:09:00 +05:30
- Yes, the large majority of the `DEFINE_PROPERTYKEY` defs are the same, it's only the last byte of the guid that changes.
2019-05-02 15:29:04 -07:00
2. Add matching fields to Settings.hpp
2020-12-18 04:42:36 +05:30
- Add getters, setters, the whole drill.
2019-05-02 15:29:04 -07:00
2019-05-16 06:02:42 +02:00
3. Add to the propsheet
2019-05-02 15:29:04 -07:00
- We need to add it to * reading and writing * the registry from the propsheet, and * reading * the link from the propsheet. Yes, that's weird, but the propsheet is smart enough to re-use ShortcutSerialization::s_SetLinkValues, but not smart enough to do the same with RegistrySerialization.
- `src/propsheet/registry.cpp`
- `propsheet/registry.cpp@InitRegistryValues` should initialize the default value for the property.
2023-12-06 03:09:00 +05:30
- `propsheet/registry.cpp@GetRegistryValues` should make sure to read the property from the registry.
2019-05-02 15:29:04 -07:00
2023-12-06 03:09:00 +05:30
4. Add the field to the propslib registry map.
2019-05-02 15:29:04 -07:00
5. Add the value to `ShortcutSerialization.cpp`
- Read the value in `ShortcutSerialization::s_PopulateV2Properties`
- Write the value in `ShortcutSerialization::s_SetLinkValues`
6. Add the setting to `Menu::s_GetConsoleState` , and `Menu::s_PropertiesUpdate`
Now, your new setting should be stored just like all the other properties.
2019-05-16 06:02:42 +02:00
7. Update the feature test properties to get add the setting as well
2019-05-02 15:29:04 -07:00
- `ft_uia/Common/NativeMethods.cs@WinConP` :
2023-12-06 03:09:00 +05:30
- `Wtypes.PROPERTYKEY PKEY_Console_` .
- `NT_CONSOLE_PROPS` .
2019-05-02 15:29:04 -07:00
8. Add the default value for the setting to `win32k-settings.man`
- If the setting shouldn't default to 0 or `nullptr` , then you'll need to set the default value of the setting in `win32k-settings.man` .
2023-12-06 03:09:00 +05:30
9. Update `Settings::InitFromStateInfo` and `Settings::CreateConsoleStateInfo` to get/set the value in a CONSOLE_STATE_INFO appropriately.
2019-05-02 15:29:04 -07:00