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);