Pages

Wednesday, March 5, 2008

Programming Issues

Both fast user switching and remote desktop use Windows XP's updated terminal services technology. Improvements have been made to both the server and client components of terminal services. Windows XP now features support for both local and remote sound, 24-bit video, performance optimizations, and the mapping of the local drives and printers.
Fortunately, most applications don't have to be rewritten to work with terminal services and, thus, fast user switching and remote desktop. Rather, they need to respect basic user settings management guidelines. These guidelines are not new: Most are covered in the Windows 2000 Certified for Windows Application Specification, which has been available on Microsoft's Web site for some time. The Data and Settings Management section of this specification includes several topics that are particularly important when supporting multiple users on a single machine:

· Default to the My Documents folder for storage of user-created data;
· Classify and store application data correctly;
· Degrade gracefully on "Access denied" messages.
Mostly, this means isolating data and settings for each user. And an important step in this direction is to ensure that you are using the HKEY_CURRENT_USER registry key rather than HKEY_LOCAL_MACHINE for storing settings in the system registry. You should also be careful to install programs correctly and to classify and store data correctly. You can use the ShGetFolderPath API to obtain the path of a specific named folder-such as "My Documents" or even "Program Files"-as well as the appropriate directories for storing Roaming, Non-Roaming, and Shared application data. The following are some general guidelines for locating data:
· Profiles\username\Application Data\appname
- Roaming, auto-created user files (e-mail DB, custom dictionaries…)
· Profiles\username\Application Data\Local Settings\appname
- Discardable/local-only user data files (e.g., offline stores)
· Profiles\All Users\Application Data\appname
- Last-resort for local-only, common dynamic data (e.g., log files)

A notable exception to the isolation rule is that you should support "All Users" installations: It is extremely frustrating for users to install the same application repeatedly for multiple user accounts.
By carefully locating user data, user settings, and computer settings, applications can make it easier for users to backup individual documents and settings, share a computer among multiple users, and even to work with the same documents and settings on multiple computers. By handling data and settings properly, you can enable your application to run in both the home (fast user switching) and business enterprise (remote desktop) marketplaces.

No comments:

Post a Comment