MSAA in C#

  • Thread starter Bartek Tatkowski
  • Start date
B

Bartek Tatkowski

Hi!

I'm currently developing an application that tries to emulate the
functionality of AccExplorer, that is, get the IAccessible object of the
control currently under the mouse pointer. I've made some progress and am
able to get the IAccessible objects of certain controls (windowbar,
scrollbars, icons on the desktop, icons in the taskbar etc) while others
return a wierd, undocumented error number (-2147417843). The objects that
are returning the error number are buttons, buttons in containers,
textfields and more.

Here is my code:

public static bool ControlAtPoint(Point point)
{
IAccessible acc = null;
object childID;

int error = AccessibleObjectFromPoint(point, out acc, out
childID);
Debug.WriteLine("checking at: " + point.ToString());
Debug.WriteLine("acc: " + error);

if (acc != null)
{
int left, top, width, height;
acc.accLocation(out left, out top, out width, out height,
childID);
Debug.WriteLine("object@" + left + "," + top + ":" + (left +
width) + "," + (top + height));
Debug.WriteLine("object name: " + acc.get_accName(childID));
return true;
}

return false;
}

Any takers on what the error might be?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top