I'm trying to control a calculator interface which based on Java Oracle. My problem is the memory leakage.
Let me explain what is happening. With 2 class,JabApi and JabHelpers, I'm making an object of AccessibleTreeItem class which is located in JabHelpers.
Then doing some operations such as click to a button on the calculator in a for loop. After that, I'm trying to release memory using MyDispose() method that use the releaseJavaObject() method is located in JabHelpers but I could not observe a decrement in memory.
I am not sure the releaseJavaObject() is working fine because after the javaTree.MyDispose() method, when try to click another button (button3) but it does not any changes on the calculator.
What is my main problem in the JabApi and JabHelpers class? I don't know may be problem is related with the releaseJavaObject() importing parameters? Could it be? May be it is related with the GetAccessibleContextInfo(Int32 vmID, IntPtr currentPtr, out AccessibleContextInfo currentContext, AccessibleTreeItem parentItem, int level, string lineage) method is located in JapHelper, I have no idea.
Please, support me. Thank you!
Main code below:
namespace JabApiCsharpSample
{
class Program
{
static void Main(string[] args)
{
//JabApi.Windows_run();
JabHelpers.Init();
int vmID = 0;
IntPtr hwnd = (IntPtr)3346002;//that is the handleWindow number given by Windows
JabHelpers.AccessibleTreeItem javaTree = null;
JabHelpers.AccessibleTreeItem button1 = null;
JabHelpers.AccessibleTreeItem button2 = null;
JabHelpers.AccessibleTreeItem button = null;
JabHelpers.AccessibleTreeItem button3 = null;
//javaTree = JabHelpers.GetComponentTreeByTitle("ELİNT", out vmID);
int index = 50;
javaTree = JabHelpers.GetComponentTree(hwnd, out vmID);
button1 = javaTree.children[0].children[1];
button2 = button1.children[1].children[2];
button = button2.children[1].children[3];
button3 = button2.children[1].children[4];
JabHelpers.DoAccessibleActions(vmID, button3.acPtr, "click");
for (int i = 0; i < index; i++)
{
JabHelpers.DoAccessibleActions(vmID, button.acPtr, "click");
}
javaTree.MyDispose(javaTree, vmID);
JabHelpers.DoAccessibleActions(vmID, button3.acPtr, "click");
}
}
}
Here is a part of JabHelper class:
public static AccessibleTreeItem GetComponentTreeByTitle(String title, out Int32 vmID)
{
IntPtr hwnd = FindWindowByCaption(IntPtr.Zero, title);
return GetComponentTree(hwnd, out vmID);
}
public static AccessibleTreeItem GetComponentTree(IntPtr hWnd, out Int32 vmID)
{
screenContents.Clear();
screenContentsString = string.Empty;
AccessibleTreeItem accessibleTreeItem = new AccessibleTreeItem();
vmID = 0;
if (JabApi.isJavaWindow(hWnd) == 1)
{
unsafe
{
IntPtr acPtr;
if (JabApi.getAccessibleContextFromHWND(hWnd, out vmID, out acPtr))
{
AccessibleContextInfo ac = new AccessibleContextInfo();
accessibleTreeItem = GetAccessibleContextInfo(vmID, acPtr, out ac, null, 0, string.Empty); // RECURSION SEED
return accessibleTreeItem;
}
}
}
return null;
}
private static AccessibleTreeItem GetAccessibleContextInfo(Int32 vmID, IntPtr currentPtr, out AccessibleContextInfo currentContext, AccessibleTreeItem parentItem, int level, string lineage)
{
unsafe
{
// Allocate global memory space for the size of AccessibleContextInfo and store the address in acPtr
IntPtr acPtr = Marshal.AllocHGlobal(Marshal.SizeOf(new AccessibleContextInfo()));
try
{
Marshal.StructureToPtr(new AccessibleContextInfo(), acPtr, true);
if (JabApi.getAccessibleContextInfo(vmID, currentPtr, acPtr))
{
currentContext = (AccessibleContextInfo)Marshal.PtrToStructure(acPtr, typeof(AccessibleContextInfo));
if (!ReferenceEquals(currentContext, null))
{
AccessibleTreeItem newItem = BuildAccessibleTree(currentPtr, currentContext, parentItem);
if (!ReferenceEquals(newItem, null))
{
//Checks to see if current object has any text items.
if (currentContext.accessibleText == true)
{
AccessibleTextItemsInfo textItem;
//Gets text items.
textItem = GetAccessibleTextInfo(vmID, currentPtr);
newItem.textValue = textItem.sentence;
string treeInfo = Repeat("\t", level) + currentContext.name + " = \"" + textItem.sentence + "\"";
screenContentsString += treeInfo + Environment.NewLine;
Debug.Print(treeInfo);
}
else
{
string treeInfo = Repeat("\t", level) + currentContext.name;
screenContentsString += treeInfo + Environment.NewLine;
Debug.Print(treeInfo);
}
//Start collecting children
int nextLevel = level + 1;
for (int i = 0; i < currentContext.childrenCount; i++)
{
string lineageInfo = Repeat("\t", level) + level.ToString() + " Child " + i.ToString() + " Lineage = {" + lineage + "}";
screenContentsString += lineageInfo + Environment.NewLine;
Debug.Print(lineageInfo);
string currentlineage;
if (lineage == string.Empty)
currentlineage = i.ToString();
else
currentlineage = lineage + ", " + i.ToString();
if (currentContext.role_en_US != "unknown" && currentContext.states_en_US.Contains("visible")) // Note the optomization here, I found this get me to an acceptable speed
{
AccessibleContextInfo childContext = new AccessibleContextInfo();
IntPtr childPtr = JabApi.getAccessibleChildFromContext(vmID, currentPtr, i);
GetAccessibleContextInfo(vmID, childPtr, out childContext, newItem, nextLevel, currentlineage);
}
}
}
return newItem;
}
}
else
{
currentContext = new AccessibleContextInfo();
}
}
finally
{
if (acPtr != IntPtr.Zero)
Marshal.FreeHGlobal(acPtr);
}
}
return null;
}
public void MyDispose(AccessibleTreeItem parent, int vmID)
{
if (parent.children.Count == 0)
{
JabApi.releaseJavaObject(vmID, parent.acPtr);
}
else
{
for (int i = 0; i < parent.childrenCount; i++)
{
parent.children[i].MyDispose(parent.children[i], vmID);
}
JabApi.releaseJavaObject(vmID, parent.acPtr);
}
}
Here is a part of JabApi code :
You can see the releaseJavaObject() metod is imported in there.
public static class JabApi
{
public const String WinAccessBridgeDll = @"WindowsAccessBridge-64.dll";
public const Int32 MAX_STRING_SIZE = 1024;
public const Int32 SHORT_STRING_SIZE = 256;
#region Event Handlers
#region EventDLLImport
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setMouseClickedFP(MouseClickedDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setMouseEnteredFP(MouseEnteredDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setMouseExitedFP(MouseExitedDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setMousePressedFP(MousePressedDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setMouseReleasedFP(MouseReleasedDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setFocusGainedFP(FocusGainedDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setFocusLostFP(FocusLostDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setCaretUpdateFP(CaretUpdateDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setJavaShutdownFP(JavaShutDownDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setMenuCanceledFP(MenuCanceledDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setMenuDeselectedFP(MenuDeselectedDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setMenuSelectedFP(MenuSelectedDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPopupMenuCanceledFP(PopupMenuCanceledDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPopupMenuWillBecomeInvisibleFP(PopupMenuWillBecomeInvisibleDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPopupMenuWillBecomeVisibleFP(PopupMenuWillBecomeVisibleDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPropertyActiveDescendentChangeFP(PropertyActiveDescendentChangeDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPropertyCaretChangeFP(PropertyCaretChangeDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPropertyChangeFP(PropertyChangeDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPropertyChildChangeFP(PropertyChildChangeDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPropertyDescriptionChangeFP(PropertyDescriptionChangeDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPropertyNameChangeFP(PropertyNameChangeDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPropertySelectionChangeFP(PropertySelectionChangeDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPropertyStateChangeFP(PropertyStateChangeDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPropertyTableModelChangeFP(PropertyTableModelChangeDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPropertyTextChangeFP(PropertyTextChangeDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPropertyValueChangeFP(PropertyValueChangeDelegate fp);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setPropertyVisibleDataChangeFP(PropertyVisibleDataChangeDelegate fp);
#endregion EventDLLImport
#region Event Delegates
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PropertyChangeDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac,
[MarshalAs(UnmanagedType.LPWStr)] string property, [MarshalAs(UnmanagedType.LPWStr)] string oldValue, [MarshalAs(UnmanagedType.LPWStr)] string newValue);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void JavaShutDownDelegate(System.Int32 vmID);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void FocusGainedDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void FocusLostDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void CaretUpdateDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void MouseClickedDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void MouseEnteredDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void MouseExitedDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void MousePressedDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void MouseReleasedDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void MenuCanceledDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void MenuDeselectedDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void MenuSelectedDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PopupMenuCanceledDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PopupMenuWillBecomeInvisibleDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PopupMenuWillBecomeVisibleDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PropertyNameChangeDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac,
[MarshalAs(UnmanagedType.LPWStr)] string oldName, [MarshalAs(UnmanagedType.LPWStr)] string newName);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PropertyDescriptionChangeDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac,
[MarshalAs(UnmanagedType.LPWStr)] string oldDescription, [MarshalAs(UnmanagedType.LPWStr)] string newDescription);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PropertyStateChangeDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac,
[MarshalAs(UnmanagedType.LPWStr)] string oldState, [MarshalAs(UnmanagedType.LPWStr)] string newState);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PropertyValueChangeDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac,
[MarshalAs(UnmanagedType.LPWStr)] string oldValue, [MarshalAs(UnmanagedType.LPWStr)] string newValue);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PropertySelectionChangeDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PropertyTextChangeDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PropertyCaretChangeDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac,
Int32 oldPosition, Int32 newPosition);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PropertyVisibleDataChangeDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PropertyChildChangeDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac,
IntPtr oldChild, IntPtr newChild);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PropertyActiveDescendentChangeDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac,
IntPtr oldActiveDescendent, IntPtr newActiveDescendent);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void PropertyTableModelChangeDelegate(System.Int32 vmID, IntPtr jevent, IntPtr ac,
IntPtr oldValue, IntPtr newValue);
#endregion Event Delegates
#endregion DLLImport - Functions
//Inits the JAB.
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void Windows_run();
//Checks if window is JavaWindow.
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe Int32 isJavaWindow(IntPtr hwnd);
//Releases the specified java object.
//[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
[DllImport(WinAccessBridgeDll, EntryPoint = "releaseJavaObject", CallingConvention = CallingConvention.Cdecl)]
public extern static void releaseJavaObject(Int32 vmID, IntPtr javaObject);
//Sets the text of the given accessible context.
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void setTextContents(Int32 vmID, IntPtr ac, [MarshalAs(UnmanagedType.LPWStr)] string text);
//Gets basic version info about JVM/JAB
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static void getVersionInfo(Int32 vmID, IntPtr versionInfo);
//Gets the next java window, where the hwnd passed is the previous window.
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe IntPtr getNextJavaWindow(IntPtr hwnd);
//Returns ac from window handle.
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe Boolean getAccessibleContextFromHWND(IntPtr hwnd, out Int32 vmID, out IntPtr ac);
//Returns handle from ac
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe IntPtr getHWNDFromAccessibleContext(Int32 vmID, IntPtr ac);
//Compares two objects
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe Boolean isSameObject(Int32 vmID, IntPtr ac1, IntPtr ac2);
//Returns an AccessibleContext object that represents the point given, offset by window coordinates.
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe Boolean getAccessibleContextAt(Int32 vmID, IntPtr acparent, Int32 x, Int32 y, out IntPtr ac);
//Returns an AccessibleContext object that represents the nth child of the object ac, where n is specified by the value index.
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe IntPtr getAccessibleChildFromContext(Int32 vmID, IntPtr ac, Int32 index);
//Returns an AccessibleContext object that represents the window with focus.
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe Boolean getAccessibleContextWithFocus(void* window, out Int32 vmID, out IntPtr ac);
//Returns an AccessibleContext object that represents the parent of the specified object.
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe IntPtr getAccessibleParentFromContext(Int32 vmID, IntPtr ac);
//Returns detailed information about an AccessibleContext object belonging to the JVM
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe Boolean getAccessibleContextInfo(Int32 vmID, IntPtr accessibleContext, IntPtr acInfo);
//**ACCESSIBLE TEXT FUNCTIONS
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe Boolean getAccessibleTextInfo(Int32 vmID, IntPtr AccessibleContext, IntPtr textInfo, Int32 x, Int32 y);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe Boolean getAccessibleTextItems(Int32 vmID, IntPtr AccessibleContext, IntPtr textItems, Int32 index);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe Boolean getAccessibleTextAttributes(Int32 vmID, IntPtr AccessibleContext, Int32 index, IntPtr attributes);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static unsafe Boolean GetAccessibleTextSelectionInfo(Int32 vmID, IntPtr AccessibleContext, Int32 index, IntPtr textSelection);
//
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static Boolean getAccessibleActions(Int32 vmID, IntPtr AccessibleContext, IntPtr ptrAccessibleActions);
[DllImport(WinAccessBridgeDll, SetLastError = true, ThrowOnUnmappableChar = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
public extern static Boolean doAccessibleActions(Int32 vmID, IntPtr AccessibleContext, IntPtr actionsToDo, ref Int32 failure);
}
}