Finding an element with hit test (cross hair) is not the same as finding it with search (using MSAA/UIA hierarchy). The generated search properties are probably bad. Get the cell with the cross hair, add it to the UIMap then in the UIMap editor check if it can find all of the cell's parents/ancestors then start fiddling with the cell's search properties. Modify, save and search for the cell (Locate the UI Control
). Repeat until it works.
As for the code: no. No no no. What that snippet does is try to find a cell element under your desktop. It won't work unless you set the hierarchy. Setting a UI element in the constructor will set it the control's "search limit container" or parent. Something like
var myWindow = new WpfWindow();
var myTable = new WpfTable(myWindow);
var myCell = new WpfCell(myTable);