Sha256: 4f69ae07d9ff172bf4bb17060688155d8635a80fbf6f878cafce3ab837d6e272

Contents?: true

Size: 1.48 KB

Versions: 1

Compression:

Stored size: 1.48 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);

  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; }
  }

protected:
	AutomationElement^ _control;

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

Version data entries

1 entries across 1 versions & 1 rubygems

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