Sha256: b034711960c5b82d86ee623b021736a03794bd41d268a8ab1401177cf28a417c

Contents?: true

Size: 1.78 KB

Versions: 1

Compression:

Stored size: 1.78 KB

Contents

#pragma once

using namespace System::Windows::Automation;
using namespace System::Windows;
using namespace System::Diagnostics;

ref class AutomationControl
{
public:
	AutomationControl(const HWND windowHandle);
  AutomationControl(const FindInformation& findInformation);
  AutomationControl(AutomationElement^ automationElement);

  property AutomationElement^ Element {
    AutomationElement^ get() { return _control; }
  }

	property String^ Name {
		String^ get() { return _control->Current.Name; }
	}

	property String^ ClassName {
		String^ get() { return _control->Current.ClassName; }
	}

  property bool IsEnabled {
    bool get() { return _control->Current.IsEnabled; }
  }

  property bool IsFocused {
    bool get() { return _control->Current.HasKeyboardFocus; }
  }

  property Rect BoundingRectangle {
    Rect get() { return _control->Current.BoundingRectangle; }
  }

  property System::Windows::Automation::ControlType^ ControlType {
    System::Windows::Automation::ControlType^ get() { return _control->Current.ControlType; }
  }

  property int ProcessId {
    int get() { return _control->Current.ProcessId; }
  }

	property String^ Value {
		String^ get();
		void set(String^ value);
	}

  property bool Exists {
	  bool get() { return nullptr != _control; }
  }

  property bool IsValuePattern {
    bool get();
  }

protected:
	AutomationElement^ _control;

protected:
	property ValuePattern^ AsValuePattern {
		ValuePattern^ get() {
			return dynamic_cast<ValuePattern^>(_control->GetCurrentPattern(ValuePattern::Pattern));
		}
	}

	property SelectionPattern^ AsSelectionPattern {
		SelectionPattern^ get() {
			return dynamic_cast<SelectionPattern^>(_control->GetCurrentPattern(SelectionPattern::Pattern));
		}
	}
};

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rautomation-0.10.0 ext/UiaDll/UiaDll/AutomationControl.h