In a winforms application, I am using the IHTMLTxtRange interface (in c#) created from the body element to wander through the text on a page and process each word i come across using the MoveStart and MoveEnd methods.This works fine.
I then need to know if the text would actually be visible to the end user - this is where i then start getting the problems.
Although i can get the dimensions/coordinates of the TextRange using the IHTMLTextRangeMetrics interface there would appear to be no quick way of determining if the text is actually visible to the user.
I have a requirement to process the text very quickly. I have tried using the select method on the IHTMLTxtRange and catching the exceptions it sometimes throws , but this is very slow.
I did try wandering up the tree of offset elements seeing if the items above be in the offset list were allowing the text to be shown, but this doesn't work when other elements not part of this path are obscuring the test (e.g. absolute positioning).
Any suggestions on how to do this would be gratefully received.
Regards
Jamie