如何在 Windows 中获取文本光标位置? [英] How to get the text cursor position in Windows?
本文介绍了如何在 Windows 中获取文本光标位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用标准 Python 库获取 Windows 中的整体光标位置?
Is it possible to get the overall cursor position in Windows using the standard Python libraries?
推荐答案
win32gui.GetCursorPos(point)
这将检索光标的位置,以屏幕坐标表示 - point = (x,y)
This retrieves the cursor's position, in screen coordinates - point = (x,y)
flags, hcursor, (x,y) = win32gui.GetCursorInfo()
检索有关全局光标的信息.
Retrieves information about the global cursor.
链接:
- http://msdn.microsoft.com/en-us/library/ms648389(VS.85).aspx
- http://msdn.microsoft.com/en-us/library/ms648390(VS.85).aspx
我假设您将使用 python win32 API 绑定或 pywin32.
I am assuming that you would be using python win32 API bindings or pywin32.
这篇关于如何在 Windows 中获取文本光标位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文