欢迎来到麦多课文档分享! | 帮助中心 海量文档,免费浏览,给你所需,享你所想!
麦多课文档分享
全部分类
  • 标准规范>
  • 教学课件>
  • 考试资料>
  • 办公文档>
  • 学术论文>
  • 行业资料>
  • 易语言源码>
  • ImageVerifierCode 换一换
    首页 麦多课文档分享 > 资源分类 > PPT文档下载
    分享到微信 分享到微博 分享到QQ空间

    The New COM API for Accessibility and Automation in .ppt

    • 资源ID:373309       资源大小:443.72KB        全文页数:35页
    • 资源格式: PPT        下载积分:2000积分
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    二维码
    微信扫一扫登录
    下载资源需要2000积分(如需开发票,请勿充值!)
    邮箱/手机:
    温馨提示:
    如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如需开发票,请勿充值!如填写123,账号就是123,密码也是123。
    支付方式: 支付宝扫码支付    微信扫码支付   
    验证码:   换一换

    加入VIP,交流精品资源
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    The New COM API for Accessibility and Automation in .ppt

    1、The New COM API for Accessibility and Automation in Windows 7, Michael BernsteinPrincipal Software Design EngineerMicrosoft Corporation,Programmatic UI Access: A Key Element of Accessibility,Enables developers to write code that: Navigates between UI elements Gathers information about the UI Interac

    2、ts with UI elements Receives notifications when the UI changes,2,UI Automation (UIA): Programmatic Access in Windows,Successor to Microsoft Active Accessibility (MSAA) Creates a universal object model for accessing UI Designed based on experience with MSAA usage Supported on Windows Vista, XP and Se

    3、rver 2003 UIA COM Client API introduced in Windows 7,3,UI Automation Core,MSAA,UIA Managed Client API,UIA Provider API,UIA COM Client API,Whats new in Windows 7?,UIA Clients can now use COM instead of managed code New Accessibility properties are available Native clients can register custom proxies

    4、to make existing UI more accessible Developers can define custom Accessibility properties and events beyond the official UIA list,Inspecting UIA Properties,demo,Context: Clients and Providers,Client-side API (C# or C+),Client,Provider,UIA Infrastructure,UIA,Provider-side interface definitions (C# or

    5、 C+),Test Automation and Assistive Technology Manufacturers,Application and Control Developers,Taking advantage of the new COM Client API,Client,Provider,UIA,SAMPLE: Querying a windows password status,CComPtr spAutomation; CComPtr spElement; HRESULT hr; hr = spAutomation.CoCreateInstance(CLSID_CUIAu

    6、tomation); if (SUCCEEDED(hr) hr = spAutomation-GetFocusedElement( ,Automation Elements,Just as in the managed API, an automation element represents a piece of UI, regardless of underlying implementation First, create an instance of CUIAutomation, the factory for the object model Next, get an element

    7、: From an HWND: ElementFromHandle From a Point: ElementFromPoint From current focus: GetFocusedElement Each method returns an IUIAutomationElement,Basic Properties,IUIAutomationElement exposes properties that make sense for elements in general Properties are exposed in COM manner and are consistent

    8、across all underlying UI,Three Key Properties,NameProperty String that a user would use to explain which control was being referred to (Customer: Accessibility Tools) ControlTypeProperty Primary identifier for what type of control the automation element represents. (Customers: Both) AutomationIdProp

    9、erty String that uniquely identifies an element among its siblings in the tree (Customer: Test Automation),Control Patterns,Control Patterns allow access to a controls particular abilities InvokePattern: Push Me TransformPattern: Move Me ScrollPattern: Scroll Me SelectionItemPattern: Select Me Patte

    10、rns can contain properties, methods and events,Find Requests,Find requests allow you to locate elements based on conditions Conditions are based on property matching They can include Boolean operators as well Requests can be restricted by scope Find can return the first match or all matches Faster a

    11、lternative to manual searching,Visiting the Relatives: TreeWalker,All UIA elements are organized into a tree TreeWalkers allow navigation around the tree GetParentElement, GetFirstChildElement, GetNextSiblingElement, etc. Can filter by condition,A sample control tree:,Consuming Events,Enable clients

    12、 to be notified when changes occur in the UI Client implements a listener interface Register your listener with CUIAutomation Clients can scope what parts of automation tree to listen for events on Applicable events are always associated with a reference to automation element where change occurredht

    13、tp:/ your access: CacheRequests,Revisiting DumpUIATree,sample,New properties and patterns,Client,Provider,UIA,Patterns for Control Virtualization,Allows controls to have more children than are exposed in Automation tree at one time Parent container permits searching for children by property Children

    14、 can be de-virtualized upon request Useful for: Containers with massive numbers of children,Other new properties and patterns,Building great UIA Providers,Client,Provider,UIA,When do you need a provider?,You dont always need to write a provider. Customizing beyond your framework Changing perceived p

    15、roperties Annotation API may be sufficient Adding new abilities Full custom controls Creating new frameworks Silverlight had to implement Accessibility,Implementing the simple interface,Create a COM object that implements IRawElementProviderSimple Retrieve VARIANT properties Implement the most impor

    16、tant ones for your control, especially Name and ControlType Retrieve a pattern implementation Connect your COM object to the outside world through WM_GETOBJECT,Implementing patterns,Control patterns are much like interfaces Can reside on same object or different object from Simple interface Implemen

    17、t patterns that reflect your controls abilities,A basic custom-control UIA provider,sample,http:/ Simple Elements,Representing children Free support for mirroring HWND tree When you have non-window children Implement Fragment for all nodes in your tree Implement FragmentRoot for the root of your tre

    18、e Firing Events If a user would notice a change in your control, you need to fire an event You may check for listeners first,Custom patterns and properties,Allows client and provider to exchange data beyond original Accessibility design Custom work must be done on both sides Properties and events: b

    19、usiness as usual Methods: extra marshalling work required,Client,Provider,UIA,Custom data,Custom data,Custom proxy support,Enables a client to register a substitute provider for a UI that lacks a real provider Proxy implements UIA interfaces on behalf of UI Useful for legacy code that cannot be modi

    20、fied but must be made accessible,Client,Provider,UIA,Custom Proxy,Non-UIA channel,Wrapping it up,Is this all of Accessibility?,Is your software usable with Programmatic access? Keyboard-only access? High contrast / high DPI? Slow reaction times? Accessibility is not a yes/no question: it is usabilit

    21、y for a specific audience http:/ about managed clients?,The new COM API was designed with .NET interoperability in mind Pro: Fastest performance for programmatic access Con: Imported COM interfaces are not identical with older interfaces Con: Some Win32 controls have slight behavior differences,UI A

    22、utomation Core,UIA Managed Client API,UIA Provider API,UIA COM Client API,Your Client Code; TlbImport Wrapper,Managed client option #2: Use the existing managed library,We continue to support the existing System.Windows.Automation namespace Pro: No change to existing code Con: May be slower when acc

    23、essing MSAA applications Con: Cannot access new properties and patterns with current version,UI Automation Core,UIA Managed Client API,UIA Provider API,UIA COM Client API,Your Client Code,Call to Action,Use the new UI Automation Client API to interact with existing user interfaces Create UI Automati

    24、on providers for new custom controls and UI frameworks Consider the Accessibility needs of your customers when designing applications, 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in t

    25、he 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.,


    注意事项

    本文(The New COM API for Accessibility and Automation in .ppt)为本站会员(towelfact221)主动上传,麦多课文档分享仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文档分享(点击联系客服),我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1 

    收起
    展开