pywin32如何使用PyCwnd.HookMessage

2024-10-01 22:34:24 发布

您现在位置:Python中文网/ 问答频道 /正文

hwnd = win32gui.FindWindowEx(None, None, "TXGuiFoundation", None)

我想挂起一个窗口并接收它的消息。
得到了hwnd variabletype(hwnd)是int),但是如何将它转换成PyCwnd并使用PyCwnd.HookMessage


Tags: none消息typevariableintwin32guihwndfindwindowex
1条回答
网友
1楼 · 发布于 2024-10-01 22:34:24

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

相关问题 更多 >

    热门问题