[Touch HD General] Z80-Man:
OK, I looked further in the registry and in the contacts themselves (using Outlook on your PC can help, too).

The "Favorite" contacts are actually tagged as belonging to a group ! That's how Back FavPeople Up! works. The group is labelled "1", where not classified contacts are tagged "0".

I managed to have Back FavPeople Up! working by checking the "Sense 2.5" box (I tried previously without success, but now it works. It may actually depend on the ROM build, even if all of them use Sense 2.5).

On restoration, it sometimes doesn't restore them all, though.

Then I analysed the resulting file named HTCcontact-backup.xml.

It's actually a bit messy, because Zenyee din't add a carriage return between each section, but it still works if you add yours to improve readability... It's just XML, after all. ;)

Here is its structure :

<?xml version="1.0"?>
<!--Backup of HTC Favorite Contacts by dzenkinz (ping@zenyee.com)-->
<ContactList>
<Contact>
<FileAs>Usual Name</FileAs>
<FirstName>First Name</FirstName>
<LastName>Last Name</LastName>
<RingTonePath>RingTone Path</RingTonePath>
<FavoriteContext>Index Number</FavoriteContext>
<FavoriteOrder>Order Number</FavoriteOrder>
</Contact>
<Contact>
...
<Contact>
...
</ContactList>

The contents between the tags should be self-explanatory for most of them ; some of them need some more explanation, however.

- If a tag is empty, then the syntax is simplified. If for example you don't have a specific ringtone linked to the contact, then it will just be noted :

<RingTonePath />

The same applies to any other empty tag.

- The "Index Number" tag contains some index relating to the contact's position in the list. It's a 7 digits (decimal) number. I'll go back on it later.

- The "Order number" tag is the most interesting, as it represents the position in the favorite list ! It's a decimal number between 0 and 14.

- The "Usual Name" is the one showing in the "Favorite Contacts" tab. The other ones are just a copy of their real content in the "All People" full list.

Now with these informations, I just did what I always do... Search the registry with the "Contact Number", hoping I could find them... And... Bingo ! ;)

You can find a section named "FavoriteOrder" in the [HKEY_CURRENT_USER\Software\HTC\People\] key...

And this is what's in it :

[HKEY_CURRENT_USER\Software\HTC\People\FavoriteOrder]
"0"=dword:Index Number 1
"1"=dword:index number 2
...

So this is a list of each contact index number, stored in a DWORD variable representing its rank on the "Favorite Contacts" tab.

It actually works, as if you juste restore these registry keys then soft reset, you'll see your contacts displayed in the require order.

If you want to leave some empty buttons in order to sort them, then you'll just put the value 0 into the variable wearing the position number (remember they begin at 0, so "0" is the first, "1" is the second, etc.)

You should actually fill in the whole 15 variables (using the 0 value for empty ones), or you'll end up with buttons wearing an old contact on it.

Warning : For the index number, be careful on the base you will use : the numbers found in the XML file are written in decimal, while the registry numbers are naturally written in hexadecimal, so if you must manually copy a value, be sure you first check the "decimal" button. ;)

Technically, you'll just export the [HKEY_CURRENT_USER\Software\HTC\People\FavoriteOrder] key from the registry, edit it with the notepad, sort the contacts to your taste, the import it back to the registry (you can make a CAB to ease the process).

The method still have some drawbacks and difficulties, howether, so please read carefully the following :

1) The [HKEY_CURRENT_USER\Software\HTC\People\FavoriteOrder] will be created only by Zenyee Back FavPeople Up! upon restoring previously saved contacts.

Though it's actually used by the HTC Favorite Contacts tab, it doesn't exist "naturally" !

So you'll have to restore a saved list first, or create the registry keys from scratch. Then you'll be able to export them, sort them to your taste and import them back.

2) There is an another limitation I found this morning. As you might expect, this tool is most useful after flashing a new ROM, when you want to get your favorite contacts back.

The problem is on the method you'll use to get back the full contacts list. maybe it won't be a problem for most people... But I had one.

Yesterday, when I flashed the last Energy ROM, something went wrong with my ActiveSync on my hom PC, and as I was downloading a Dinik version (it takes about 2h1/2 to get one ROM from Hotfile ! :p), I couldn't reboot, so I synchronized my contacts this morning from my office PC...

And then the favortie contacts list I restored from the registry keys was all messed up.

The reason is simple : the index numbers were different from the ones that were saved.

I think the reason is my office Outlook file is actually a bit different from my home Outlook file. They are actually syncrhonized separately (of course ! :p), so their databases grewn separately.

The other time I flashed, I resynced the contacts from home, so the list was saved according to the home contacts index list.

Then last flash, I resynced from the office, and tried to restore a list that was built from the home contacts list...

I actually don't know if the same could also happen if you still resync from the same PC... You'll have to try out. ;)

But as long as you keep your contacts in your HD, you can freely export and import back the favorite list from and to the registry, and it will be fine. :)

Now I think that if you use antother method to save your contacts and restore them after a flash, for example if you use PIM backup or any other tool instead of synchronizing with Outlook, then maybe you won't have this problem at all, I don't know. ;)