Making your application sparkle with Windows 7
The launch of Windows 7 is just around the corner. Whether you prefer managed or unmanaged development, you can take advantage of Windows 7 features with new APIs and libraries to make your application shine.
Touch-based interfaces allow users to interact with applications in a more intuitive way. Windows 7 introduces multi-touch input and manipulation processing through Windows Touch.
For native C++ developers, MFC now supports using a touch-enabled interface. MFC will do much of the heavy lifting: it listens for touch-related messages from Windows and calls out to a number of virtual functions to handle them. Developers merely need to register for touch input, set the gesture configuration, and override these virtual methods as required to touch-enable their application.
WPF 4 includes object model additions for touch interfaces so managed code developers can easily add touch support to their applications as well. Multiple finger input will be exposed through existing and new input events, while new manipulation and inertia events will be exposed for developers to consume.
Adding a Ribbon to your application can help organize your commands, tasks, and menus in a friendly way that makes it easier for your customers to find what they’re looking for. Whether your application is written in Win32, MFC, or WPF, new controls and APIs will help you add a Ribbon to your application.
If you write Win32 applications, the Ribbon framework provides a set of APIs for creating a Ribbon for your application. You can find out more about the Windows Ribbon Framework for Win32 here.
Visual Studio 2008 SP1 added support for an Office “look and feel” Ribbon UI to MFC applications. Visual Studio 2010 adds “look and feel” support for the Windows Ribbon, including an MFC Ribbon designer to make creating and editing ribbons much easier. An XML format for persisting Ribbon designs simplifies UI development by removing the need to “design in code”.
The new WPF Ribbon Control will be released out of band around the same time as WPF 4 through the Office UI Licensing site. You can find instructions on downloading the WPF Ribbon (currently in Preview) here. The WPF Ribbon will feature skins for Windows 7 and Office and all the standard Ribbon features that users are familiar with, including tabs and groups, dynamic resizing, quick access toolbar, application menu, contextual tabs, key tips, and more! The Ribbon will remain available as a separate, standalone assembly.
Windows 7 features the Location platform, which makes it easy to write applications that can make use of the user’s location. The Location platform opens the doors to some interesting application scenarios – especially on mobile computers. For example, a location-aware application might use the current location to show the user nearby restaurants or shops, or an instant messaging or email application might tag messages with the sender’s location.
The Location platform provides a way for location devices, such as GPS and WWAN radios, to integrate with Windows and includes an API that applications can use to determine the current location of the computer. Because the Location API exposes its functionality through COM interfaces, C++ programmers and scripting language programmers alike can take advantage of it. The Windows 7 SDK includes samples and documentation to help you build location-aware applications. Find out more about the COM Location API on MSDN.
In addition to the COM Location API, .NET Framework 4 will include built-in managed APIs for location, making it easy for .NET applications to take advantage of Windows 7’s location capabilities.
Windows 7’s Shell enhancements empower application authors to provide a richer integrated user experience. Jump Lists provide access to contextual startup tasks and files available to the applications. For instance, right-clicking on the Outlook icon will show the mail messages you’ve recently opened in the Jump List:
The new taskbar is less cluttered and can convey more information at a glance. The taskbar allow you to pin any program to the taskbar or rearrange the icons on the taskbar by clicking and dragging. Aero thumbnails, which appear when you hover over an icon in the taskbar, support view customization and user commands. Below is an Aero thumbnail that supports commands for controlling media playback.
MFC adds support for new Windows 7 shell features. By default, files opened by an MFC application through the “File Open” dialog will be added to your recent files Jump List. If you wish to override the default behavior, MFC also provides APIs that allow you to customize the contents of your application’s Jump List. MFC has also added support for High DPI and many of the new Windows dialog features. Below, the Open File dialog has been customized with additional controls:
Adding MFC support for Search, Preview and Thumbnails was an obvious choice. Now you can search your MFC documents in Explorer’s search field and see Icons and Previews just like Office applications.
If your application’s installer needs to access or update files that may be locked or in use, Restart Manager can handle application shutdown and restart, or eliminate or reduce the number of system restarts required for an install. With just a few lines of code, you get full Restart Manager support with automatic timed backup of currently opened documents. MFC has added support for the Transactional File System in ATL as well.
These new MFC features will be available in Visual Studio 2010. To take advantage of some of these features (such as Jump Lists), you will only need to recompile to get the updated user experience, while for others (such as Windows Touch or Restart Manager support) you will need to add a few lines of new code to incorporate new functionality.
WPF 4 allows you to use Windows 7’s new Shell features in your WPF applications as well. WPF 4 integrates Windows 7 Jump List functionality, including Tasks, Items, Recent and Frequent Lists, and Custom Categories. Windows 7 taskbar integration in WPF 4 includes progress bars, overlay icons, thumbnail buttons with command support, description text, and Desktop Window Manager (DWM) thumbnail clipping.