[Windows Mobile Development and Hacking General] tobbbie:
This is for Smartphone (Windows Mobile Standard) only - Settings are handled differently on touchscreen (WM professional) devices.

You may have noticed that Windows Mobile Standard had introduced a method of manipulating the Settings application via registry entries in HKEY_LOCAL_MACHINE\System\SettingsApp\<relevant-panel>.cpl.xml\ from WM6.1 onwards.

You can find examples in the \SYS\SHELL\*.RGU

I have not found any documentation on MSDN regarding that sadly, so let me share some findings that may help you to utilize this feature.

It looks all straight forward, you can (ADD, DELETE) at (TOP, BOTTOM) of the panel and the relevant entries are just string values named "0", "1" each carrying the string to extend the panel with (mind to escape all embedded " with \").

To avoid duplicate entries in existing panels there is an (initially invisible) check implemented when a panel is first called - and this is where my investigation ended finally :-)

So when you first call any of the settings panels after cold-boot, the settings function checks the loaded panel with the strings defined in the relevant part of the registry and acts accordingly (ADD, DELETE at TOP, BOTTOM) for display.

It does a second job however additionally: it cleans up the entries that are duplicate (so they exist already in the current panel) and deletes these from the registry.

Sadly this detection logic is very simple and does not ignore the XML comment of the original panel, which is treated properly when displaying the panel. I believe it only takes the added string and checks to find this in the raw panel data (normalizing on blanks, CR/LF and TABs maybe).

How I found the problem:

Motivation:

I wanted to better modularize my kitchen settings and bundle the parts that a package needs to have with that package. So the registry in the .rgu, let the .provxml care about the language settings in MetaDB and now also the relevant dedicated settings panel. So if the build has that package included - then the settings panel is there, if the build was made without that package, then the panel would not be there (and not visible from its parent panel).

Implementation:

When moving the functionality from the dedicated panel to the registry entries, I had decided to just "comment out" the related settings in the original panel and have them added via registry later again.

Problem:

The check for duplication on first call of the relevant settings panel has however removed the registry settings again due to falsely identifying them as "duplicate" as they were still present in the panel, yet commented out there.

Solution:

Remove the entries from the original panel or alter them so that the duplication check will not delete the registry entries.

It took me some time (and wild speculations on why the registry data would not be treated or deleted again) to track that down, so I hope someone may benefit from writing. I know that most will simply delete all the registry extensions and hard-code the panels - but for the sake of modularity there is one trap less to step into.

There are still a few smartphone cooks out there - greetings to all of you!