Compartilhar via


Implementing the UI Automation Window Control Pattern

Observação

Esta documentação destina.Os desenvolvedores do NET Framework que desejam usar o gerenciado UI Automation classes definidas na System.Windows.Automation namespace.As informações mais recentes sobre UI Automation, consulte API de automação do Windows: Automação da interface do usuário.

This topic introduces guidelines and conventions for implementing IWindowProvider, including information about WindowPattern properties, methods, and events. Links to additional references are listed at the end of the topic.

The WindowPattern control pattern is used to support controls that provide fundamental window-based functionality within a traditional graphical user interface (GUI). Examples of controls that must implement this control pattern include top-level application windows, multiple-document interface (MDI) child windows, resizable split pane controls, modal dialogs and balloon help windows.

Este tópico contém as seguintes seções.

  • Implementation Guidelines and Conventions
  • Required Members for IWindowProvider
  • Exceptions
  • Tópicos relacionados

Implementation Guidelines and Conventions

When implementing the Window control pattern, note the following guidelines and conventions:

  • To support the ability to modify both window size and screen position using UI Automation, a control must implement ITransformProvider in addition to IWindowProvider.

  • Controls that contain title bars and title bar elements that enable the control to be moved, resized, maximized, minimized, or closed are typically required to implement IWindowProvider.

  • Controls such as tooltip pop-ups and combo box or menu drop-downs do not typically implement IWindowProvider.

  • Balloon help windows are differentiated from basic tooltip pop-ups by the provision of a window-like Close button.

  • Full-screen mode is not supported by IWindowProvider as it is feature-specific to an application and is not typical window behavior.

Required Members for IWindowProvider

The following properties, methods, and events are required for the IWindowProvider interface.

Required member

Member type

Notes

InteractionState

Property

None

IsModal

Property

None

IsTopmost

Property

None

Maximizable

Property

None

Minimizable

Property

None

VisualState

Property

None

Close

Method

None

SetVisualState

Method

None

WaitForInputIdle

Method

None

WindowClosedEvent

Event

None

WindowOpenedEvent

Event

None

WindowInteractionState

Event

Is not guaranteed to be ReadyForUserInteraction

Exceptions

Providers must throw the following exceptions.

Exception type

Condition

InvalidOperationException

SetVisualState

  • When a control does not support a requested behavior.

ArgumentOutOfRangeException

WaitForInputIdle

  • When the parameter is not a valid number.

Consulte também

Tarefas

Support Control Patterns in a UI Automation Provider

Use Caching in UI Automation

Conceitos

Visão Geral de Padrões de Controle de Automação de Interface de Usuário

Padrões de Controle para Clientes de Automação de IU

Visão geral da árvore de automação de interface do usuário