Skip to content

又出状况了 #22

@peakgao

Description

@peakgao

本来跑的好好的,我的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的上下文,导致某些函数执行出错?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions