zhiyiYo / PyQt-Frameless-Window

A cross-platform frameless window based on pyqt5, support Win32, Linux and macOS.
https://pyqt-frameless-window.readthedocs.io
GNU General Public License v3.0
482 stars 67 forks source link

ValueError: Procedure called with not enough arguments #39

Closed ConyKitty closed 1 year ago

ConyKitty commented 1 year ago

When I try the domos in example folders, all of them are not aviliable for me, it occurs the same error as below:

Traceback (most recent call last):
  File "C:/Program Files/JetBrains/PyCharm Community Edition 2022.2.4/plugins/python-ce/helpers/pydev/pydevd.py", line 1496, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.2.4\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "D:\PyQt-Frameless-Window\examples\main_window.py", line 69, in <module>
    window = MainWindow()
  File "D:\PyQt-Frameless-Window\examples\main_window.py", line 13, in __init__
    super().__init__()
  File "D:\PyQt-Frameless-Window\qframelesswindow\__init__.py", line 36, in __init__
    super().__init__(parent)
  File "D:\PyQt-Frameless-Window\qframelesswindow\windows\__init__.py", line 41, in __init__
    self.windowEffect.addShadowEffect(self.winId())
  File "D:\PyQt-Frameless-Window\qframelesswindow\windows\window_effect.py", line 166, in addShadowEffect
    self.DwmExtendFrameIntoClientArea(hWnd, byref(margins))
ValueError: Procedure called with not enough arguments (8 bytes missing) or wrong calling convention
python-BaseException
zhiyiYo commented 1 year ago

没遇到过这个问题诶,或许你可以建个虚拟环境试试看🤔

ConyKitty commented 1 year ago

Python 3.9的环境运行没问题,3.6就不行😂

zhiyiYo commented 1 year ago

可能和 Python 是 32 位的有关系,试下把 qframelesswindow/windows/window_effect.py 的第 26 和 27 行改为

self.user32 = WinDLL("user32")
self.dwmapi = WinDLL("dwmapi")
ConyKitty commented 1 year ago

可能和 Python 是 32 位的有关系,试下把 qframelesswindow/windows/window_effect.py 的第 26 和 27 行改为

self.user32 = WinDLL("user32")
self.dwmapi = WinDLL("dwmapi")

完美解决,谢谢!