![]() |
|
Working with registry on Pocket PC
By Vassili Philippov, January 21, 2002.
SummaryWorking with registry on Pocket PC is very similar to working with it in desktop Windows. Nevertheless, there are some differences. Registry is not stored in a file on Pocket PC. There are some undocumented possibilities to change settings of built-in applications that are Pocket PC specific. Third-party libraries and controls will also simplify working with registry in your eVC++ and eVB programs. eMbedded Visual C++Let us consider one of the most frequently used registry operations - reading string values - using different libraries. We will read 2 values - "name" and "surname" from HKEY_CURRENT_USER\Software\pocketpcdn\RegistrySample. Win APIUsing Win API functions to work with registry, you should check that you close registry keys in all paths. To read a string value you should call RegQueryValueEx twice: once to get size and only then to read the value. ATLATL wraps Win API and takes care about closing registry keys (it is done automatically in destructor). Similarly to Win API you should read value in two calls. VORegistryThe latest version of VORegistry library supports all features and is very easy in use. First of all I want to give you a small example of the same operation (reading two strings from registry) using different methods (Win API, ATL, VORegistry): As you see VORegistry provides the simplest way of using registry in eVC++. It contains methods for working with all types of values (string, DWORD and binary), creating/deleting and enumerating subkeys, deleting values and keys. eMbedded Visual BasicIt is more difficult to read/write registry if you use eMbedded Visual Basic. You can use Win API functions. Use API Text Viewer tool from eMbedded Visual Tools to get declare of necessary Win API function. Here are declares of some registry related functions: Or you can use third-party controls like: that simplify using registry.
Read more about using registry in eMbedded Visual Basic in deVBuzz articles: Interesting places in registryMost programs keep settings in registry and you can customize many applications by changing the corresponding value. There are a lot of undocumented features that you can use. For example you can change:
Remote Registry EditoreMbedded Visual Tools include Remote Registry Editor that is useful for exploring registry of connected Windows CE devices or of the emulator. It works very similar to desktop Registry Editor. If you want to check what is changed in registry you can export registry before the operation and after. Then use WinDiff to find difference. Exporting the whole registry can take about an hour if you use slow COM connection. Pocket PC registry editorsThere is no Microsoft Pocket PC registry editor that works on Pocket PC but you can use one of many third-party registry editors. Here are some of them: Related resources:
DiscussDiscuss this article. Here you can write your comments and read comments of other developers. |
|||||||||||||||||||||