Quantcast
Channel: Windows Desktop Development for Accessibility and Automation forum
Viewing all articles
Browse latest Browse all 585

Not getting correct caret position of textbox of webpage in chrome using wpf C#

$
0
0

I have built a wpf application to capture screens. Captured screen details are collected from System accessible object which is created from caret position using GUITHREADINFO. It is working fine in IE and firfox browser, but not getting correct caret position while capturing screen in chrome browser and hence incorrect System accessible object. Can somebody help why it is not working while capturing screen in chrome browser. I have shared code snippet here. Any help would be most appreciated. Thanks.

SystemAccessibleObject sao = null;

GUITHREADINFO guiInfo;
        Point caretPosition;
        public void GetCaretPosition()
        {
            guiInfo = new GUITHREADINFO();
            guiInfo.cbSize = (uint)Marshal.SizeOf(guiInfo);

            // Get GuiThreadInfo into guiInfo
            GetGUIThreadInfo(0, out guiInfo);
        }

caretPosition = new Point();

                        // Fetch GUITHREADINFO
                        GetCaretPosition();

                        caretPosition.X = (int)guiInfo.rcCaret.Location.X;
                        caretPosition.Y = (int)guiInfo.rcCaret.Location.Y;

ClientToScreen(guiInfo.hwndCaret, out caretPosition);

sao = SystemAccessibleObject.FromPoint(caretPosition.X, caretPosition.Y);


Viewing all articles
Browse latest Browse all 585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>