“Why should I upgrade to Windows Vista™?” is the single most-asked question I get at work these days.

Curiosity is driving a lot of folks towards this latest and greatest operating system from Microsoft. What’s new? What does it do? What’s in it for me? Everyone wants to know what’s so special about it and if it is worth it. “How much time do you have right now?” is usually my first reply, closely followed by, “Do you have a laptop?”

Of course many professionals and knowledge workers do have a laptop, and that often includes application developers too. Windows Vista offers tons of new features and enhancements, from the new spiffy hardware-accelerated user interface with Aero to all the built-in .NET Framework 3.0 technologies (WPF, WCF and WF), Microsoft® Windows® SuperFetch™ to Windows ReadyBoost™, Microsoft packed a lot of power under the hood (see sidebar, Windows Vista: Beyond Mobility). But throw Windows Vista on a mobile PC and get ready for some serious improvements for the mobile professional. The term mobile PC describes all portable computers such as Ultra-Mobile PC, notebook, laptop and Tablet PC running the full Microsoft Windows operating system.

Windows Sync Center allows you to manage the synchronization of all your data and files between various computers, devices, external storage, and network servers.

Following the release of Microsoft Windows XP Professional in 2001, which also saw the launch of the new Tablet PCs, Microsoft went back to work to bring mobile PCs to the next level. Today, Windows Vista pushes the envelope on mobility over its predecessor and it shows. Where Windows XP introduced us to the Tablet PC features of using pen computing and electromagnetic digitizers; Windows Vista extends the Tablet PC experience with support for touch. Where Windows XP featured a standard recognizer that could decipher your handwriting and convert it into text fairly accurately, Windows Vista can learn the quirks of your penmanship (or lack thereof) using a personalized recognizer and automatic learning.

You do not have to explore very far to notice all the mobility features integrated in Windows Vista. Simply pop open the mobile PC options in the Windows Vista Control Panel, and you’ll discover a plethora of goodies enough to make your notebook smile, be it a brand new machine or your newly upgraded trusty companion. In this article, I’ll explore Windows Vista and its new mobile PC-related features, be they from the end-user point of view, or from the developer angle looking to exploit the power of Windows Vista for mobile applications.

First Look: Popping the Hood Open…

Windows Vista Control Panel sports many options, all organized by category. You will find old classics in there like the ability to adjust display settings and uninstalling programs, but you will also notice new options, like a dedicated security section and a whole new section just for mobile PC settings. Figure 1 illustrates the various sub-sections related to mobile PC settings, which include the following:

Figure 1: The new Mobile PC section in Windows Vista Control Panel provides everything you need to manage your laptop or Tablet PC, from power settings and connecting to a projector, to customizing the tablet pen and connecting to Windows Mobile devices.
  • Windows Mobility Center
  • Power Options
  • Personalization
  • Tablet PC Settings
  • Pen and Input Devices
  • Windows Sync Center
  • Windows Mobile Device Center

I cover most of these features over the next few pages, and for many of them, you get the chance to dig deeper into these mobility topics by reading the subsequent articles included in this special CoDe Focus issue.

Getting Started with Windows Mobility Center

Windows Mobility Center presents you with many useful options related to the day-to-day use of a mobile PC (Figure 2). Each pane in this window provides you with a quick setting you can adjust with a single click, including trivial but essential features like adjusting your screen brightness level or adjusting or muting the volume control. You can click an icon like a button in each pane, allowing you to customize your settings to your liking. You will also find interesting settings that were normally only accessible by jumping through Windows XP hoops, or entirely new features, including the following:

Figure 2: The new Windows Mobility Center, accessible via the Mobile PC section of Windows Vista Control Panel, provides quick adjustments to various mobility features. Clicking on each pane’s respective icon opens a settings window where you can customize how each of these features operates.
  • Adjust your immediate Display brightness, or click the icon to change your Display, Sleep (discussed below), and Brightness settings whether you’re running on battery or AC power.
  • Adjust the Volume, mute the sound, or use the icon to access your sound device properties.
  • Change your power scheme, also known as your Battery Status, to the standard settings like Balanced, Power saver or High performance. The icon allows you to configure each of those power plans.
  • Turn your Wireless Networking (i.e., Wi-Fi) access on or off. The icon pops open the Connect to a network dialog box that shows available Wi-Fi access points.
  • Provided that your mobile PC has the tablet feature (as a slate or convertible laptop), a Screen Orientation option is available to easily rotate the screen between portrait and landscape modes. Unfortunately Windows Vista still does not remember separate desktop icon position sets for portrait and landscape modes. The Panel icon provides access to the Tablet PC Settings dialog box.
  • If you’re like me, you connect your laptop to a lot of external monitors and projectors. Windows Mobility Center features a button to easily connect to an External Display, or use the icon to access the Display Settings.
  • The new Windows Sync Center, accessible here, allows you to manage the synchronization of all your data and files between various computers, devices, external storage, and network servers. I will cover this setting in greater detail below.
  • You also have access to a one-click Presentation Settings toggle that lets you enter Presentation mode where you can enable or disable notifications and screen saver, adjust your volume, or temporarily change your Windows Desktop background image. Use the associated icon to configure these settings.
Your applications should know about the current power status in order to adapt their behavior depending on the power mode.

Use Windows Vista Mobility Center to get access to the most often used mobile PC functions. Finally, users won’t suffer from any fumbling around to locate the proper mobility option when they’re on the go.

Power Management

Have you ever experienced the “hot-laptop-in-the-bag” syndrome? I’m sure you did at least once. Let me refresh your memory. You prepare to leave work, heading to the airport on a business trip. You put your laptop on Standby, drop it in your bag, and off you go. Later, as you sit not-so-comfortably in your middle seat between the Queen of Chatter and the King of Snooze, you take comfort in knowing that you’ll have your laptop along for the ride to get a little work done, catch-up on e-mail, listen to some music, or even watch a movie during your cross-continental trek. You reach for your laptop in your bag and… the horror! Your laptop is burning hot, and it’s still on!!! Fearing the worst, you open the lid and the power indicator taunts you with… 12% battery left. You’re doomed. You’re now stuck watching a really mindless movie using rented headphones and reading the airline magazine for six hours. And you can swear you can detect a grin on Mr. McSleepy’s face next to you.

Most people had no idea you simply could not train Windows XP to enhance ink-to-text recognition results. Windows Vista can learn and it does so in a very smart way.

Windows XP provided you with several options when it came to suspending your work on a laptop. Closing the lid would typically put the machine in Standby mode, where most of the hardware is turned off and your work session is preserved in memory, consuming just enough power to keep it alive for days. As your battery would drain very slowly in Standby mode, after a while, Windows XP should briefly wake up to transition to Hibernate mode, whereby it transfers the contents of your system memory to a special Hibernate file on disk and then turns your machine off entirely. Unfortunately the Hibernate mode was not always reliable, as it required a minimum amount of system resources to complete the API call. If you had too many things loaded at once in your Windows session, a symptom that occurs more often if you have a lot of RAM in your system (usually 1.5 GB or more), the Hibernate call would fail, and Windows XP would remain powered on without trying to go back to Standby mode again. If you leave the laptop running in a tight bag with no ventilation long enough, you’ll end up with a burning hot paper weight.

Windows Vista solves this issue with a new power state called Sleep. This new sleep mode combines the best of both worlds: fast resumes like the old Standby mode and battery-efficient disk persistence like Hibernate. Sleep handles both and does not need to switch between modes as it can transition your session state from memory to disk, thus avoiding the need to “wake-up” from Standby before hibernating.

Baking Power Awareness in your Mobile PC Applications

While users can monitor the battery level on their mobile PC and manage their power management settings on their own, a good smart client application should be made power-aware. That is, your applications should know about the current power status in order to adapt their behavior depending on the power mode. If the user switches to a power saver mode to maximize their laptop battery, your application should behave properly and refrain from initiating resource-intensive operations, deferring them to a later time when the mobile PC is running on AC power or is running in high performance mode. How can your application detect this power state change? If the mobile PC is put to sleep, how should your application react?

Neil Roodyn wrote about power management on Microsoft Windows XP Tablet PC Edition in the previous issue of CoDe Focus on Tablet PC & Mobile PC development (see Power to the People, http://www.code-magazine.com, Quick ID 0512102). For a Windows Vista application, you can use new features of the Power Management SDK, which is a native code API. Basic power notifications are also available in the .NET Framework via managed code. Unfortunately, any more on this topic is beyond the scope of this article. For more information, see “Power Management” in the Windows SDK.

Tablet and Ink Support

The top feature I had desperately been waiting to use on my Tablet PC is the enhanced ink support in Windows Vista. Don’t get me wrong: Windows XP’s handwriting recognition and ink handling were pure genius. It was so good that most people assumed I had been training it to the specifics of my lousy handwriting beforehand. It turns out most people had no idea you simply could not train Windows XP to enhance ink-to-text recognition results. On the other hand, Windows Vista can learn, and it does so in a very smart way.

Figure 3 shows that Tablet PC Input Panel in Windows Vista has not changed much visually compared to the Windows XP Tablet PC Edition version, but Microsoft has dramatically improved the ink recognition engine. For starters, Windows Vista does a good job recognizing things you cannot necessarily lookup in a dictionary, such as e-mail addresses and URLs. Windows Vista also allows you to use pen gestures, or “flicks” to perform simple commands and actions.

Figure 3: Tablet PC Input Panel in Windows Vista will look very familiar to Windows XP Tablet PC Edition users. However, Windows Vista has the ability to learn your handwriting as you correct what is being recognized. The more you use it, the more it learns.

“You should have been a doctor…”

If you have ever been told that your handwriting is so illegible that you would have made a fine doctor, I’m sure you may have your doubts when it comes to handwriting recognition using ink-to-text on a Tablet PC. Since Windows XP could not “learn” your handwriting or be trained to recognize it, the recognizer would often make the same mistakes. Adding a new word to the built-in dictionary would often yield better recognition results, but when a quirk of your handwriting makes it easy to confuse one word for another, Windows XP often seemed to get it wrong.

For example, when signing e-mails with my “ActiveNick” nickname, Windows XP would usually confuse my “v” for an “r” and always suggest “ActireNick”. By clicking that word in the Tablet PC Input Panel, I could look up the other probable results, and sure enough, “ActiveNick” would be the second or third choice. With Windows Vista, I first had the same problem, but by choosing the properly recognized word in the probability table, the personalized recognizer actually “learns” that my lowercase v’s look more like lowercase r’s, but it’s still a “v”. I correct Windows Vista once, and now I don’t worry about it anymore. In a nutshell, the more you use ink recognition in Windows Vista, the more it learns and the more accurate it gets at recognizing your handwriting. This personalized recognizer tracks handwriting data separately for each user on the mobile PC, and you can turn it off if you so desire.

Touched for the Very First Time

I always found it funny when people would try my Tablet PC for the first time. Maybe it’s because I use an LE1600 slate tablet from Motion Computing that has no keyboard, but people would always try to avoid touching the screen when writing with the stylus. Of course, this cannot feel natural; we always rest the side of our hand when writing with pen and paper, and that’s why Tablet PCs relied on electromagnetic digitizers for pen computing on Windows XP. These digitizers use electromagnetic signals emitted around the screen to detect a passive sensor (i.e., no battery required) in the stylus and extrapolate the stylus position to drive the mouse cursor on screen. The underlying principle is, in fact, not entirely dissimilar to how Global Positioning Systems (GPS) work when triangulating positions on Earth using satellite signals. This technique makes it possible to track the stylus tip when simply hovering above the screen without touching it.

But a lot of people would try to push buttons with their fingers. It’s only natural; you do it all the time when you withdraw money at most ATMs, use the self-service pumps at the gas station, or use the self-check-in terminals at the airport. Windows Vista adds support for tactile input using touch screens. With touch input, a user can still use a stylus but only as a tactile device, just like on a Windows Mobile Pocket PC. Touch digitizers add flexibility for the user, but are less precise than electromagnetic digitizers. This means your handwriting will look less natural and more “broken” with jagged edges, sort of like digital delivery pads or credit card terminals that rely on digital signatures. And because touch input does not involve electromagnetic tracking, Windows cannot detect the “hover” of your stylus over the screen. Note that Windows Vista also allows for devices with a hybrid touch/electromagnetic digitizer. Such devices would typically disable the touch mode when the hardware detects the stylus in range, leaving the touch support for finger input only.

The Ink Developer Story

CoDe Magazine has already had a few articles about adding ink support to a .NET Framework application, starting with the article at Quick ID 0512032. The new 1.7.5 release of the Tablet PC Platform SDK extends the base functionality with a new InkAnalysis API, which is supported by the new version of the pen input subsystem in Windows Vista. Markus Egger introduced ink analysis in a previous CoDe Focus article (Quick ID 0512042).

You can also use ink with Windows Presentation Foundation (WPF), as discussed in this issue in, “Basics of Ink in Windows Presentation Foundation,” by Billy Hollis. Microsoft designed WPF to support ink input, treating the stylus as the mouse pointer or as true pen input.

To learn more about adapting your mobile PC applications using a touch interface, make sure to read Hilton Locke’s article, “Introduction to Windows Touch Technology in Windows Vista,” in this issue of CoDe Focus.

In a nutshell, the more you use ink recognition in Windows Vista, the more it learns and the more accurate it gets at recognizing your handwriting.

All these new additions for developers, combined with the enhanced learning and personalization features for ink in Windows Vista, greatly improve on your application’s abilities to process handwriting as a viable alternative to keyboard input in enterprise scenarios running on mobile PCs.

Building Network-Aware Applications

Talking about mobility, I use the term “smart client” a lot, which usually prompts the question “What’s the difference between a rich client and a smart client?” Power management-as described above-is part of that answer. But the first and foremost attribute of a smart client is its ability to work both in online and offline modes, completely transparently from user interaction. If a user wants to save their data, the last thing they want to hear is that no connection to the server is available. It’s up to you as a mobility developer to teach your applications to think and to be aware of their environment.

Windows Vista adds support for tactile input using touch.

Neil Roodyn discussed network awareness in the article, Know your Networks (Quick ID 0512092), in the previous issue of CoDe Focus. Now thanks to the new Network Awareness API, Windows Vista applications can be informed of changes in network configuration. With this API, your application can now find answers to many network-related questions, such as:

  • Am I connected to a network?
  • What type of network is it and what are its attributes?
  • How fast is this network?
  • Is this an intranet network and do I have Internet access?
  • Can I trust this network?
  • What should I do when I lose connection to the network? What about when I get reconnected?
  • Are there other alternative networks I can use based on predefined criteria?
  • A new network was just added. Should I use it? Does it match my needs?

Whereas Windows XP only exposed the Network Location Awareness (NLA) service via the Windows Sockets 2 API, the new Network Awareness API in Windows Vista is a native Win32 API that relies on COM. Developers will find a subset of the Network Awareness API in the form of managed classes for managed development. See the NetworkInterface class in the System.Net.NetworkInformation namespace for more information. You can also use the NetworkChange class in the same namespace to receive notification of network changes in your application.

The specifics of the NLA service and this API are beyond the scope of this article. You can read more about NLA and the Network Awareness API by looking up “Network Location Awareness” in the Windows SDK.

Managing Files with Sync Center

When Bill Gates founded Microsoft in 1975, his vision was to bring “a computer on every desk and in every home.” Nowadays, average folks, and especially information workers, have a multitude of computers and devices, including computers at work, at home, at the ski cottage, laptops, Tablet PCs, Pocket PCs, Smartphones, Ultra-Mobile PCs, and more. Übergeeks and power users often have all of these. And while we live in a world of information at our fingertips, that information lives all over the place. These various computers have created islands of data that are very hard to manage and keep in sync, often resulting in having multiple copies and/or versions of the same documents all over the place. Finding the latest version has become a nightmare.

The first and foremost attribute of a smart client is its ability to work both in online and offline modes.

Enter Windows Sync Center, a new centralized console in Windows Vista where you can manage your files and synchronize them across multiple PCs, network servers, and mobile devices. Windows Sync Center allows you to manage the synchronization of files residing on your Windows Vista machine and on other sources, including:

  • Other computers, using a PC-to-PC sync
  • Network files from other computers or servers you need access to when offline
  • Removable storage like USB keys and flash memory cards (e.g., Compact Flash, SD, Memory Stick, etc.)
  • Mobile devices

You’ll need to set up a sync partnership before you can synchronize files between sources. Figure 4 shows how Windows Sync Center facilitates the management of such partnerships. From this interface, you can initiate syncs, monitor syncs in progress, cancel syncs, and review potential issues that might occur during synchronization.

Figure 4: Windows Sync Center provides a central interface to manage sync partnerships with other devices, computers, external storage devices, and mobile devices. It can even manage and monitor SQL Server synchronization jobs.

From a developer’s point of view, you can use Windows Sync Center since it can manage the synchronization of data with Microsoft SQL Server™ databases. This means that SQL Server 2000 or 2005 exposes a sync handler interface that Windows Sync Center can monitor and manage. You can also interact with Windows Sync Center programmatically. Windows Vista provides APIs to create your own sync handlers that leverage the services of Windows Sync Center to synchronize files and data from your own applications. This even allows you to define your own property sheets to extend the Windows Vista user interface where users would configure sync-specific settings associated with your sync handler. Your code can also use the Windows Sync Center API to generate results and provide feedback on synchronization by posting to the Conflict Store and the Event Store to make sure your application can inform the user on the sync status via the standard Windows Sync Center user interface. However, creating sync handlers for sync center goes beyond the scope of this article. You can refer to the Windows Vista Developer Center at http://msdn.microsoft.com/windowsvista for more information on specific APIs for Windows Vista.

Windows Mobile Device Center

The new Microsoft Windows Mobile® Device Center (WMDC) sits on top of the Windows Vista Sync Center to manage partnerships, connectivity, and synchronization with Windows Mobile 2003 and Windows Mobile 5.0 devices. You can download WMDC at http://www.microsoft.com/windowsmobile/devicecenter.mspx

In essence, WMDC replaces Microsoft ActiveSync® as a core Windows component managed by Windows Sync Center. Once you have installed WMDC, connect your Windows Mobile device. WMDC greets you with a Welcome screen as shown in Figure 5 and offers you a choice between setting up a device on your computer, which creates a new partnership with this device, or simply connects the device with no setup, similarly to ActiveSync’s “guest” mode.

Figure 5: Windows Mobile Device Center in Windows Vista replaces ActiveSync for the management of partnerships and connectivity with Windows Mobile devices. You can use it to set up a partnership with a new device or simply connect to a device in “guest” mode.

If you choose to set up a partnership, WMDC will ask you to pick the item types to synchronize as part of this partnership (Figure 6). Your options include contacts, calendar items, e-mail messages, tasks, notes, mobile favorites, files, and Microsoft OneNote® items. Note that for contacts, calendar, e-mail and tasks, you can elect to sync directly over the air with Microsoft Exchange Server and Direct Push, but you cannot sync any of these with both the desktop and the server. If a server option is available in your company, you should use it as your desktop should be in sync with your Microsoft Exchange Server as well.

Figure 6: Windows Mobile Device Center allows you to keep many item types in sync between your computer and your device, including contacts, calendar items, e-mail messages, tasks, notes, mobile favorites, files, and OneNote items. Note that for contacts, calendar, e-mail and tasks, you can elect to sync directly over the air with Microsoft Exchange Server and Direct Push.

Once you’ve set up the partnership, WMDC will ask you to give it a name, and it will then proceed to sync your new device with your Windows Vista machine using Windows Sync Center (Figure 7). If an error or conflict occurs, or if you want to review the synchronization results, open Windows Sync Center and click on the View sync conflicts and View sync results tasks in the left pane to review error, warnings, and other sync information. Also note how your WMDC partnership is now visible when you click on the View sync partnerships task. You can create multiple partnerships to all your different devices from the same Windows Vista machine.

Figure 7: Windows Mobile Device Center maintains your data items in sync between your Windows Vista machine and your Windows Mobile device. Sync Center itself handles the synchronization tasks.

With the partnership set up, WMDC and Windows Sync Center kick into action every time you connect your device to your Windows Vista machine, or whenever a data change occurs on either side of the sync partnership. The WMDC window (Figure 8) is accessible via Mobile PC Control Panel, and provides many options:

Figure 8: Windows Mobile Device Center can also install and remove programs on your Windows Mobile device, add and import media files to and from your device, browse the contents of your device’s storage, including storage cards, and adjust the partnership and connection settings.
  • Get updates for your device.
  • Add and remove programs on your device.
  • Add media files to your device, or import media files from your device to your Windows Vista machine.
  • Browse the contents of your device’s storage space, including storage cards. Note that device storage is also accessible from Windows Explorer as a regular Windows drive.
  • Change the content sync settings.
  • Manage the partnership, such as how to handle conflicts.
  • Adjust the connectivity settings. WMDC can connect with devices via USB, infrared, and Bluetooth.

Where to Go from Here

In essence, Windows Mobile Device Center replaces ActiveSync as a core Windows component managed by Windows Sync Center.

I have only scratched the surface of the features that Windows Vista supports for mobile PCs. The true power of Windows Vista lies not in its new Control Panel options, its new looks, or new settings; the true power of Windows Vista rests in your hands as a developer of applications using the .NET Framework. As you discover the new APIs, SDKs, and services available to your applications, you will realize how-just like its other Microsoft Windows predecessors-Windows Vista is first and foremost a premier development platform, and its best features have not been written yet. It’s up to you now. Keep reading through the pages of this special CoDe Focus issue, learn about Windows Vista programming for the mobile PC, and you’ll finally have the answer for you and for your users: “Yes, Windows Vista is definitely worth it!”