KroMiose/pjsk_auto_story

problem when i tried to choose game windows (scrcpy)

Opened this issue · 7 comments

I really like your project so i install this and try. but i have problem when i choose the game windows ( i'm using scrcpy). Its show "调整窗口时发生错误,请检查窗口句柄是否正确!- 按下任意键退出程序...". and i have no idea what wrong with the game windows. Can you help me?
image

Update 1: I already tried to edit the config but its still print the text like the first comment
image

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 active the game before open the .bat file. I tried to open the file but the bat file don't work as admintrator( i guess it's because my device dont support/have CN font ). I tried other way but the reason its like the same. Here is the result ( sorry for the font error moment )
image

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

win32gui.SetWindowPos(int(window_hwnd, 16), win32con.HWND_TOP, 0, 0, config.WINDOW_WIDTH, config.WINDOW_HEIGHT, win32con.SWP_SHOWWINDOW)

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
image

Update : after downgrade to py3.8 and retry. its still the same issue, nothing change :(
image