def qwidget_winid_to_hwnd(winid):
"""
Convert the winid for a QWidget to an HWND.
:param int winid: The QWidget winid to convert.
:returns: Window handle
"""
# Setup arguments and return types.
ctypes.pythonapi.PyCObject_AsVoidPtr.restype = ctypes.c_void_p
ctypes.pythonapi.PyCObject_AsVoidPtr.argtypes = [ctypes.py_object]
# Convert PyCObject to a void pointer.
hwnd = ctypes.pythonapi.PyCObject_AsVoidPtr(winid)
return hwnd
评论列表
文章目录