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 요소를 찾을 데스크톱의 실제 화면 좌표입니다.

반품

지정된 지점의 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된 경계 사각형 내에 있지만 반드시 컨트롤의 클릭 가능한 부분에 있는 것은 아닙니다. 예를 들어 경계 사각형의 모서리 중 하나 근처에서 둥근 단추를 클릭할 수 없을 수 있습니다.

적용 대상

추가 정보