Last active
August 29, 2015 14:13
-
-
Save alexanderfloh/aa6333901d0d328645de to your computer and use it in GitHub Desktop.
Revisions
-
alexanderfloh revised this gist
Jan 15, 2015 . 1 changed file with 4 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ Imports System.Runtime.InteropServices Imports Accessibility 'add reference to "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Accessibility.dll" Public Module Main <DllImport("oleacc.dll")> _ Function AccessibleObjectFromPoint(ByVal pt As Point, <MarshalAs(UnmanagedType.Interface)> ByRef accObj As IAccessible, ByRef ChildID As Object) As IntPtr @@ -23,7 +25,7 @@ Public Module Main Dim _desktop As Desktop = Agent.Desktop Public Sub Main() Dim varChildID As Object Dim accObj As IAccessible 'The point Of the control that are interested In @@ -35,13 +37,8 @@ Public Module Main AccessibleObjectFromPoint(pt, accObj, varChildID) For i As Integer = 1 To 100 Workbench.ResultComment("Iteration " & i & ":"+accObj.accValue) Next End Sub End Module -
alexanderfloh created this gist
Jan 15, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ Imports System.Runtime.InteropServices Imports Accessibility Public Module Main <DllImport("oleacc.dll")> _ Function AccessibleObjectFromPoint(ByVal pt As Point, <MarshalAs(UnmanagedType.Interface)> ByRef accObj As IAccessible, ByRef ChildID As Object) As IntPtr End Function <System.Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential)> _ Public Structure POINT Public X As Integer Public Y As Integer Public Sub New(ByVal X As Integer, ByVal Y As Integer) Me.X = X Me.Y = Y End Sub End Structure Dim _desktop As Desktop = Agent.Desktop Public Sub Main() Dim varChildID As Object Dim accObj As IAccessible 'The point Of the control that are interested In Dim pt As POINT = New POINT(50, 196) 'Make app active System.Threading.Thread.Sleep(3000) AccessibleObjectFromPoint(pt, accObj, varChildID) For i As Integer = 1 To 100 Console.WriteLine("Iteration " & i & ":"+accObj.get_accValue(0)) 'Debug.Write(index.ToString & " ") Next 'For (int i = 0; i < 100; i++) '{ ' Console.WriteLine("Iteration "+i+":"+accObj.get_accValue(0)) '} End Sub End Module