AutomationElement.FromPoint(Point) 메서드

정의

바탕 화면의 지정된 지점에서 UI(사용자 인터페이스) 항목에 대한 새 AutomationElement 개체를 검색합니다.

public:
 static System::Windows::Automation::AutomationElement ^ FromPoint(System::Windows::Point pt);
public static System.Windows.Automation.AutomationElement FromPoint (System.Windows.Point pt);
static member FromPoint : System.Windows.Point -> System.Windows.Automation.AutomationElement
Public Shared Function FromPoint (pt As Point) As AutomationElement

매개 변수

pt
Point

UI 요소를 찾을 데스크톱의 실제 화면 좌표입니다.

반환

AutomationElement

지정된 지점의 UI 항목입니다.

예제

다음 예제에서는 검색 된 AutomationElement 시스템 커서 위치입니다.

private AutomationElement ElementFromCursor()
{
    // Convert mouse position from System.Drawing.Point to System.Windows.Point.
    System.Windows.Point point = new System.Windows.Point(Cursor.Position.X, Cursor.Position.Y);
    AutomationElement element = AutomationElement.FromPoint(point);
    return element;
}
Private Function ElementFromCursor() As AutomationElement
    ' Convert mouse position from System.Drawing.Point to System.Windows.Point.
    Dim cursorPoint As System.Windows.Point = New System.Windows.Point( _
        System.Windows.Forms.Cursor.Position.X, System.Windows.Forms.Cursor.Position.Y)
    Return AutomationElement.FromPoint(cursorPoint)
End Function

설명

FromPoint 루트 요소에 가장 가까운 논리 트리에서 요소를 반환 합니다.

클라이언트 애플리케이션이 자체 사용자 인터페이스에서 요소를 찾으려고 할 수 있는 경우 별도의 스레드에서 모든 UI 자동화 호출을 수행해야 합니다.

반환 된 경계 사각형 내의 지점 되어도 AutomationElement, 반드시 컨트롤의 클릭 가능한 부분입니다. 예를 들어 원형 단추 경계 사각형의 모서리 중 하나를 클릭할 수 있습니다.

적용 대상

추가 정보