2024-10-01 22:34:24 发布
网友
hwnd = win32gui.FindWindowEx(None, None, "TXGuiFoundation", None)
我想挂起一个窗口并接收它的消息。 得到了hwnd variable(type(hwnd)是int),但是如何将它转换成PyCwnd并使用PyCwnd.HookMessage
hwnd variable
type(hwnd)
PyCwnd
PyCwnd.HookMessage
PyCwnd是一个基本窗口类。封装^{}类
因此,您可以参考CWnd::FromHandle:
Returns a pointer to a CWnd object when given a handle to a window. If a CWnd object is not attached to the handle, a temporary CWnd object is created and attached.
您还可以使用win32ui.CreateWindowFromHandle,您可以参考this thread
win32ui.CreateWindowFromHandle
PyCwnd
是一个基本窗口类。封装^{因此,您可以参考CWnd::FromHandle:
您还可以使用
win32ui.CreateWindowFromHandle
,您可以参考this thread相关问题 更多 >
编程相关推荐