How to set text cursor at coordinate?

D.D.K-2637 966 Reputation points
2023-01-22T23:34:18.7466667+00:00

Hi,

Let's say I have text strings as shown. how do I move cursor to the specify characters?

The boxes can be controls in an application example mfc, chrome,...

User's image

User's image

I tried using SetConsoleCursorPosition but the result always returns 0, is that the right approach?

Thanks you.

Windows development | Windows API - Win32
Developer technologies | C++
Developer technologies | C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
{count} votes

Answer accepted by question author
  1. Castorix31 91,506 Reputation points
    2023-01-23T09:33:19.6066667+00:00

    It can be done with IUIAutomation and MoveEndpointByUnit

    Test with Edit control of Notepad, position 10 :

    MoveEndpointByUnit


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.