C
C#8mo ago
Donut

❔ Get caret position in any window

Hello I am trying to follow the answer on the forum https://learn.microsoft.com/en-us/answers/questions/818647/how-to-get-caret-position-in-any-application-from and this is what I came up with https://pastebin.com/L6V2851M with a little help with ChatGPT ( I am not really familiar with winapi) this code runs in a WinForms application when I hit a specific key. When the function is executed it prints out "Could not get AccessibleObject from window". I don't know how to investigate what's going wrong...
How to get caret position in ANY application from C#? - Microsoft Q&A
Like Clipboard in Windows 10/11 (Win + V) - it always know current caret position on the page in Google Chrome or MS Edge, also in other applications - WPF, WinForms, UWP, etc.
I'm trying to get caret position in windows. Even if it's not native. …
Pastebin
using System;using System.Runtime.InteropServices;using System.Text...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
1 Reply
Accord
Accord8mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.