Description This clinic and Hands On Lab introduces Windows developers to information on the Microsoft Windows Vista™ platform, thereby maintaining and enhancing their productivity and
Trang 112 Clinic Introduction
About This Clinic
This section provides you with a brief description of the clinic, objectives, and target
audience
Description
This clinic and Hands On Lab introduces Windows developers to information on the
Microsoft Windows Vista™ platform, thereby maintaining and enhancing their
productivity and driving them to further study and adoption of Windows Vista as their
preferred application development platform
Objectives
After completing this clinic, you will be able to:
• Describe the Windows Vista user interface and how the new user interface will affect
developers
• Describe the characteristics of Windows Vista applications
• Describe how to test application compatibility and migrate applications to Windows
Vista
• Describe what User Account Control is and how to develop applications that are User
Account Control compatible
• Describe the Microsoft NET Framework 3.0 features
• Describe how to manage digital identities with CardSpace
Trang 2Clinic Introduction 13
• Create simple applications that use Windows Communication Foundation
• Create simple applications that use Windows Workflow Foundation
• Describe the Windows Presentation Foundation features
• Create applications that use Windows Sidebar and Gadgets
• Describe the new Windows Vista APIs
• Create a RSS reader application
• Create a Windows Search application
Audience
The target audience for this clinic includes the following:
• Developers with some experience writing applications for the Windows platform
• Developers who are familiar with NET development (recommended but not
required)
Trang 314 Clinic Introduction
Prerequisites
This clinic requires you to meet the following prerequisites:
• Some experience writing applications for the Windows platform
• Familiarity with NET development is beneficial
Trang 4Clinic Introduction 15
Clinic Outline
Session 1, “Introduction to Windows Vista Application Development,” provides
an overview of the major goals and benefits related to developing applications for
Windows Vista The session focuses on the new features available in Windows Vista and
an overview of the application compatibility issues for deploying existing applications
that might not be Windows Vista compatible in a corporate environment
Session 2, “Introduction to Microsoft NET Framework 3.0 Technologies,” describes
the Microsoft NET Framework 3.0 programming model The Microsoft® NET
Framework 3.0 is the new managed code programming model for the Microsoft
Windows® operating system .NET Framework 3.0 builds on the foundation of NET
Framework 2.0 and adds new technologies such as Windows Communication Foundation,
Windows Workflow Foundation, and CardSpace
Session 3, “Introducing Windows Presentation Foundation,” describes how Windows
Presentation Foundation provides the foundation for building applications and
high-fidelity experiences in Windows Vista, blending together application user interface,
documents, and media content
Trang 5Hands-On Lab, “Microsoft Windows Vista for Developers,” gives you an opportunity to work with the new programming features in Windows Vista In this hands-on lab, you will explore many of the Windows Vista features for developers that are discussed in the previous four sessions
Trang 6Session 1: Introduction to
Windows Vista Application Development
Table of Contents
Developing a Windows Vista Application 9 Developing Gadgets for the Windows Sidebar 15 Application Interoperability and Migration 29 Improving Security with User Account Control 39
Trang 7Information in this document, including URL and other Internet Web site references, is subject to change without notice Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred Complying with all applicable copyright laws is the responsibility of the user Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation
The names of manufacturers, products, or URLs are provided for informational purposes only and Microsoft makes no representations and warranties, either expressed, implied, or statutory, regarding these
manufacturers or the use of the products with any Microsoft technologies The inclusion of a manufacturer or product does not imply endorsement of Microsoft of the manufacturer or product Links are provided to third party sites Such sites are not under the control of Microsoft and Microsoft is not responsible for the contents of any linked site or any link contained in a linked site, or any changes or updates to such sites Microsoft is not responsible for webcasting or any other form of transmission received from any linked site Microsoft is providing these links to you only as a convenience, and the inclusion of any link does not imply endorsement of Microsoft of the site or the products contained therein
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks,
copyrights, or other intellectual property
© 2006 Microsoft Corporation All rights reserved
Microsoft, Microsoft Press, Aero, BizTalk, ClearType, Expression, IntelliSense, Internet Explorer, MSDN, MSN, Segoe, Tahoma, Visual Basic, Visual C#, Visual Studio, Visual Web Developer, Windows, Windows Media, Windows Server, Windows Vista, and WinFX are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries
The names of actual companies and products mentioned herein may be the trademarks of their respective owners
Trang 8Session 1: Introduction to Windows Vista Application Development 1
Session Overview
Introduction
The session provides an overview of the major goals and benefits related to developing
applications for Microsoft® Windows Vista™ and of the application compatibility issues
for deploying existing applications that may not be Windows Vista–compatible in a
corporate environment It also focuses on the new features available in Windows Vista
Objectives
After completing this session, you will be able to:
• Describe the Windows Vista user interface and explain how the new user interface
will affect developers
• Describe the characteristics of Windows Vista applications
• Describe how to develop gadgets for the Windows Vista Sidebar
• Describe how to test application compatibility and migrate applications to
Windows Vista
• Describe what User Account Control is and how to develop applications that are User
Account Control–compatible
Trang 92 Session 1: Introduction to Windows Vista Application Development
Introduction to Windows Vista
Introduction
Windows Vista includes several new user interface elements and features that improve the user experience These new features provide new opportunities for developers when creating applications for Windows Vista This section introduces some of these new features
Objectives
After completing this section, you will be able to:
• Describe what is new for developers in Windows Vista
• Describe the user experience for Windows Vista
Trang 10Session 1: Introduction to Windows Vista Application Development 3
What Is New in Windows Vista for Developers?
Fundamentals
Windows Vista includes improvements to the fundamentals that form the basis for
application development New features enable developers to:
• Build secure applications Windows Vista provides:
• User Account Protection, which enables users to change common settings
without requiring administrative privileges Standard users are prevented from making potentially dangerous changes to their computers; they can run most applications
• Code Access Security (CAS), which minimizes the attack surface of an
application by enabling only the minimum privileges needed for applications to function correctly
• Windows Service Hardening, which restricts critical Windows services from
making unauthorized changes in the file system, registry, network, or other resources
• Microsoft Internet Explorer® 7, which includes a protected mode that helps
protect user data and configuration settings
Trang 114 Session 1: Introduction to Windows Vista Application Development
• Develop reliable applications Windows Vista provides:
• An extensive set of new APIs for developers to make applications reliable for end users and to diagnose application issues
• Enhanced developer portal services, which enable analysis of application
behavior in real-world customer deployments
• Write robust application installers Windows Vista provides:
• New tools to help create installers that put application files in place seamlessly and create a consistent uninstall experience
• Improvements to ClickOnce to enable rapid application setup with minimal overhead ClickOnce is an application deployment technology that makes deploying a Windows Forms-based application as easy as deploying a Web application
Presentation
One of the new features in Windows Vista applications is the appearance of an
application The new Windows Presentation Foundation (formerly code-named Avalon) and the new Aero shell offer opportunities for developers and designers to collaborate on
innovative new application experiences The new features include Windows Sidebar and gadgets
Communications
The Windows Communication Foundation provides industry-leading Web services support, new peer-to-peer features, Really Simple Syndication (RSS) capabilities, and core networking enhancements Windows Vista has a host of communication features for building today’s connected applications New features enable developers to:
• Build connected applications Windows Communication Foundation APIs make it simple to consume and expose a new generation of Web services New peer-to-peer functionality lets you discover and interact with other nearby devices
• Build mobile applications Windows Vista provides new capabilities for detecting network and power state, and it automatically synchronizes application data when necessary
Trang 12Session 1: Introduction to Windows Vista Application Development 5
Data
Windows Vista includes capabilities to make data searching faster (IFilter), a transacted
file system built on NTFS, integrated support for RSS, and a common XML Paper
Specification (XPS) document format New features enable developers to:
• Perform new ways to search and organize information Windows Vista provides:
• New ways to search and organize files and data, using application metadata and
search in addition to traditional file name and folder hierarchies Developers can extend the system to ensure that documents and data created by their software seamlessly integrate into the default search-and-organize experience
• New controls, such as the Instant Search box and Enhanced Column Headers
• Integrate data Windows Vista provides:
• New features that make it easier for applications to find and share the data users
want to see
• A new XML-based file format—the same one used as the default in Office 12—
makes it possible to manipulate data in any document
• Really Simple Syndication (RSS) APIs and a shared RSS store will allow
developers to easily RSS-enable Windows Vista applications and provide central access to feeds, lists, and attachments for users
Productivity and tools
Microsoft has shipped a set of its industry-leading tools to enable developers to easily
utilize these new features of the operating system
Trang 136 Session 1: Introduction to Windows Vista Application Development
The Windows Vista User Experience
What is the Windows Vista User Experience?
The Windows Vista User Experience specifies guidelines that govern the look and feel of
the operating system and applications that run on the operating system These guidelines
express how the user interacts with the system and the feelings it should evoke
Aero Aesthetics
Aero is the name for the new user experience in Windows Vista, representing both the
values embodied in the aesthetics and the vision behind the user interface Aero is an
acronym for Authentic, Energetic, Reflective and Open The Aero UI for Windows Vista
is clean, efficient and fast for frequent, familiar tasks and easy to learn for infrequent
tasks and initial experiences It also includes new transparencies, animations, and visual
effects
What can developers do to make a Windows Vista User Experience
application?
The Aero theme file and APIs make it easy to bring the Aero design to your Windows
Vista–based applications Applications that use the Aero theme will be consistent with
Windows Vista while providing the flexibility for application differentiation
Trang 14Session 1: Introduction to Windows Vista Application Development 7
For most applications, application developers need to do just a few things to create the
Windows Vista User Experience:
• Do not hard code any colors All colors should be based on system or theme metrics
and use comctl32.dll v6 This will give developers the latest look and feel for their
buttons, text boxes, and other UI elements
• Use theme-painting APIs If developers want to develop any elements that look like
standard system elements, they should use the theme-painting APIs
• Use the correct color, layout, and writing styles
• Use the Windows Vista User Experience Wizard and Task Dialog boxes The
Windows Vista User Experience Wizard framework gives application developers the ability to use the Windows Vista User Experience style in their dialog boxes In
Windows Vista, task dialog boxes will replace the message box or most other
instances of a single-step prompt or error message Task dialog boxes add such
features as the main instruction and supporting text and links to error messages
For more information on the Windows Vista User Experience, see the Windows
Vista Experience Web site on the Microsoft MSDN® Web site
Trang 158 Session 1: Introduction to Windows Vista Application Development
Demonstration 1: A Guided Tour of Windows Vista
In this demonstration, you will see some of the new user interface features in
Windows Vista
Key Points
The key points of this demonstration are that:
• Windows Vista provides new ways to search for and organize files
• Windows Vista includes User Account Control to manage user access to restricted
tasks
• Windows Vista includes Internet Explorer 7, which provides new features
• Windows Vista includes the Windows Sidebar and gadgets