Question

I've never written any web-browser plugins. I need to find screen or windows coordinates of particular HTML element in IE8. It's an edit box on particular page. Is it possible to do by IE8 plugin? any samples would be highly appreciated.

thanks for your time

[EDIT] what I found so far:
I can implement BHO and access HTML content of the page, I can find required edit box. But I still don't know how to get its client window coordinates

Was it helpful?

Solution 2

in addition to suggested by @Maurizio getBoundingClientRect method, I need to transform these coordinates to client coordinates using IDisplayServices (handles browser zooming), then take a window handle by IOleWindow (retrieved from IHTMLDocument2 object) and transform client coordinates to screen coordinates by ClientToScreen

OTHER TIPS

once you have the IHTMLElement interface of the edit box, QueryInterface for the IHTMLElement2 interface and then call the getBoundingClientRect Method to get the coordinates. There are other methods on the IHTMLElement2 interface that may also be of use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top