Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

又出状况了 #22

Open
peakgao opened this issue May 2, 2022 · 1 comment
Open

又出状况了 #22

peakgao opened this issue May 2, 2022 · 1 comment

Comments

@peakgao
Copy link

peakgao commented May 2, 2022

本来跑的好好的,我的server运行在另外一台局域网内的服务器上,平时用的远程桌面连接,都正常,但是当我断开远程桌面连接后,就出问题了,表现在:
win32gui.SetForegroundWindow(hwnd)调用和win32api.SetCursorPos((x,y))调用出现‘’No error message is available‘’错误提示。
win32api.SetCursorPos((x,y))改成ctypes.windll.user32.SetCursorPos(x, y)后,不报错了,但是SetForegroundWindow解决不了,网上说在调用他之前执行
win32com.client.Dispatch("WScript.Shell").SendKeys('%')
也无济于事。
可能原因是远程桌面RDP断开后,服务器可能不保留GUI的上下文,导致某些函数执行出错?

@match5
Copy link
Owner

match5 commented Jul 31, 2022

运行程序的机器必须保持在活跃状态 如果是远程终端就不能断开 或者使用teamviewr代替远程终端

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants