1 / 63

Optimizing Your Application for the Windows 7 User Experience

Required Slide. SESSION CODE: WCL312. Optimizing Your Application for the Windows 7 User Experience . Yochay Kiriaty Senior Technical Evangelist Microsoft Corporation. Amazing User eXperience. Name Title Company. DEMO. Building A Great Windows 7 Applications.

oakes
Download Presentation

Optimizing Your Application for the Windows 7 User Experience

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Required Slide SESSION CODE: WCL312 Optimizing Your Application for the Windows 7 User Experience Yochay Kiriaty Senior Technical Evangelist Microsoft Corporation

  2. Amazing User eXperience NameTitleCompany DEMO

  3. Microsoft Confidential

  4. Building A Great Windows 7 Applications Create new experiences on Windows 7 Differentiate • EXPERIENCE Become a first class Windows 7 citizen Optimize Productpasses Microsoft quality tests Compatible

  5. Optimize for PerformanceGet the Most Out of Windows Performance Enhancements • I/O priorities and cancelable I/O • File System and Registry Transaction Support • Power efficiency improvements • Windows Error Reporting • Application restart and recovery with Restart Manager • Trigger-Start Services • Windows Troubleshooting Platform • Event Tracing for Windows (ETW)

  6. 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

  7. Optimize For User eXperienceMake 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

  8. Windows 7 Libraries

  9. What Libraries Are?

  10. 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) <libraryDescription> <name>@shell32.dll,-34575</name> <isLibraryPinned>-1</isLibraryPinned> <iconReference>imageres.dll,-1002</iconReference> <folderType>{7d49d726-3c21-4f05-99aa-fdc2c9474656}</folderType> …

  11. Staying In-Sync with Windows 7 Libraries Part 1 DEMO

  12. Using The API Create Library • Shell APIs are COM based • To use the Library objects, interfaces and functions you should: • #include <shobjidl.h> • #include <objbase.h> // IID_PPV_ARGS macro • To create a new Library: • HRESULT SHCreateLibrary(REFIID riid,void **ppv ); • With the macro: • IShellLibrary *pIShellLib; • SHCreateLibrary(IID_PPV_ARGS(&pIShellLib));

  13. The Shell Helper Functions

  14. Create Library and Add Folder Win32 API IShellLibrary *pIShelLibrary; HRESULT hr = SHCreateLibrary(IID_PPV_ARGS(&pIShelLibrary)); if (SUCCEEDED(hr)) { IShellItem *pIShellItem; SHAddFolderPathToLibrary(pIShelLibrary, L"C:\\Users\\Public\\Documents"); hr = pIShelLibrary->SaveInKnownFolder(FOLDERID_Libraries, L"MyNew Library", LSF_MAKEUNIQUENAME, &pIShellItem); pIShellItem->Release(); pIShelLibrary->Release(); }

  15. Create Library and Add Folder Using Windows API Code Pack //Create new library and add a folder using (ShellLibrary library = newShellLibrary(name, true)) { library.Add(folderPath); } //Load the document library, add new folder, pin to nav pan using (ShellLibrary lib = ShellLibrary.Load( "Documents", false)) { lib.Add(@"C:\"); lib.IsPinnedToNavigationPane = true; lib.DefaultSaveFolder = @"C:\"; }

  16. Staying In-Sync with Windows 7 Libraries Part 2 DEMO

  17. Windows 7 Federated Search The Best Internet and Intranet Search Experience on the Desktop

  18. Federated SearchConsistent experience across providers; files and otherwise Document repository Enterprise data store Enterprise application

  19. One Stop-Shop for Programming Windows 7 Libraries • http://windowsteamblog.com/windows/b/developers/archive/2010/04/14/windows-7-programming-guide-libraries-update.aspx

  20. Windows Ribbon Modernize your application’s UI

  21. Windows Ribbon • In-box with Windows 7, redistribution available to Windows Vista ® • Feature parity with Microsoft® Office 2007 Ribbon • Result-oriented UI Application Menu Contextual Tab Group Quick Access Toolbar Tab Help Button Contextual Tab Group

  22. 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 • <Ribbon> • <Tab> <Button … /> • </Tab> • </Ribbon> • MyHandler::Execute(…){ DoStuff();} • void DoStuff() • { • … • … • }

  23. Building Your Own Ribbon DEMO

  24. Windows Taskbar Modernize your application’s UI

  25. Taskbar Buttons • Consolidation • Quick launch • Notification area icon • Desktop shortcut • Running application windows Multiple windows and hover Running Not running Active

  26. How Are Windows Grouped?Enter: Application ID • It’s a string, not a GUID • Limited to 128 characters • Naming convention – Company.Product.SubProduct.Version • All your application components have it: • Process, shortcut, window, taskbar button, document type

  27. Setting the Application ID • Process-wide – affects all windows in the current process: #include <windows.h> #pragma comment (lib, "shell32.lib") SetCurrentProcessExplicitAppUserModelId( L"Microsoft.Samples.AppId1"); TaskbarManager.SetCurrentProcessAppId( "Microsoft.Samples.AppId1");

  28. Window Application ID • Change single window’s application ID PROPVARIANT pv; InitPropVariantFromString( L"Microsoft.Samples.AppId2", &pv); IPropertyStore *pps; HRESULT hr = SHGetPropertyStoreForWindow( hWnd, IID_PPV_ARGS(&pps)); pps->SetValue(PKEY_AppUserModel_ID, pv); //WinForms: TaskbarManager.SetApplicationIdForSpecificWindow (IntPtrwindowHandle, stringappId) //WPF: TaskbarManager.SetApplicationIdForSpecificWindow (System.Windows.Windowwindow, stringappId)

  29. Windows Taskbar Application ID and its effects on taskbar buttons DEMO

  30. Jump ListsA detailed look Pinned category Destinations (“nouns”) Known categories Custom categories User tasks Tasks (“verbs”) Taskbar tasks

  31. 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

  32. 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 SHAddToRecentDocs(SHARDW_PATH, "file.ext"); RH.RegisterFileAssociations(...); OpenFileDialogofd = ...; ofd.ShowDialog(); JumpListjl = ...; jl.AddToRecent("file.ext");

  33. 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.

  34. Customizing the Jump ListStep 2: Adding tasks IObjectCollection* poc = ...; IShellLink* task = ...; Poc->AddObject(task); ICustomDestinationList* pcdl = ...; Pcdl->BeginList(...); IObjectArray* poa = ... poc; Pcdl->AddUserTasks(poa); Pcdl->CommitList(); JumpListjl = ...; jl.AddUserTasks(paramsIJumpListTask[] tasks);

  35. 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

  36. Customizing the Jump ListStep 3: Adding categories IObjectCollection* poc = ...; IShellItem* item = ...; Poc->AddObject(item); ICustomDestinationList* pcdl = ...; Pcdl->BeginList(...); IObjectArray* poa = ... poc; Pcdl->AppendCategory(L"Sales", poa); Pcdl->CommitList(); JumpListjl = ...; jlm.AddCustomDestination(paramsJumpListCustomCategory[] customCategories);

  37. Customizing Jump Lists http://channel9.msdn.com/posts/yochay/Programming-the-Windows-7-Taskbar--Jump-Lists-Part-2/

  38. Get More From Taskbar ButtonsOverlay and progress icons • Consolidate: Uncluttered notification area • Provide progress and additional information through the taskbar button • It’s free if you use standard progress dialogs

  39. Taskbar Overlay and ProgressDesign considerations • Notification area is now user controlled: • Leave yourself out if possible! • Use taskbar buttons for custom progress or status information

  40. Taskbar Overlay and ProgressThe APIs 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); } myForm.SetTaskbarOverlayIcon(icon, "..."); ProgressBarpb = ...; pb.SetTaskbarProgress();

  41. Taskbar Overlay IconsThe APIs //WinForms: TaskbarManager.SetOverlayIcon (IntPtrwindowHandle, System.Drawing.Icon icon, stringaccessibilityText) //WPF: TaskbarManager.SetOverlayIcon (System.Windows.Window window, System.Drawing.Icon icon, stringaccessibilityText)

  42. Windows Taskbar Overlay icons and progress bar DEMO

  43. Using the Taskbar Button Overlay Icons and Progress Bars http://channel9.msdn.com/posts/yochay/Programming-the-Windows-7-Taskbar--Using-the-Taskbar-Button-Overlay-Icons-and-Progress-Bars/

  44. Live Thumbnails • Live thumbnails: A livepreview • Windows Vista®: One thumbnail per window • Windows 7: Grouped thumbnails

  45. Peek Preview (Aero Peek) Live peek without a click

  46. Live Thumbnails and PeekDesign considerations • Desktop Window Manager (DWM) only talks to top-level windows • Child windows need a custom representation • The thumbnail might be “too much” or “not enough” • What if you could … • Test your thumbnails to make sure they are useful • If they aren’t, customize them!

  47. Thumbnail Clip (Zoom) Zoom into the important parts!

  48. Customizing Live Thumbnails DwmSetWindowAttribute( ...,DWMWA_HAS_ICONIC_BITMAP,...); DwmSetWindowAttribute( ...,DWMWA_FORCE_ICONIC_REPRESENTATION,...); /* in the WndProc */ case WM_DWMSENDICONICTHUMBNAIL: HBITMAP hbm = ...; DwmSetIconicThumbnail(hwnd, hbm, ...); TabbedThumbnailManagerttm = new ...; ttm.AddThumbnailPreview(TabbedThumbnailpreview)

  49. Custom Previews and Thumbnail Clips http://channel9.msdn.com/posts/yochay/Programming-the-Windows-7-Taskbar--Custom-Previews-and-Thumbnail-Clips/

More Related