Nicholas Tsipanov (nicholas@spbteam.com), October 31, 2001.
This short article explains how you can retrieve Owner Information provided by the owner of Pocket PC from Owner Information dialog with eMbedded Visual C++.
Microsoft provided a GUI feature "User Information" to facilitate storing info about the device owner. This could help in cases like device loss or can be used in registration dialog. If you are creating an application that may get benefit from this info you may want to have a way to retrieve it.
There's no special API on Pocket PC to get the information that the user provided about himself. If the user entered any information into appropriate fields of Owner Information applet then it is stored in two binary registry values under [HKCU\ControlPanel\Owner] key: the "Notes" value contains notes that user wanted to add to information about himself and the "Owner" value contains everything else : name, email, phone, company and address.
To retrieve this information you should query binary value from the registry into a temporary buffer and initialize string values from that buffer.
Note: If the user didn't provide any information about himself then the corresponding registry values do not exist! You have to bear this in mind to avoid access violation issues in your code.
There is a sample code below that initialises some class CString member values with Owner Information items.
You can download a bit more functional example - ownerinfo.zip (2 Kb).
Since there's no special API to get the owner information then the direct access to registry values may be not portable on future versions of Pocket PC. However these values didn't change on Pocket PC 2002 yet. This is not documented by Microsoft so far and you should keep your fingers crossed if you are stuck on this way of retrieving user info.