Skip to content
Advertisement

How to get the text cursor position in Windows?

Is it possible to get the overall cursor position in Windows using the standard Python libraries?

Advertisement

Answer

win32gui.GetCursorPos(point)

This retrieves the cursor’s position, in screen coordinates – point = (x,y)

flags, hcursor, (x,y) = win32gui.GetCursorInfo()

Retrieves information about the global cursor.

Links:

I am assuming that you would be using python win32 API bindings or pywin32.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement