Prezentace se nahrává, počkejte prosím

Prezentace se nahrává, počkejte prosím

Nová Windows Vista API Mgr. Michal Neuwirth ISV Technical Readiness

Podobné prezentace


Prezentace na téma: "Nová Windows Vista API Mgr. Michal Neuwirth ISV Technical Readiness"— Transkript prezentace:

1 Nová Windows Vista API Mgr. Michal Neuwirth ISV Technical Readiness
Microsoft s.r.o. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

2 Agenda Vista API vs .NET Uživatelské rozhraní AERO Ovládací prvky
SideBar Gadgets RSS Feeds Search Mobile PC Restart & Recovery Správa uživatelského účtu

3 Vista vs .NET

4 .NET 3.0

5 Windows Vista Nativní API
VTable-based COM interface Komplexní PInvoke definice Shell extensibility interface který musí být implementován v nativním kódu

6 Vtable-based interfaces
Neexistuje typová knihovna Interfaces nelze kompletně popsat v rámci typové knihovvny Nelze je volat přímo (např. Add Reference či tlbimp) bez předchozí úpravy

7 COM Interface Typy Typ Primární charakteristika
Type library marshaling Automation Implementace IDispatch Late binding Pouze typy VARIANT Ano Custom (či VTable) Odvozen od IUnknown VTable (early) binding Ne Dual Odvozen od IDispatch Podporuje late a early binding

8 Typové knihovny Vytvořeny pomocí MIDL kompileru z IDL
4/6/ :04 AM Typové knihovny Vytvořeny pomocí MIDL kompileru z IDL Obsahuje pouze typy obsažené v příkazu library Mnoho standardních IDL atributů není propagováno do výsledné typové knihovny MIDL.exe .idl .tlb Often times, type definitions are not included in the library statement of an IDL file. So to even get these definitions into the resulting type library would require making a copy of SDK idl files, copying and pasting the necessary definitions into the library block, and running MIDL to create a new type library. But even if you were to do that, the resulting type library might not have enough information to support correct marshaling, as many common attributes that are applied to custom interfaces MICROSOFT CONFIDENTIAL © 2006 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.

9 4/6/ :04 AM .NET COM Interop Interop assemblies mapují COM definice na ekvivalentní.NET Framework typy tlbimp.exe může generovat interop assemblies z typových knihoven Chybějící atributy z vlastních rozhraní mohou zabránit správnému marshalingu MICROSOFT CONFIDENTIAL © 2006 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.

10 Interface s C-style polem
4/6/ :04 AM Interface s C-style polem Definice v IDL (pole jako vstupní parametr) // interface IFileDialog : IModalWindow HRESULT SetFileTypes( [in] UINT cTypes, [in, size_is(cFileTypes)] const COMDLG_FILTERSPEC *rgFS); size_is není propagována do typové knihovny; během překladu se ztratilo to, že rgFS je pole. Definice ve výsledném interop assembly void SetFileTypes(uint cTypes, ref COMDLG_FILTERSPEC rgFS); Scenario: C-style array as input parameter size_is not propagated into type library by MIDL. Interop marshaling cannot marshal the array elements. Variable-length arrays are imported as reference arguments Need to add [MarshalAs(UnmanagedType.LPArray)] attribute to interop definition Může být definováno jako … void SetFileTypes(uint cTypes, [In, MarshalAs(UnmanagedType.LPArray)] COMDLG_FILTERSPEC[] rgFS); MICROSOFT CONFIDENTIAL © 2006 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.

11 4/6/ :04 AM Jak toto vyřešit? Disassemblovat interop assembly, změnit interop definitions (v IL) a reassemble .method public hidebysig newslot abstract virtual instance void SetFileTypes([in] uint32 cFileTypes, [in] valuetype COMDLG_FILTERSPEC[] marshal([]) rgFilterSpec) runtime managed internalcall .method public hidebysig newslot abstract virtual instance void SetFileTypes([in] uint32 cFileTypes, [in] valuetype COMDLG_FILTERSPEC& rgFilterSpec) runtime managed internalcall Ručně vytvořit interop definice [ComImport(), Guid(IIDGuid.IFileDialog), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IFileDialog : IModalWindow { void SetFileTypes([In] uint cFileTypes, [In, MarshalAs(UnmanagedType.LPArray)] COMDLG_FILTERSPEC[] rgFilterSpec); Vytvořit wrapper v C++ MICROSOFT CONFIDENTIAL © 2006 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.

12 PInvoke problémy Definice parametrů a návratových typů
Předávání hodnot mezi nativním a managed kódem IntPtr pro jiné než handle typy je nutné explicitně marshalovat Rozdílné programovací modely Explicitní memory management vs garbage collection Some APIs are simple to define/call via PInvoke; others are not. Depends on the degree of difficult involved in: Defining the PInvoke signature. Some types can be very complex to map to managed code equivalents Calling the PInvoke signature. Depending on the types used, it may be require converting to foreign types and explicitly handling marshaling. (Typcially, whenever an IntPtr is involved , for something other than a handle type, you’ll need to explicitly marshal). Conversions between Win32 User/GDI and WPF constructs can be challenging as well. Differences in programming models may be exposed, like explicit memory management as opposed to garbage collection. Also, many managed code developers may not have the necessary background in Win32 to understand common paradigms. MICROSOFT CONFIDENTIAL © 2006 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.

13 VistaBridge Množina příkladů vložená do Windows SDK
4/6/ :04 AM VistaBridge Množina příkladů vložená do Windows SDK Ilustruje interop a wrapper techniky pro přístup k některým Vista API Lze libovolně modifikovat Zaměřeno na klíčové API, které je těžké volat přímo z managed kódu MICROSOFT CONFIDENTIAL © 2006 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.

14 VistaBridge v1.0 4/6/2017 12:04 AM VistaBridge: Where can you find it?
MICROSOFT CONFIDENTIAL © 2006 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.

15 VistaBridge v1.0

16 VistaBridge v1.0

17 Vista API příklady WPF “look-like” Wizard control
VistaBridge WinForms Command Link control Použití UAC manifestu, spuštění povýšeného procesu a dekorace tlačítka ikonkou štítu OLE DB Provider pro Windows Search pomocí ADO.NET, a jak dynamicky dotazovat Property System

18 AERO

19 Desktop composition Nový způsob práce s grafikou Poskytuje
Grafický obsah je nejdříve vykreslen do „off-screen“ bufferu a poté je komponován do „back“ bufferu odkud je teprve vykreslen na display Poskytuje Práci s 3D Průhlednost Flip3D Glass Animace Thumbnails …… Závislé na grafické kartě

20 Desktop Windows Manager
On/Off pomocí nastavení schématu Windows Vista AERO Basic Pracuje s okny všech aplikací pomocí technologie Desktop composition Požadavky na grafickou kartu DX9.0c s podporou pixel shader 2.0 Podpora 32bpp WDDM ovladač – DWM přímo spolupracuje s ovladačem Paměť min 64MB, 256MB pro 1600x1200+

21 DirectX Directx 9 L Directx 10
Poslední verze 9.x Obsahuje legacy rozhraní pro non-WDDM a poběží na Win XP a výše Directx 10 Pouze Windows Vista API Full-screen DirectX exclusive aplikace automaticky vypínají kompozici

22 AERO Authentic, Energetic, Reflective, Open & accessible AERO Glass
On/off nastavením průhlednosti Dle podpory grafické karty Transparent Glass Opaque Glass AERO glass vypnuté

23 AERO témata Průsvitné rámečky formulářů
Libovolné barvy rámečků formulářů Nové ikony pro windows tlačítka Reakce na „přejezd“ kurzorem myši nad tlačítky © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

24 DWM Běží v rámci dwm.exe Pro přístup ke specifickým funkcím použít dwmapi.dll Spolupracuje s milcore.dll sdílená komponenta s WPF pro výstup a rendering do DirectX

25 DWM Aplikace DWM render thread DirectX interface vykreslení scény
Přenášejí se pouze delty od předchozí kompozice..... Umoznuje generovat sceny na jednom stroji a jeho vykreslovani na druhem DirectX interface update desktopu pomocí © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

26 dwmapi.dll DwmEnableComposition DwmSetWindowAttribute
on/off kompozice DwmSetWindowAttribute nastavuje vlastnosti okna pro zpracování kompozice (např. nastavení glass effektu) DwmGetWindowAttribute DwmDefWindowProc

27 dwmapi.dll – blur efekt DwmIsCompositionEnabled
pro kontrolu zda je zapnutá kompozice DwmEnableBlurBehindWindow kontroluje blur efekt vlastního okna (standarně automaticky zapnuto) DwmExtendFrameIntoClientArea kontroluje blur efekt vlastní klientské části (standardně je opaque)

28 dwmapi.dll – thumbnails
DwmQueryThumbnailSourceSize vrací velikost náhledu DwmRegisterThumbnail vytváří vztah mezi zdrojovým a cílovým oknem DwmUnregisterThumbnail DwmUpdateThumbnailProperties

29 WM_DWM.... WM_DWMCOMPOSITIONCHANGED Bez parametrů
WM_DWMCOLORIZATIONCOLORCHANGED Změna barvy pozadí WM_DWMNCRENDERINGCHANGED Změna vykreslování u ne-klientské části okna wParam = zda je povoleno vykreslování

30 DwmExtendFrameIntoClientArea
-1 nastaví hodnotu aktuálního okna 0 provede reset nutno nastavit po každém resize okna cyTopHeight cxLeftWidth cxRightWidth cyBottomHeight

31 Alpha kanál Při použití aero glass na pozadí je nutné používat funkce pracující s alpha kanálem Černá barva je použita jako 0x (při použití alpha kanálu to je plně průhledná barva) Standardní černá barva textboxu je pomocí DWM rozpoznána jako průhledná Použít Application.SetUseCompatibleTextRenderingDefault(true) Nebo owner-draw metody Nebo vykreslovat do bitmapy Nebo používat GDI+ GDI funkce jsou zpracovány pomocí HW....GDI+ zpracovává software © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

32 Thumbnails Živé náhledy běžících aplikací
Potřeba hWND okna jehož náhled chceme zobrazit a okna kam chceme náhled zobrazit OS automaticky provádí změny

33 Segoe font Nový systémový font vytvořen specielně pro UI
Optimalizován pro ClearType Standardní velikost 9 pt Musí být explicitně uveden při vytváření formulářů a dialogů The Segoe UI Font ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

34 demo AERO Glass Thumbnails 4/6/2017 12:04 AM
How to AERO works and how to enable/disable. Hello Glass Aero Glass – audience only EllipticGlass – audience only VB6-Glass Thumbnails = DWM project demo MICROSOFT CONFIDENTIAL © 2006 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.

35 Ovládací prvky

36 Ovládací prvky Podpora nových vizuálních vlastností jako je hover states, cross fading a další Nové stavy a styly ovládacích prvků Nové ovládací prvky Network Address Control (IPv6) Command Link Control Vylepšení stávajících prvků pro plnou podporu Vista vlastností Open File Dialog Save File Dialog

37 Command Link Control Snižuje počet potřebných kliků uživatele
Text Snižuje počet potřebných kliků uživatele Zjednodušuje orientaci uživatele Při přejezdu myší vzhled tlačítka Poznámka (volitelné) Ikona (volitelné) © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

38 Vývoj Vista API .NET Nový styl tlačítka (BS_COMMANDLINK)
Nové typy zpráv tlačítek (BCM_SETNOTE, BCM_GETNOTE) .NET Flatstyle nastavit FlatStyle.System Přidat styl BS_COMMANDLINK Zpracovat BCM_SETNOTE, BCM_GETNOTE Nebo použít VistaBridge

39 using System; using System. Windows. Forms; using System. Runtime
using System; using System.Windows.Forms; using System.Runtime.InteropServices; namespace VistaControls { class CommandLinkButton : Button public CommandLinkButton() { base.FlatStyle = FlatStyle.System; } private string helpText = ""; public string HelpText get { return this.helpText;} set Win32Api.SendMessage(this.Handle, 0x /*BCM_SETNOTE*/,IntPtr.Zero, value); this.helpText = value; } protected override CreateParams CreateParams CreateParams cp = base.CreateParams; cp.Style |= 0x e; //BS_COMMANDLINK return cp; public static class Win32Api [DllImport("user32", CharSet = CharSet.Unicode)] internal static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, string lParam);

40 demo Command Link Control 4/6/2017 12:04 AM CommandLink
MICROSOFT CONFIDENTIAL © 2006 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.

41 Task Dialog MessageBox Task Dialog Jednoduché použití
Ne vždy srozumitelné pro uživatele Task Dialog Nová generace dialogů pro zprávy a dotazy Více uživatelsky přívětivý Využívá Command Link Control © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

42 Task Dialog TaskDialog() pro jednoduché zprávy
TaskDialogIndirect() pro komplexní okna

43 TaskDialogIndirect()
4/6/ :04 AM TaskDialogIndirect() Progress bar Radio buttons Command links This example illustrates the use of command links and standard buttons. Cannot display both custom buttons and command links. Cannot display both custom buttons and standard buttons Instead of a progress bar, you can display a “marquee” progress bar that will just show motion You cannot have both a progress bar and a marquee progress bar You can only have one progress bar or marquee bar. Not both, and not more than one of either kind Expand control Checkbox Zápatí: ikona a text MICROSOFT CONFIDENTIAL © 2006 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.

44 Task Dialogy [DllImport("comctl32.dll", CharSet = CharSet.Auto)]
4/6/ :04 AM typedef struct _TASKDIALOGCONFIG { UINT cbSize; HWND hwndParent; HINSTANCE hInstance; TASKDIALOG_FLAGS dwFlags; TASKDIALOG_COMMON_BUTTON_FLAGS dwCmdBtns; PCWSTR pszWindowTitle; union HICON hMainIcon; PCWSTR pszMainIcon; }; PCWSTR pszMainInstruction; PCWSTR pszContent; UINT cButtons; const TASKDIALOG_BUTTON* pButtons; int nDefaultButton; UINT cRadioButtons; const TASKDIALOG_BUTTON* pRadioButtons; int nDefaultRadioButton; PCWSTR pszVerificationText; PCWSTR pszExpandedInformation; PCWSTR pszExpandedControlText; PCWSTR pszCollapsedControlText; HICON hFooterIcon; PCWSTR pszFooterIcon; PCWSTR pszFooter; PFTASKDIALOGCALLBACK pfCallback; LONG_PTR lpCallbackData; UINT cxWidth; } TASKDIALOGCONFIG; Task Dialogy [DllImport("comctl32.dll", CharSet = CharSet.Auto)] static extern int TaskDialog( IntPtr hwndParent, IntPtr hInstance, string pszWindowTitle, string pszMainInstruction, string pszContent, int dwCommonButtons, IntPtr pszIcon, out int pnButton); HRESULT TaskDialog( HWND hwndParent, HINSTANCE hinst, PCWSTR pszWindowTitle, PCWSTR pszMainInstruction, PCWSTR pszContent, TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons, PCWSTR pszIcon, int* pnButton); HRESULT TaskDialogIndirect( const TASKDIALOGCONFIG* pTaskConfig, int* pnButton, int* pnRadioButton, BOOL* pfVerificationFlagChecked); TaskDialogIndirect verification check box, command links and push buttons, plus any combination of predefined icons and push buttons. This function can register a callback function to receive notifcation messages MICROSOFT CONFIDENTIAL © 2006 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.

45 TaskDialog Bug Fix #1 #region Static Show Methods
4/6/ :04 AM TaskDialog Bug Fix #1 #region Static Show Methods  // STATIC SHOW() METHODS public static TaskDialogResult Show(string msg) { return ShowCoreStatic(msg, TaskDialogDefaults.MainInstruction, TaskDialogDefaults.Caption); } public static TaskDialogResult Show(string msg, string mainInstruction) mainInstruction, //replace TaskDialogDefaults.MainInstruction public static TaskDialogResult Show(string msg, string mainInstruction, string caption) mainInstruction, // replace TaskDialogDefaults.MainInstruction, caption, // replace TaskDialogDefaults.Caption); #endregion Static Show method overrides are not passing on additional parameters to the ShowCoreStatic method. Fixed in v1.1 MICROSOFT CONFIDENTIAL © 2006 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.

46 4/6/ :04 AM TaskDialog Bug Fix #2 public class TaskDialogCommandLink : TaskDialogButton { public override string ToString() // Bug: String format incorrect string instructionString = (instruction == null ? "" : instruction + "\n"); return instructionString + Text; // FIX: String format should be: text \n instructionsString : instruction); return Text + "\n" + instructionString; } VistaBridge TaskDialogCommandLink.cs, lines 29/30 The underlying API expects this string to be formatted as follows: <command text> \n <note text> Text is mistakenly being formatted in inverse order. Fixed in v1.1 MICROSOFT CONFIDENTIAL © 2006 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.

47 demo TaskDialog 4/6/2017 12:04 AM CommandLink MICROSOFT CONFIDENTIAL
© 2006 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.

48 Common File Dialog Search Box Třídění, filtrování, shlukování Náhled
Address Bar Náhled Navigace Úlohy dle typu obsahu Rozšiřitelná Známá místa Vlastnosti souboru Náhled

49 Common File Dialog Nová API: Mini Save Mode IFileDialog,
IFileOpenDialog IFileSaveDialog, IFileDialogEvents IFileDialogCustomize IFileDialogControlEvents Mini Save Mode The file dialog maintains view-state: last visited folder, dialog size and position. You can store multiple instances of this viewstate so that different places in your application can use the file dialog and each can remember its own context between uses. Extensible Places Bar – unlike in XP, it’s now easy to add custom common places to the common file dialog from your app. Also, there is now a standard way to add your own buttons and other controls into the dialog without having to rewrite the whole thing yourself. The file dialog is able to raise events notifying your code of user interactions within the dialog, giving you the opportunity to react to these and maybe make further changes to the dialog’s appearance. New APIs: IFileDialog, IFileOpenDialog, IFileSaveDialog, IFileDialogEvents. The save dialog now offers a mini save mode – a collapsed small version of UI. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

50 API Funkce Nové API funkce jsou Vtable Interfaces
Stávající Win32 API (GetOpenFileName / GetSaveFileName) jsou stále podporované Zobrazí nový Dialog s přednastavenými vlastnostmi Windows Forms a WPF jsou postaveny nad těmito Win32 API funkcemi

51 demo Common File Dialog 4/6/2017 12:04 AM OpenFile Dialog
CFD Demo Solution demo MICROSOFT CONFIDENTIAL © 2006 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.

52 Known Folders Následovník “specielních složek” Kategorie
4/6/ :04 AM Known Folders Následovník “specielních složek” Rozšiřitelné třetími stranami Založeno na KNOWNFOLDERID Kategorie Common (pro sdílení dat/nastavení mezi uživateli) Per-User Virtuální (např. Control Panel) Fixní Win32 funkce SHGetKnownFolderPath Následovník ShGetFolderPath Nové COM API (VTable interfaces) IKnownFolderManager, IKnownFolder In order to be extensible by third parties, folders are now identified by KNOWNFOLDERIDs (which are represented by GUIDs), rather than CSIDLs (Constant Special Item ID List), that are represented by integer values) The one Per-User KnownFolder that does not support redirection is FOLDERID_Profile (the user’s profile folder) MICROSOFT CONFIDENTIAL © 2006 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.

53 demo Known Folders 4/6/2017 12:04 AM Known Folders Demo
MICROSOFT CONFIDENTIAL © 2006 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.

54 Stock Icons Mnoho systémových ikon je používaných napříč systémem
4/6/ :04 AM Stock Icons Mnoho systémových ikon je používaných napříč systémem Vývojáři je chtějí používat Typické je copy/paste Nová reprezentace v budoucích OS vyžaduje manuální akutalizace Nová funkce SHGetStockIconInfo Umožňuje získat dynamicky za běhu ikony z OS MICROSOFT CONFIDENTIAL © 2006 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.

55 SHStockIconInfo HRESULT SHGetStockIconInfo(
SHSTOCKICONID siid, // enum type UINT uFlags, // bit field SHSTOCKICONINFO *psii); typedef struct _SHSTOCKICONINFO { DWORD cbSize; HICON hIcon; int iSysImageIndex; int iIcon; WCHAR szPath[MAX_PATH]; } SHSTOCKICONINFO;

56 demo Stock Icons 4/6/2017 12:04 AM StockIcon Demo
MICROSOFT CONFIDENTIAL © 2006 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.

57 Aero Wizards © 2006 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

58 Aero Wizard Framework Nahrazuje Wizard ’97 framework Změny
Odstranění nepotřebných stran Vytvoření sekce záhlaví (heading) a podtitul (subheading) Navigace připomíná navigaci v IE Využívá Command link command © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

59 AERO Wizards © 2006 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

60 Zdroje Windows Vista User Experience Guidelines
MSDN User Interface Developer Center Windows Vista Developer Story

61 Sidebar gadgets

62 Gadgets „Miniaplikace“ účelově zaměřené na určitý typ akce/scénáře bězící v rámcí SideBar Define gadgets, and their role in the sidebar. Introduce types of gadget. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

63 Microsoft Gadgets Web, Desktop a Sideshow Integrace
Live.com gadgets běží uvnitř Sidebar Sidebar gadget data lze zobrazit v SideShow live.com DHTML / Atlas Briefly discuss relationship between sidebar, web gadgets, and sideshow. (E.g. v1 goal that it’s possible to write a sidebar gadget that can show up as a sideshow gadget.) The connection is really an end user perception one rather than a technical one. All three technologies have a concept of a gadget. SideShow is the most distant relation. (SideShow is the thing where you have some kind of auxiliary display, e.g. one on your laptop lid that lets you look at stuff like your calendar without having to open up the laptop and bring it out of suspend.) You might want to supply two gadgets, one to run in the sidebar and one to run in the sideshow. These will be two completely different bits of code, although they would both most likely be fairly thin UIs on top of some common underlying functionality provided by your main app. You’re not required to supply both, it’s just that for some apps, it might make sense to offer the user both choices. Live.com and Sidebar are more closely related technically, in that both are DHTML-based. So you might be able to offer a gadget in both environments that share some code. (Live.com gadgets run in the web browser rather than the sidebar of course.) NOTE: this slide is just here to discuss the broader context – the fact that the idea of ‘gadgets’ is one that is not unique to Sidebar. However, for the rest of this talk, we will only be looking at Sidebar. Sidebar DHTML / Gadget OM SideShow C++ © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

64 Vista Gadgets nejsou Nainstalované aplikace
Nejsou ve start menu Nemají menu, toolbar Nelze je minimalizovat, maximalizovat Nelze se na ně přepnout pomocí ALT+TAB Nejsou to webové stránky Jsou to instalované „komponenty“ Sidebar pracuje s těmito „komponentami“ Highlight some ways in which gadgets differ from normal apps. (Not on the Start menu, don’t Alt+Tab or navigate, don’t have usual minimize/maximize UI.) All of these things make gadgets less intrusive than full applications. But the sidebar enables them to have a richer UI than would be possible in a system tray application. And the sidebar puts the user in control – the user gets to decide exactly what’s in their sidebar. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

65 Vývoj DHTML CSS Gadget OM JScript COM (ActiveX) objekty
Vytváření pomocí CreateObject Windows Media Player, Office, WMI,… © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

66 Objektový model Události Interakce se systémem
Dock/undock Práce s vlastnostmi Interakce se systémem System.Display System.Environment System.Globalization System.Machine System.Net.NetworkInformation System.Shell.[Item/Drive/Metadata/RecycleBin] CreateObject pro externí objekty/kód Introduce DHMTL programming model for writing gadgets. Again, remember that the basic model here is that gadgets are local applications. They happen to have a DHTML-based UI, but like HTAs, the security model is the same as for other locally-installed applications: you should only install applications from sources you trust. Consequently, gadgets are free to use COM components as the basis for their functionality. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

67 Vlastnosti Jeden dialog pro nastavení vlastností
Jednoduchý dialog bez záložek Gadgety v SideBaru jsou široké max. 130px Plovoucí (umístěné vně) mohou být větší 24-bit Per-pixel Alpha (.PNG) a transparentnost pro grafické pozadí a okraje Není podpora uvnitř gadgetu (není obsaženo v MSHTML) The ‘less is more’ part is particularly important because one of the primary goals of sidebar is to keep the user in control. Offering big multi-function gadgets would defeat this goal because the user is unable to pick and choose which bits they want. Offering multiple gadgets, each with a single well-defined purpose is much better because the user can then choose the combination of gadgets. (In any case, the UI model doesn’t work well for complex gadgets – there’s just a single settings dialog per gadget, and the user experience guidelines explicitly rule out using tabbed config dialogs. If you feel you want tabbed settings, your gadget is too complex.) Note that gadgets serve a difference purpose than notifications like toast. Although it’s possible to have the sidebar always be visible, users can choose to let it sit behind other applications. (Not everybody has a widescreen display.) If you are showing information a user needs to see, then some sort of popup (either toast or a dialog) would be a better choice. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

68 Lokalizace Gadget může obsahovat více jazykových verzí
Sidebar automaticky použije první jazyk z listu preferovaných jazyků v nastavení Visty Lokalizované soubory mohou být součástí instalace Nebo lze doinstalovat později How a single gadget can serve multiple locales. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

69 Versioning and Manageability
Sidebar platform versioning Gadget.xml includes platform version number Gadget versioning Gadget.xml includes gadget version, author and URI If you are installing a gadget that already exists Given version info and author Prompted to replace Versioning of the platform, and of individual gadgets. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

70 Instalační balíček Gadget.xml - manifest Ikona Verze Gadget Type info
Bezpečnostní informace Info website Prezentace UI Zdroje (obrázky, lokalizované řetězce, …) Výkonný kód (JavaScript) Ikona pro Gadget picker Describes the file packaging for distributing gadgets – how to provide a description, version, icon, resources etc. Note that a couple of of the elements in Gadget.xml are there to support future plans. The only ‘Gadget Type’ supported today is DHTML, but in the future, WPF gadgets are likely to be supported. The Security requirements is also a placeholder – today, sidebar gadgets are just like regular applications from a security perspective. (They run with full trust. So although the UI may be based on DHTML, they are emphatically not a web application – they are more like a .HTA) © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

71 Instalace Sidebar Gadgets jsou instalovány na počítač .gadget je
Zip nebo CAB CAB je možné podepsat Může běžet více instancí jednoho gadgetu Nastavení se ukládají jak pro SideBar tak pro jednotlivé instance gadgetů Mechanisms involved in installing gadgets. The animated ‘.gadget’ signifies that all packages have to end in that extension, regardless of which packaging option you use. (Even directories.) The directory format is particularly convenient while developing a gadget – it means you don’t have to recreate a .ZIP or .CAB every time you change something. Instead you can just try out modifications in place. Of course for distributing gadgets once development is complete, the single file approach is a whole lot more convenient for the user. Note the main advantage of a .CAB is that you can sign it. There are two places for gadgets. The user profile directory stores gadgets specific to that user. The system administrator can also add gadgets to a per-machine gadget store. (Users cannot remove per-machine gadgets from the gadget picker list.) © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

72 demo SideBar Gadget 4/6/2017 12:04 AM Gadget MICROSOFT CONFIDENTIAL
© 2006 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.

73 Zdroje http://www.microsoftgadgets.com
Gadget API Channel 9 video © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

74 Rss feeds

75 Feeds platforma Prohlížeč Fotografie Kontakty … API Úložiště Služby
RSS Object Model API Feedlist Položky Obálky Úložiště RSS 0.9x RSS 1.0 RSS 2.0 Atom Illustrates RSS platform features and how it relates to applications. (Both applications that expose RSS, and applications that want to consume it.) Shows the API for consuming applications. Shows the store, and the download/parse/merge processing done by the service, which goes and fetches the actual RSS feeds. Additional points (from appendix in PDC content, but to be mentioned at this point): BITS for enclosure download Conditional GETs Format support RSS 0.9x, 1.0, 2.0 ATOM Store for feeds, items, enclosures Maintain last 200 items COM API Note that the store is per-user. Download Engine Merge Processor Služby Zprávy Blogy Fotografie Audio Kalendáře Seznamy …. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

76 msfeeds.dll FeedsManager FeedFolder Feed FeedItem FeedEnclosure
Je k dispozici toto: 1. Background Download component 2. Common Feed List 3. Store of feed items 4. Store of enclosures (think attachments, e.g. think podcasts) 5. RSS Object Model (more on the API in a later post) FeedEnclosure © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

77 Feed události I[X]FeedEvents Změny položek Změny vlastních feeds
I[X]Feed::GetWatcher Změny položek FeedItemCountChanged Změny vlastních feeds Smazání, přejmenování, změna URL, … Aktivity Downloading, download completed Note: notifier calls each registered handler on a different thread in order to make sure that one handler doesn’t block all the others. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

78 Události nad složkami I[X]FeedFolderEvents Nadmnožina I[X]FeedEvents
Scope All, Self_Only, Self_And_Children_Only Maska Složka či feed události Note, this can also deliver feed-level notifications (i.e. this delivers a superset of what comes out of IFeedEvents). © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

79 demo RSS Feed 4/6/2017 12:04 AM RSSSTore MICROSOFT CONFIDENTIAL
© 2006 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.

80 Zdroje Blog MSDN http://blogs.msdn.com/rssteam

81 search

82 demo Vista Search 4/6/2017 12:04 AM RSSSTore MICROSOFT CONFIDENTIAL
© 2006 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.

83 Možnosti pro vývojáře Možnost vyhledávat soubory, složky, obsah, ….
Čtení a zápis vlastností položek Nový File Dialog podporující tyto vlastnosti Přidat vyhledávání vlastních dat Přidat vlastní typ souborů a pracovat s nimi Having seen the user view on things, this slide motivates search capabilities more from a developer perspective – what does this new technology offer that enables developers to enhance their applications. Note that an application can, if it chooses, present anything as an ‘item’ – items don’t necessarily have to be files. For example, Outlook integration presents MAPI items such as s, enabling to show up in search results. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

84 Architektua … … … 3rd Party Applications Query System Indexer
Property System 3rd Party Schemas System Content Index & Property Cache Property Handlers 3rd Party Property Handlers Image Media This slide builds up all the various features of the search architecture. Introduces the Property abstraction used by search. Shows the index and property cache, and how it relates to the parts of the system that provide the underlying data and properties. IFilters 3rd Party Protocol Handlers File Protocol Handler MAPI 3rd Party File System MAPI Store Other Stores © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

85 Vyhledávání z aplikací
Jednoduchá a pokročilá syntaxe Použití Není nutné používat parsing či SQL Podpora povinných výrazů Filtrování dle libovolného řetězce či vlastnosti Konzistentní syntaxe vlastnost:hodnota napříč systémem a aplikacemi Pro parsing lze použít ISearchQueryHelper Holiday plans from:Jessica

86 Vlastnosti OLE DB provider s dialektem SQL full text
Porovnávání řetězců, čísel a datumů CONTAINS a FREETEXT Vyhledávání dle prefixu (“begins with”) Podpora logických výrazů Hit counts a stránkování Podpora ORDER BY a GROUP BY © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

87 SQL Syntaxe Shodná syntaxe pro Windows Desktop Search
SELECT System.ItemName, System.ItemUrl, System.ApplicationName FROM SystemIndex WHERE System.ApplicationName='Microsoft Office Word‘ AND System.DateCreated >=' ’ AND System.Author='Michal Neuwirth'

88 demo Vývoj pro Vista Search 4/6/2017 12:04 AM Search Vista
MICROSOFT CONFIDENTIAL © 2006 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.

89 Další možnosti Vytváření a používání známých adresářů
IKnownFolderManager Tvorba nových adresářů pro vyhledávání ISearchFolderItemFactory Použití funkcí pro práci se soubory Progres dialog pro dlouhotrvající operace IFileDialog Prvek ExplorerBrowser COM prvek pro zobrazení obsahu z Windows Exploreru IExplorerBrowser

90 Vlastní formát souborů
Vyhledávání a zpracování vlastních formátů Property Handler Čtení/zápis vlastností pro vlastní formáty IPropertyStore, IPropertyStoreCapabilities Rozšířené možnosti při zobrazní vlastních formátů IThumbnailProvider IPreviewHandler

91 demo CodePreview Handler 4/6/2017 12:04 AM MICROSOFT CONFIDENTIAL
© 2006 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.

92 Zdroje Preview handlers
Preview handlers Microsoft SharePoint Portal Server Search SQL Syntaxe

93 Mobile pc

94 Mobile PC – Power Aware Nové power plány Vývojáři se mohou Balanced
Power Saver High Performance Vývojáři se mohou Registrovat pro notifikace Zpracovávat notifikace

95 Mobile PC WM_POWERBROADCAST PBT_POWERSETTINGCHANGE
Zprávy o power management událostech PBT_POWERSETTINGCHANGE GUID_ACDC_POWER_SOURCE GUID_MONITOR_POWER_ON GUID_BATTERY_PERCENTAGE_REMAINING GUID_POWERSCHEME_PERSONALITY [Un]RegisterPowerSettingNotification [Od]Registrace ke zpracování notifikací

96 demo Mobile PC 4/6/2017 12:04 AM Vista_power_cs/lab4 PowerToTheLaptop
MICROSOFT CONFIDENTIAL © 2006 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.

97 Recovery & Restart

98 Restart API Registrace pro restartování aplikace po fatální chybě
4/6/ :04 AM Restart API Registrace pro restartování aplikace po fatální chybě Registrace je použita též pro Restart Manager Restart procesu po aplikaci patche Všechny aplikace mohou podporovat Např. při podpoře document recovery Jak na to? Registrovat command-line který bude volán při každém zavolání HRESULT RegisterApplicationRestart (IN PCWSTR pwzCommandline, DWORD dwFlags) Po fatální chybě jsou reportovány informace o chybě a restart aplikace ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

99 Recovery APIs Možnost zotavení dat po fatální chybě Jak na to?
4/6/ :04 AM Recovery APIs Možnost zotavení dat po fatální chybě Jak na to? Zaregistrovat aplikaci jako “recovery callback” při spuštění HRESULT RegisterApplicationRecoveryCallback (IN RECOVERY_ROUTINE RecoveryRoutine, IN PVOID pvParameter) Automaticky je volána rutina pro opravu dat Nutné volat ApplicationRecoveryInProgress() cca každých 5 vteřin pro informovanost, ze pořád probíha Recovery Volat ApplicationRecoveryFinished() po ukončení recovery procesu Neprovádět operace vyžadující interakci s UI....informace uložit např. na disk či zpracovávat v paměti ©2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

100 Windows Error Reporting
Systém postavený nad WinXP + Zachycuje „crash“ a „hang“ aplikací a reportuje problémy na centrální místo Reportované problémy jsou autorovi aplikace k dispozici na Vytvoření účtu a další infromace:

101 WER Process Nastane problém WER plugin zavolá odpovídající WER API
Systém obsahuje plug-ins pro crash, hang a bluescreen Lze definovat vlastní WER posílá potřebná data, vytvoří report a požádá o souhlas k odeslání WER odešle report na server pokud uživatel souhlasí Pokud jsou potřebná další data, WER je připraví a poptá se uživatele Pokud je nastaveno Restart a Recovery WER volá callback funkce v době co posílá report na server Pokud existuje na problém odpověď je uživatel informován

102 WER APIs WerAddExcludedApplication WerRemoveExcludedApplication
Vyloučení naší aplikace z WER WerRemoveExcludedApplication Přihlášení do WER procesu pokud jsme použili předchozí funkci WerReportAddDump, WeReportAddFile, ....

103 demo Restart & Recovery 4/6/2017 12:04 AM Restart
MICROSOFT CONFIDENTIAL © 2006 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.

104 USER acount control

105 User Account Control Všichni uživatelé běží jako Standard User
Vyžadováno explicitní povolení „povýšení“ práv pro některé operace Např. přístup do ovládacích panelů, instalace sw atd. Možnost spustit operaci pod vyššími právy UAC je možno zapnout/vypnout Note that many common user tasks that used to require admin rights have been redesigned to work for Standard User. This is an important point because it goes hand in hand with the fact that users run as Standard User. UI changes are required to make running as a standard user viable in practice. These changes have been made (or are being made) throughout Vista. ISVs may have to make similar changes in their own apps if these apps are to play nicely in a UAC world. Application compatibility exists to work around old apps. But this is there to make the end users’ life better – it’s not to enable application developers to be lazy… The detail for the points above is as follows: All users run as Standard User by default Filtered token created during logon Only specially marked apps get the unfiltered token Explicit consent required for elevation Predictable shell elevation paths High application compatibility Data redirection Enabling legacy apps to run as standard user Installer Detection © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

106 Jak povýšit oprávnění V rámci manifestu nastavit používání admin oprávnění <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges> <requestedExecutionLevel level="highestAvailable" />   </requestedPrivileges> </security> </trustInfo> Instalační aplikace mají „povýšená“ oprávnění Run as administrator An ‘elevated’ process is one that gets to use the full token rather than the restricted token. ‘Elevation’ is the act of launching an elevated process from a non-elevated context. (Note that you can’t elevate an existing process – a process has the same token for its whole lifetime. Elevation always involves starting a new process.) Note that by default processes run with their parent process’s token just like they always have. This means that if an elevated process launches a new process, that new process will also be elevated. If a non-elevated process launches a new process, then by default that new process will not be elevated. To be precise, the term elevation refers to when the initiating process is not elevated by the launched process becomes elevated. Elevation can occur in a number of ways, but it always requires the user to permit the elevation. (Interestingly, it is possible for elevation to occur when the running user is not in fact an administrator. In the case where the user has no privileges beyond the standard set, and therefore didn’t get a split token, elevation causes a credential prompt to appear – a system administrator can choose to allow the elevation. We’ll see more on this later.) Elevation can occur for the reasons listed above. It might be that the application contains a manifest (an embedded XML file – the same mechanism used to configure SxS stuff like the common controls DLL), and that the manifest declares the app to be an admin app. Or, the shell might guess that the application is an installer. (E.g. it’s called ‘Setup.exe’ or it uses installer APIs. Of course your app might do this and yet not require elevated privileges, in which case you should supply a manifest indicating that you don’t need admin rights.) Also, the app compatibility mechanism is able to recognize specific apps as requiring elevation. And finally, the user is allowed to explicitly elevate any program by right-clicking and choosing the Run Elevated… menu option. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

107 Oprávnění std. uživatele
Architektura Standardní oprávnění Admin oprávnění Abby Standard User Mode Admin oprávnění Admin logon Split Token Oprávnění std. uživatele Uživatelský proces Změna Časové Zóny Spouštění povolených aplikací Instalace fontů Instalace tiskáren Atd. Admin oprávnění Admin Token Admin oprávnění “Standard User” Token This is the semi-architectural view of the Abby scenario that Peter just demoed….showing how the split token is used. CLICK Abby logs in CLICK LH recognizes that Abby is an admin and issues her a “split token” giving her the standard user token to use and holding the admin token for potential authorized administrative use CLICK When Abby wants to take standard user actions like Change the Time Zone (which a standard user cannot do in WinXP), install fonts, install printers, etc…LH uses the standard user token to spin up those processes protecting the administrative context of Abby from being attacked by malicious code, spyware, etc. CLICK But when Abby tries to take an action that requires her administrative context, LH uses the admin token to spin up the processes. Enterprise policy can be used to define precisely what applications are authorized to use the admin token and as you saw in the demo Abby is notified that she is about to use her administrative context just in case a piece of malicious software is trying to take the action…allowing Abby to decline the use of her admin token CLICK Further, the admin token is specifically used for each admin process and when the process ends, the token is thrown away, putting Abby back in standard user mode for her work. Focus on the percentage of standard IW work that an admin does throughout the day that puts those admins at risk….User Account Protection is designed to protect users in the above ways. Admin oprávnění Admin Process Změna času Token Admin Process Konfigurace IIS © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Admin Process Instalace aplikace

108 UAC a aplikace Připravit a otestovat aplikace jako standardní uživatel
Identifikovat úlohy vyžadující Administrátorská oprávnění Nástroje příkazové řádky běží pod oprávněními uživatel, který je zavolá Označit „štítem“ operace vyžadující povýšení oprávnění The best elevation experience is to not have one! If you need admin operations, CLEARLY identify them Notes: The key user experience goal is to make the application work for Standard users. If an application needs to have administrative task, then the UX goal should be to clearly identify them. The process of implementing UAC User Experience starts with a review of the existing code for actions that result in Administrative intervention. Point people to the whitepaper which contains a list of API’s that are specific to the Admin. First Choice: Make application Standard user only Design your product such that it does not need administrative intervention beyond initial deployment. For command line tools bear in mind that these things will run ‘as invoker’, i.e. they’ll only be elevated if the command prompt from which they were launched is also elevated. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

109 Použití ve Windows Vista
Here are a few examples of how the shield UI is used in Vista build 5270. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

110 Implementace „štítu“ Nelze povýšit běžící proces Doporučené postupy
Vedle sebe běžící procesy Sdílená paměť RPC Administrační COM objekt pro povýšení oprávnění CoCreateAsAdmin Implementing the shield in practice. You can’t elevate a process that’s already running. A process’s token is determined when it starts, and cannot be changed. Elevation involves launching a new process. You would typically do this using the CoCreateInstanceAsAdmin API – this lets you instantiate an object that will be hosted in an elevated process. This will cause the usual elevation UI to be shown, and the API will only succeed if the user consents. Given an application that only needs elevated privileges for certain tasks, there are two implementation strategies you could use. First, you could run the entire UI in the non-elevated process, using elevation just to write the actual settings. So you would use CoCreateInstanceAsAdmin to instantiate an object that performs the underlying privileged work. One benefit of this is that it minimizes the amount of code that runs in the elevated context. Note that this requires an elevation prompt each time the object is instantiated. This isn’t necessarily a problem, as you can simply instantiate the object at the point at which the user clicks on a shielded UI item, and keep it around for as long as necessary. (Of course you should make sure that you conform to the UAC UX guidelines.) Alternatively, you could separate parts of the UI that deal with admin-required settings, and run those parts of the UI in the separate process. This would make sense for applications where everything requires elevated privileges. E.g., if a standard user wouldn’t even be able to read the relevant settings, then there is less benefit to trying to run the UI in a non-privileged process. The first strategy is arguably preferable, because even in the second scenario described above, there is still an argument that you should put as little code as possible into an elevated process – it’s bad security practice to run code with more privileges than it needs. The three patterns described on the slide are all variations on the first strategy. There might be a service running permanently that runs elevated, and that you use to perform work. Or you might launch a new process for the duration of performing elevated work and use some form of IPC to talk to it. Or you could use the COM facilities designed for this purpose. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

111 Ikonka štítu Definice pro BCM_SETSHIELD zprávu
[DllImport("user32.dll")] static extern IntPtr SendMessage(HandleRef hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam); const uint BCM_SETSHIELD = 0x ; Zavolání SendMessage pro nastavení ikony void SetShieldIcon(bool Show) { SendMessage(new HandleRef(this, this.Handle), BCM_SETSHIELD, IntPtr.Zero, new IntPtr (Show ? 1 : 0)); }

112 Starší aplikace Starší aplikace často zapisují do míst určených pro administrátory HLKM\Software, %SystemDrive%\Program Files, … Přesměrování práce s daty odstraňuje povýšení oprávnění Zápis do HKLM je přesměrován do HKCU Zápis do systémových adresářů přesměrováno do uživatelského adresáře NOTE: this is purely for legacy support – don’t be lazy and take advantage of this in new programs. This feature is not available for 64-bit code. (There is no decade+ legacy of 64-bit code because 64-bit Windows is a recent thing. And 64-bit Windows came in after the recommendation to make programs work in a non-admin context. The only reason it’s there for 32-bit apps is that there are shed loads of old 32-bit apps that don’t work properly in non-admin contexts.) © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

113 Doporučení pro vývoj MSI 3.1 pro instalaci a aktualizaci
Nevytvářet samo-aktualizační nativní kód Nepředpokládat administrátorská práva Testovat jednotlivé komponenty pod správným kontextem ClickOnce pro .NET standardní aplikace In the Home, one of the big problems for writing UAC compliant code is the updating problem. For an app to have the ability to modify the Program Files directory, it has to have admin privileges. Games especially tend to update every time you run them. We have to get a handle on this problem to make a great experience for UAC in the home. Check out both MSI and ClickOnce. MSI3.1 has the ability to handle a scenario where “if the admin installed the app, the Standard User can update the app” with no elevation. ClickOnce is a great solution for per user installs. It is UAC compliant and it updates automatically! Don’t assume that the logged on user is an Admin! © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

114 Práce s daty Per-user nastavení aplikace provádět během prvního spuštění aplikace (ne během instalace) Per-user data ukládat do %LOCALAPPDATA% Per-Machine data ukládat do %ALLUSERPROFILE% Administrační nastavení provádět během instalace Being a good Standard User application isn't rocket science, it is mostly about placing your configuration data in the right locations Per User Settings at Install - I want to spend a moment and talk about generating per-user settings during the admin install. You have to assume that the user that installs the application is different from the user that uses the application. This isn’t a new problem, but now it is really important. The problem is, if you use a different account to install the app than you use to run the app, the app has to be resilient enough to handle the missing per-user configuration settings at first run. Enterprise application deployment with SMS and Group policy and other deployment mechanism are seriously hampered by this problem today. CAS – I also want to point out here that if you design your application as a .NET application for the Internet Zone, your application is automatically a UAC compliant application. The rich CAS security model allows developers to get in control over what situations the user can use the app and therefore can limit the trouble that user can get into. The big point here is that if you design your applications for least privilege, your app won’t be the attack vector! © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

115 UAC nastavení Local Security Policy
Security Settings->Local Policies->Security Options User Account Control (9 politik)

116 demo UAC 4/6/2017 12:04 AM Restart MICROSOFT CONFIDENTIAL
© 2006 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.

117 UAC UAC Blog Aaron Margosis

118 Orcas a Windows Vista User Account Control Common File Dialogs
Všechny projekty budou mít vestavený manifest (nastaveno na AsInvoker) Zdroj System.Drawing.SystemIcons.Shield Běh Orcas pod non-admin účtem Common File Dialogs System.Windows.Forms.OpenDialog/SaveDialog budou podporovat nový vzhled a vlastnosi pod Windows Vista © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

119 Závěr Nový grafický systém AERO Nové ovládací prvky
Gadgets pro SideBar Zabudovaná podpora pro RSS Možnost rozšiřování služeb pro vyhledávání Systém pro restart a obnovu apliací Nový bezpečnostní model běhu aplikací © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

120


Stáhnout ppt "Nová Windows Vista API Mgr. Michal Neuwirth ISV Technical Readiness"

Podobné prezentace


Reklamy Google