problem when i tried to choose game windows (scrcpy)
Opened this issue · 7 comments
Did you activate the game window after "请手动切换到游戏窗口,然后按下F10键,程序将自动获取窗口句柄" is displayed and press f10? If this error still occurs, it may be that the program cannot operate the window because of a permission problem, try to run the .bat as an administrator (It's just a guess, I'm sorry that there is no output in my program to manipulate the essential reason for the failure of the game window, which caused some difficulties for troubleshooting)
I updated the source code, now you should be able to view the specific error message when the operation window fails
Here the error
Traceback (most recent call last): File "C:\Users\admin\********\Desktop\Aegisub\pjsk_auto_story-main\start.py", line 114, in <module> win32gui.SetWindowPos(int(window_hwnd, 16), win32con.HWND_TOP, 0, 0, config.WINDOW_WIDTH, config.WINDOW_HEIGHT, win32con.SWP_SHOWWINDOW) ^^^^^^^^^^^^^^^^^^^^ TypeError: int() can't convert non-string with explicit base
Sorry i have no idea how to fix this :(
Sorry, I can't reproduce your problem, it may be caused by differences in the operating environment or python version
Line 114 in b6a0783
This is a possible solution, please replace int(window_hwnd, 16)
in the code with int(str(window_hwnd), 16)
After replace i have another issue like the image. its still in the same line i guess the problem its from the environment.
Btw i'm using py 3.11.4 so now i'll try to downgrade to py 3.8 and will edit the comment after do that
Update : after downgrade to py3.8 and retry. its still the same issue, nothing change :(