Test Your Application with Fast User Switching [Application Compatibility Guide]
| Platform SDK: Application Compatibility Guide |
Test Your Application with Fast User Switching
In Windows XP, you do not have to log off to allow another user to log on. It is possible for multiple users to log on and switch quickly between open accounts. Switching to another account does not change the state of applications currently running. When a user switches back to their account, their applications will still be running and their network connections will have been preserved. For more information, see Fast User Switching.
Fast user switching uses Terminal Services technology and is therefore compatible with most earlier Microsoft Win32® applications. If an application is Windows 2000 Logo compliant, it implements basic profile separation and power management features, the application should run properly under individual Windows XP user accounts. However, it is important to test your application under fast user switching to ensure that it behaves as users would expect.
Use the following guidelines when writing your applications so that they work well with Fast User Switching:
Implement true profile separation.
The system provides an underlying infrastructure that supports separation of user data, user settings, and computer settings. The best way to implement this is by using Windows Installer to manage the installation and setup of your application. For example, the installer sets the AppDataFolder property to the full path to the Application Data folder for the current user and sets the LocalAppDataFolder property to the full path to the directory for data that should not be available to the user on other computers, such as temporary files. You can also use the SHGetSpecialFolderLocation or SHGetSpecialFolderPath function with CSIDL_APPDATA or CSIDL_LOCAL_APPDATA to locate these folders.
Register for notification of a user switch.
Typically, an application does not need to be notified when the switch occurs. However, if your application must be notified of a session change, it can be registered to receive a WM_WTSSESSION_CHANGE message. This message is sent only to applications that have registered to receive this message by calling WTSRegisterSessionNotification.
Be aware of other instances of your application that may be running.
If your application attempts to download an update of itself from the Internet, the update may conflict with another user running your application in a different session. The update can fail or disrupt other running instances of the application. Your application should be designed to signal all running instances of the application to save data and exit before starting a dynamic update.
| Last updated: April 2004 | What did you think of this topic? | Order a Platform SDK CD |
| © 2004 Microsoft Corporation. All rights reserved. Terms of use. |