ext/UiaDll/UiaDll/PatternInformationStructures.h in uia-0.0.6.1 vs ext/UiaDll/UiaDll/PatternInformationStructures.h in uia-0.0.7
- old
+ new
@@ -1,10 +1,12 @@
#pragma once
#include "StringHelper.h"
#include "ElementStructures.h"
+using namespace System;
+using namespace System::Linq;
using namespace System::Windows::Automation;
typedef struct _ValuePatternInformation {
bool IsReadOnly;
char* Value;
@@ -85,6 +87,80 @@
}
~_ExpandCollapseInfo() {
delete[] ExpandCollapseState;
}
-} ExpandCollapseInfo, *ExpandCollapseInfoPtr;
+} ExpandCollapseInfo, *ExpandCollapseInfoPtr;
+
+typedef struct _WindowInformation {
+ char* VisualState;
+ char* InteractionState;
+ bool CanMinimize;
+ bool CanMaximize;
+ bool IsModal;
+ bool IsTopmost;
+
+ _WindowInformation(WindowVisualState visualState, WindowInteractionState interactionState) {
+ init(visualState, interactionState);
+ }
+
+ _WindowInformation(WindowPattern::WindowPatternInformation^ windowInformation) {
+ init(windowInformation->WindowVisualState, windowInformation->WindowInteractionState);
+ CanMinimize = windowInformation->CanMinimize;
+ CanMaximize = windowInformation->CanMaximize;
+ IsModal = windowInformation->IsModal;
+ IsTopmost = windowInformation->IsTopmost;
+ }
+
+ ~_WindowInformation() {
+ delete[] VisualState;
+ delete[] InteractionState;
+ }
+
+private:
+ void init(WindowVisualState visualState, WindowInteractionState interactionState) {
+ VisualState = StringHelper::ToUnmanaged(visualState.ToString());
+ InteractionState = StringHelper::ToUnmanaged(interactionState.ToString());
+ }
+
+} WindowInformation, *WindowInformationPtr;
+
+typedef struct _TableInformation {
+ int RowCount;
+ int ColumnCount;
+ ElementsPtr Headers;
+
+ _TableInformation(int rowCount, int columnCount, ...array<Element^> ^headers) {
+ init(rowCount, columnCount, headers);
+ }
+
+ _TableInformation(TablePattern::TablePatternInformation^ tableInfo) {
+ auto headers = tableInfo->GetColumnHeaders();
+ auto toElementFunc = gcnew Func<AutomationElement^, Element^>(Element::From);
+
+ init(tableInfo->RowCount, tableInfo->ColumnCount, Enumerable::ToArray(Enumerable::Select<AutomationElement^, Element^>(headers, toElementFunc)));
+ }
+
+ ~_TableInformation() {
+ delete Headers;
+ }
+
+private:
+ void init(int rowCount, int columnCount, ...array<Element^> ^headers) {
+ RowCount = rowCount;
+ ColumnCount = columnCount;
+
+ Headers = new Elements(headers);
+ }
+
+} TableInformation, *TableInformationPtr;
+
+typedef struct _TableItemInformation {
+ int Column;
+ int Row;
+
+ _TableItemInformation(TableItemPattern::TableItemPatternInformation^ tableItemInfo) {
+ Column = tableItemInfo->Column;
+ Row = tableItemInfo->Row;
+ }
+
+} TableItemInformation, *TableItemInformationPtr;
\ No newline at end of file