3
votes

I try to keep a remote desktop window alive, i.e. to avoid screensaver and closing the connection due to inactivity timeout (I'm not allowed to configure the behaviour of remote desktop session).

Using pywinauto I only realised to connect to the application, but now e.g. app.Click() doesn't work. In the WWW there is no information how to simulate only clicking into the window.

Can anyone help me?

Thanks in advance.

2

2 Answers

1
votes

You need to describe the dialog on that you wanna click. There are 2 kinds of click also.

# it sends WM_LBUTTONDOWN and WM_LBUTTONUP messages to the window
app.RemoteDesktopConnection.Click()

# it generates "more natural" click with moving cursor to the window
app.RemoteDesktopConnection.ClickInput()

Clicking on the control in the dialog:

app.Window_(title='Remote Desktop Connection').Edit.ClickInput(double=True)
0
votes

Probably there is much simpler solution: https://serverfault.com/questions/250384/how-to-prevent-windows-7-remote-desktop-time-outs

Not sure it's available for you (since you're not an admin on the remote PC). Just another option to try.