PyQt/嵌入外部窗口/README.md
2018-04-14 21:40:57 +08:00

11 lines
No EOL
515 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 内嵌外部窗口
### 原理思路:
- 1.使用SetParent函数设置外部窗口的parent为Qt的窗口
- 2.Qt使用QWidget.createWindowContainer(QWindow.fromWinId(窗口ID))生成QWidget
- 3.使用GetWindowLong得到原来窗口的样式属性style = win32gui.GetWindowLong(hwnd, win32con.GWL_STYLE)和exstyle = win32gui.GetWindowLong(hwnd, win32con.GWL_EXSTYLE)
- 4.这里还原窗口后不会显示用spy++发现没有了WS_VISIBLE样式未解决
截图
![1](ScreenShot/1.gif)