python 通过句柄获取窗口内容
-- enoding:utf-8 --
生成 buffer 对象
import win32con from win32gui import PyMakeBuffer, SendMessage, PyGetBufferAddressAndLen, PyGetString
length = 10000
hWnd=68214
hWnd=68302
buf = PyMakeBuffer(length) length2 = SendMessage(hWnd, win32con.WM_GETTEXT, length, buf)+1 print(length2) buf = PyMakeBuffer(length2) print(get: , SendMessage(hWnd, win32con.WM_GETTEXT, length2, buf))
address, length = PyGetBufferAddressAndLen(buf) text = PyGetString(address, length)
print(text: , text)
-- enoding:utf-8 -- 生成 buffer 对象 import win32con from win32gui import PyMakeBuffer, SendMessage, PyGetBufferAddressAndLen, PyGetString length = 10000 hWnd=68214 hWnd=68302 buf = PyMakeBuffer(length) length2 = SendMessage(hWnd, win32con.WM_GETTEXT, length, buf)+1 print(length2) buf = PyMakeBuffer(length2) print(get: , SendMessage(hWnd, win32con.WM_GETTEXT, length2, buf)) address, length = PyGetBufferAddressAndLen(buf) text = PyGetString(address, length) print(text: , text)上一篇:
JS实现多线程数据分片下载
下一篇:
适用于大中型银行的云原生技术体系建设方案