• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Windows 7 Developer APIs

Windows 7 Developer APIs



deck from TechEd Africa 2010 (Durban)

deck from TechEd Africa 2010 (Durban)



Total Views
Views on SlideShare
Embed Views



3 Embeds 34

http://blogs.msdn.com 32
http://wpolityce.pl 1
http://menes11.corisu.com 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • http://code.msdn.microsoft.com/XP2Win7
  • Windows 7 is a huge release; we focused heavily on fundamentals like performance, graphics, drivers, new shell features, and many other areas. For example, all applications can now integrate with taskbar (for jumplists, progress bar, etc…) or can integrate with Windows 7 libraries or ribbon. Most of these changes are the kind of change that would make your application feel modern, and provide productivity improvements to your users, and the changes would be minor for your app; you can get these types of new light-up with a pretty small amount of work.For those that are more aggressive, or want more differentiation, taking advantage of the new hardware features in Windows is a great way. Multitouch has hit the main stream, and our new APIs make it easy to optimize applications for multitouch. Similarly, we have a new Sensors and Location platform that abstracts the hardware and allows you to take advantage of data like the amount of ambient light by coding to a single, unified API that Windows provides. For those doing graphics on Win32, we have a lot of improvements in the DirectX family so you can extract the performance out of the idle processing power on most modern PCs… Direct2D and DirectWrite can revolutionize how you do graphics, without requiring the developer ramp-up on becoming a DirectX expert. If you are into fundamentals, there is also huge value that is not represented in this slide; features like notifications for power, restart manager to make sure users don’t lose productivity when catastrophic failures happen, doing parallelism to take advantage of the kernel improvements for threading, etc…
  • http://windowsteamblog.com/windows/b/developers/archive/2010/04/14/windows-7-programming-guide-libraries-update.aspx
  • Sample code - http://code.msdn.microsoft.com/Windows7Taskbar/Release/ProjectReleases.aspx?ReleaseId=2246The Shell Helper FunctionsSHAddFolderPathToLibraryAdds a folder to a librarySHCreateLibraryCreates an IShellLibrary objectSHLoadLibraryFromItemCreates and loads an IShellLibrary object from a specified library definition fileSHLoadLibraryFromKnownFolderCreates and loads an IShellLibrary object for a specified KNOWNFOLDERIDSHLoadLibraryFromParsingNameCreates and loads an IShellLibrary object for a specified pathSHRemoveFolderPathFromLibraryRemoves a folder from a librarySHResolveFolderPathInLibraryResolve the target location of a library folder that has been moved or renamedSHSaveLibraryInFolderPathSaves an IShellLibrary object to disk
  • Windows 7 supports the connection of external sources to the Windows Client through the OpenSearch  protocol. This enables users to search a remote data store and view results from within Windows Explorer. The OpenSearch v1.1 standard defines simple file formats that can be used to describe how a client should query the Web service for the data store and how the service should return results to be rendered by the client. Windows federated search connects to Web services that receives OpenSearch queries, and returns results in either the RSS or Atom XML format.
  • How to - http://blogs.msdn.com/b/jimoneil/archive/2009/10/25/7-on-7-federated-search.aspx
  • http://windowsclient.net/wpf/wpf35/wpf-35sp1-ribbon-walkthrough.aspxhttp://www.microsoft.com/downloads/en/details.aspx?FamilyID=2bfc3187-74aa-4154-a670-76ef8bc2a0b4&displaylang=en
  • //WinForms: TaskbarManager.SetOverlayIcon (IntPtrwindowHandle, System.Drawing.Icon icon, stringaccessibilityText)
  • In C++ITaskbarList3* ptl = ...;ptl->SetOverlayIcon(hwnd, hicon, L"Accessible Description");ptl->SetProgressState(hwnd, TBPF_NORMAL);for (int i = 0; i < MAX; ++i) {ptl->SetProgressValue(hwnd, i, MAX);}
  • Desktop Window Manager (DWM) only talks to top-level windowsChild windows need a custom representationThe thumbnail might be “too much” or “not enough”What if you could …Test your thumbnails to make sure they are usefulIf they aren’t, customize them!C++DwmSetWindowAttribute( ...,DWMWA_HAS_ICONIC_BITMAP,...);DwmSetWindowAttribute(...,DWMWA_FORCE_ICONIC_REPRESENTATION,...);/* in the WndProc */case WM_DWMSENDICONICTHUMBNAIL: HBITMAP hbm = ...;DwmSetIconicThumbnail(hwnd, hbm, ...);
  • C++SHAddToRecentDocs(SHARDW_PATH, "file.ext");
  • In C++IObjectCollection* poc = ...;IShellLink* task = ...;Poc->AddObject(task);ICustomDestinationList* pcdl = ...;Pcdl->BeginList(...);IObjectArray* poa = ... poc;Pcdl->AddUserTasks(poa);Pcdl->CommitList();
  • In C++IObjectCollection* poc = ...;IShellItem* item = ...;Poc->AddObject(item);ICustomDestinationList* pcdl = ...;Pcdl->BeginList(...);IObjectArray* poa = ... poc;Pcdl->AppendCategory(L"Sales", poa);Pcdl->CommitList();

Windows 7 Developer APIs Windows 7 Developer APIs Presentation Transcript

  • Lynn Langit – blogs.msdn.com/SoCalDevGal
    Senior Developer Evangelist
    Microsoft Corporation
    Optimizing Your Application for the Windows 7 User Experience
  • Amazing User Experience
    WinXP to Windows 7 Photo Viewer
  • Create new experiences on Windows 7
    Building A Great Windows 7 Applications
    Become a first class Windows 7 citizen
    Productpasses Microsoft quality tests
  • Developing for Windows 7
    Sensor APIs
    DirectX 11 Family
  • Optimize For User Experience- AgendaMake sure your application looks and feels like Windows 7 first class citizen
    Windows 7 Libraries
    Become library aware and work with libraries
    Federated Search
    Windows Ribbon
    Windows 7 Taskbar
    Jump Lists
    Aero Peek
  • Windows API Code Pack
    Set of libraries to expose Windows 7 features to .NET Developers
    If you prefer to code in C++, not needed
    Found at http://code.msdn.microsoft.com/WindowsAPICodePack
  • Windows 7 Libraries
  • Staying In-Sync with Windows 7 Libraries
  • Libraries Under The Hood
    Library information is kept in a file (.library-ms)
    The format of the .library-ms file is a private data structure and subject to changes
    Use ONLY the Windows Shell Library APIs to manage and interact with libraries
    Use the library file definition to:
    Delete, rename, or wait for change notification (changes to the library structure)

  • Create Library / Add Folder Using Windows API Code Pack
    //Create new library and add a folder
    using (ShellLibrary library = newShellLibrary(name, true))
    //Load the document library, add new folder, pin to nav pan
    using (ShellLibrary lib = ShellLibrary.Load(
    "Documents", false))
    lib.IsPinnedToNavigationPane = true;
    lib.DefaultSaveFolder = @"C:";
  • Working with the Windows 7 Library API
  • Federated SearchConsistent experience across providers; files and otherwise
    Document repository
    Enterprise data store
    Enterprise application
  • Windows 7 Federated Search
  • Windows Ribbon
    In-box with Windows 7
    Feature parity with Office 2007 Ribbon
    Result-oriented UI
    Application Menu
    Contextual Tab Group
    Quick Access
    Help Button
    Contextual Tab
  • Windows Ribbon
  • Windows Ribbon UI Architecture
    Ribbon elements are specified in markup
    Available controls
    Menus, drop-down galleries, combo boxes, font control, buttons, spinners, tabs and groups and more
    Application-Specific Business Logic
    Windows Ribbon
    Markup: Organization of controls
    COM API: Initialization and events handling
    void DoStuff()

    MyHandler::Execute(…){ DoStuff();}
    <Tab> <Button … />
  • Building Your Own Ribbon
  • Windows Taskbar
  • Taskbar Buttons
    Quick launch
    Notification area icon
    Desktop shortcut
    Running application windows
    Multiple windows and hover
    Not running
  • Taskbar Overlay IconsThe APIs
    (System.Windows.Window window, System.Drawing.Icon icon,
    Hands on Lab – video - here
  • Taskbar Overlay and Progress
    Notification area is now user controlled:
    Leave yourself out if possible
    Use taskbar buttons for custom progress or status information
    FREE if you use standard progress dialogs
    myForm.SetTaskbarOverlayIcon(icon, "...");
    ProgressBarpb = ...;
  • Windows Taskbar
    Overlay icons and progress bar
  • Live Thumbnails
    Live thumbnails: A livepreview
    Windows 7: Grouped thumbnails
    No click – just hover
  • Thumbnail Clip (Zoom)
    TabbedThumbnailManagerttm = new ...;
    Video - here
  • Jump ListsA detailed look
    Pinned category
    Known categories
    Custom categories
    User tasks
    Taskbar tasks
  • Jump ListsDesign considerations
    Surface key destinations and tasks
    Recent and frequent are free
    Pinned is also free (if users use it)
    Respect items the user removes!
    Addictive: You don’t look for documents anywhere else!
    Users expect common tasks to be there
  • Customizing the Jump ListStep 1: Get the free stuff to work
    Associate your program with the file extension
    Use common file dialogs
    Use explicit recent document API
    OpenFileDialogofd = ...; ofd.ShowDialog();
    JumpListjl = ...;
  • Customizing the Jump ListStep 2: Adding tasks
    What would your user like to do?
    Launch your application with special arguments?
    Launch other applications?
    Tasks are IShellLink objects
    Rich shortcut semantics including arguments, working directory, icon, and so on.
    JumpListjl = ...;
    jl.AddUserTasks(paramsIJumpListTask[] tasks);
  • Customizing the Jump ListStep 3: Do you have categories?
    Does it make sense to categorize documents?
    Is frequent, recent, pinned not enough?
    For example, Inbox, Outbox, Sales, Marketing …
    Categories contain IShellItem or IShellLink objects
    These are documents: You need a file association
    HOL Video - here
    JumpListjl = ...;
    jlm.AddCustomDestination(paramsJumpListCustomCategory[] customCategories);
  • Built for Windows 7 – Travel Package Creator
    • Jumplist
    • Taskbar
    • Multi touch
    • And more!
  • Optimize for PerformanceGet the Most Out of Windows Performance Enhancements
    Application restart and recovery with Restart Manager
    I/O priorities and cancelable I/O
    File System and Registry Transaction Support
    Event Tracing for Windows (ETW) – high-performance instrumentation
    Windows Error Reporting
    Trigger-Start Services
    Windows Troubleshooting Platform
    Power efficiency improvements
    WLC306 - Fundamentals in Windows Applications for Developers: Graphics, Power, Services, and Profiling
    See recording
  • Related Content
    Breakout Sessions
    WCL206 – My Favorite WPF4 Features
    WCL305 – Optimizing Your Application for the Windows 7 Experience
    WCL410 - Windows 7 and IE8 Application Compatibility Remediation
    Other content by Lynn Langit
    Blog series – Windows 7 Multi Touch Programming - Here
    Presentation – Developing Windows 7 Applications with VS2010 - Here
    Facebook Group – Windows 7 Developers
  • Get the Book!
  • Resources
    Required Slide
    Sessions On-Demand & Community
    Microsoft Certification & Training Resources
    Resources for IT Professionals
    Resources for Developers
  • Complete an evaluation via CommNet and Tag to win amazing prizes!
  • TeachingKidsProgramming.org
    • Do a Recipe  Teach a Kid
    • Free Courseware (recipes)
    • Ages 10 ++
    • Microsoft SmallBasic
  • © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
    The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.